diff --git a/controller/camera_capture.py b/controller/camera_capture.py index f1e89bd..99fc648 100644 --- a/controller/camera_capture.py +++ b/controller/camera_capture.py @@ -1,3 +1,3 @@ import camera -camera.capture_picture(): +camera.capture_picture() diff --git a/controller/camera_send.py b/controller/camera_send.py index e3acd68..ca1103d 100644 --- a/controller/camera_send.py +++ b/controller/camera_send.py @@ -1,4 +1,4 @@ -import camera +import drivers.camera import requests import config diff --git a/controller/config/copy__init__.py.example b/controller/config/copy__init__.py.example index 26312c8..cdfbc78 100644 --- a/controller/config/copy__init__.py.example +++ b/controller/config/copy__init__.py.example @@ -1,5 +1,3 @@ - - GPIO_PIN_DHT = 4 # BCM SENSORDATA_URL = 'http://agrar.zoblak.com/api/v1.0/sensorData' GPIO_PIN_TANKLEVEL0 = 5 # BCM @@ -17,5 +15,5 @@ CONTROLLER_ID = '120' # every controller must have a different one STATE_FILE = '/mnt/zoblakdata/controller_state' PICTURE_TRANSFER_FILE='/mnt/zoblakdata/picture_transfer_ready.jpg' PICTURE_INPUT_FILE='/mnt/zoblakdata/picture.jpg' # must match file in PICTURE_COMMAND -PICTURE_COMMAND='avconv -i rtsp://192.168.1.10:554//user=admin_password=_channel=1_stream=0.sdp -f image2 -vframes 1 /mnt/zoblakdata/picture.jpg' # filename must match PICTURE_FILE path +PICTURE_COMMAND='avconv -i rtsp://192.168.1.10:554//user=admin_password=_channel=1_stream=0.sdp -i zoblakLogo.png -filter_complex "[0:v]drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf:fontsize=30:box=1:boxcolor=black@0.75:text='%d\.%m\.%Y\. %H\:%M\:%S':fontcolor=white@0.8: x=10: y=10[text]; [text][1:v]overlay=main_w-overlay_w-5:5 [filtered]" -map "[filtered]" -f image2 -vframes 1 /mnt/zoblakdata/picture.jpg' # filename must match PICTURE_INPUT_FILE path PICTURE_URL = 'http://agrar.zoblak.com/api/v1.0/picture/' diff --git a/controller/drivers/__init__.py b/controller/drivers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/controller/sensors.py b/controller/sensors.py index dc1b33e..70ea964 100644 --- a/controller/sensors.py +++ b/controller/sensors.py @@ -4,7 +4,6 @@ import requests import Adafruit_DHT import config import RPi.GPIO as GPIO -import camera # Try to read the state of GPIO_PIN_TANKLEVELx and GPIO_PIN_TANKFULL GPIO.setmode(GPIO.BCM)