changed api client according to specification
bug fixes in VisionDaemon
This commit is contained in:
parent
ce6b06544a
commit
5e46e8068a
6 changed files with 143 additions and 63 deletions
|
@ -8,11 +8,13 @@ from LogstashLogging import logstash_logger
|
|||
from threading import Thread
|
||||
import logging
|
||||
|
||||
RUN_CHECK = False
|
||||
try:
|
||||
from Battery import Battery
|
||||
from Buzzer import Buzzer
|
||||
RUN_CHECK = True
|
||||
except Exception as e:
|
||||
logstash_logger.error("unable to import battery or buzzer in daemon")
|
||||
logstash_logger.error(f"unable to import battery or buzzer in daemon -> {str(e)}")
|
||||
|
||||
__run = """raspivid -t 0 -b 5000000 -w 1280 -h 720 -fps 30 -n -o - | gst-launch-1.0 fdsrc ! video/x-h264,width=1280,height=720,framerate=30/1,noise-reduction=1,profile=high,stream-format=byte-stream ! h264parse ! queue ! flvmux streamable=true ! rtmpsink location=\"rtmp://localhost/live/stream\""""
|
||||
|
||||
|
@ -43,12 +45,13 @@ if __name__ == '__main__':
|
|||
|
||||
logstash_logger.info("starting battery checker")
|
||||
battery_checker = None
|
||||
try:
|
||||
battery_checker = threading.Thread(target=check_battery)
|
||||
battery_checker.start()
|
||||
logstash_logger.info("starting battery checker - DONE")
|
||||
except Exception as e:
|
||||
logstash_logger.error(f"could not start battery checker -> {str(e)}")
|
||||
if RUN_CHECK:
|
||||
try:
|
||||
battery_checker = threading.Thread(target=check_battery)
|
||||
battery_checker.start()
|
||||
logstash_logger.info("starting battery checker - DONE")
|
||||
except Exception as e:
|
||||
logstash_logger.error(f"could not start battery checker -> {str(e)}")
|
||||
|
||||
if STREAM_RASPI:
|
||||
logstash_logger.info("starting gstreamer background process")
|
||||
|
@ -59,5 +62,5 @@ if __name__ == '__main__':
|
|||
if battery_checker is not None:
|
||||
battery_checker.join()
|
||||
else:
|
||||
logstash_logger.info("battery checker failed to initialize.. sleeping for a day")
|
||||
logstash_logger.info("battery checker failed to initialize.. sleeping for a day, good night")
|
||||
time.sleep(60*60*24)
|
||||
|
|
Reference in a new issue