commit 11/12
This commit is contained in:
40
test.py
40
test.py
@@ -1,14 +1,17 @@
|
||||
import csv, requests
|
||||
from instruments import Camera_Debug2 as Camera
|
||||
from datahandling import Datareporter_Debug3 as Datareporter
|
||||
from system import System_Debug
|
||||
from instruments import Camera
|
||||
from datahandling import Datareporter
|
||||
from system import System
|
||||
import serial
|
||||
import sys
|
||||
import logging
|
||||
import base64
|
||||
from requests_toolbelt import MultipartEncoder
|
||||
from time import sleep
|
||||
from logging import config
|
||||
|
||||
logging.getLogger("datahandling")
|
||||
config.fileConfig('logging.ini')
|
||||
logging.getLogger("inetgsm")
|
||||
|
||||
data = {"temp":1,"press":3,"altitude":2,"cheetas":"just enough"}
|
||||
|
||||
@@ -17,6 +20,7 @@ pass
|
||||
com_port_name = "/dev/ttyAMA0"
|
||||
|
||||
image = open("resized_image.jpg", 'rb')
|
||||
image = image.read()
|
||||
# image = image.read()
|
||||
|
||||
# e=base64.b64encode(image)
|
||||
@@ -26,7 +30,7 @@ image = open("resized_image.jpg", 'rb')
|
||||
# m = MultipartEncoder(fields={'image': ('image', image, 'image/jpeg')})
|
||||
|
||||
report = Datareporter (
|
||||
use_lan = True,
|
||||
# use_lan = True,
|
||||
url = "http://home.ascorrea.com",
|
||||
server_port = 5010,
|
||||
data_path = "upload-data",
|
||||
@@ -35,28 +39,30 @@ report = Datareporter (
|
||||
ping_path="ping",
|
||||
baud_rate = 9600)
|
||||
|
||||
camera = Camera (low_quality_compression_pct=10,
|
||||
low_quality_resolution=(320, 240),
|
||||
high_quality_compression_pct=100,
|
||||
high_quality_resolution=(2592,1944),
|
||||
vflip=True,
|
||||
hflip=True,
|
||||
exposure_mode='sports'
|
||||
)
|
||||
# camera = Camera (low_quality_compression_pct=10,
|
||||
# low_quality_resolution=(320, 240),
|
||||
# high_quality_compression_pct=100,
|
||||
# high_quality_resolution=(2592,1944),
|
||||
# vflip=True,
|
||||
# hflip=True,
|
||||
# # exposure_mode='sports'
|
||||
# )
|
||||
|
||||
# print (report.check())
|
||||
# print (image)
|
||||
# report.send(m.to_string(), message_type="image")
|
||||
# report.send(data, message_type="data")
|
||||
|
||||
img = camera.capture()
|
||||
report.send(img.get('lo'), message_type="image")
|
||||
# img = camera.capture()
|
||||
# report.send(img.get('lo'), message_type="image")
|
||||
|
||||
# report.send(image, message_type="image")
|
||||
|
||||
|
||||
# execfile("test_sms.py")
|
||||
|
||||
# report.send("1",message_type="ping")
|
||||
for i in range(1,10):
|
||||
print (i)
|
||||
report.send(image,message_type="image")
|
||||
sleep(1)
|
||||
|
||||
pass
|
||||
Reference in New Issue
Block a user