From 0f95d4207aa8220c9fdc8e035e21dc85efc2248c Mon Sep 17 00:00:00 2001 From: Joel Klimont Date: Thu, 14 Oct 2021 13:37:33 +0200 Subject: [PATCH 1/2] stability improvements for ip daemon --- compLib/VisionDaemon.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/compLib/VisionDaemon.py b/compLib/VisionDaemon.py index 9114923..1fd4ca3 100644 --- a/compLib/VisionDaemon.py +++ b/compLib/VisionDaemon.py @@ -1,3 +1,4 @@ +import datetime import os import socket import threading @@ -47,7 +48,7 @@ def get_ip(): s.connect(('10.255.255.255', 1)) IP = s.getsockname()[0] except Exception: - IP = '127.0.0.1' + IP = 'Not connected' print(f"Error could not query ip: {e}") finally: s.close() @@ -56,12 +57,17 @@ def get_ip(): def write_ip_to_screen(): while os.getenv("IP_OUTPUT", "true") == "true": - ip = str(get_ip()) - print(f"writing {ip} to display") - Logging.get_logger().info(f"writing {ip} to display") - Display.write(1, "Current IP:") - Display.write(2, ip) - time.sleep(5) + try: + ip = str(get_ip()) + print(f"writing {ip} to display") + Logging.get_logger().info(f"writing {ip} to display") + Display.write(1, "Current IP:") + Display.write(2, ip) + Display.write(3, datetime.datetime.now().strftime("%b %d %Y %H:%M:%S")) + time.sleep(5) + except Exception as e: + print(f"Exception in write ip thread: {e}") + time.sleep(5) if __name__ == '__main__': From 74db0ca67691ba36d965feedcbc58c6ea197ad69 Mon Sep 17 00:00:00 2001 From: Joel Klimont Date: Thu, 14 Oct 2021 13:44:12 +0200 Subject: [PATCH 2/2] updated version number --- build_deb.sh | 2 +- compLib/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build_deb.sh b/build_deb.sh index 7c4e00e..78a8d3a 100755 --- a/build_deb.sh +++ b/build_deb.sh @@ -34,7 +34,7 @@ fpm -s python --python-bin python3 --python-pip pip3 --python-package-name-prefi -d "python3-pigpio" \ -d "python3-numpy" \ -d "ffmpeg" \ - -v 0.2.6-1 -t deb setup.py + -v 0.2.7-0 -t deb setup.py # --deb-changelog changelog \ # --deb-upstream-changelog changelog \ diff --git a/compLib/__init__.py b/compLib/__init__.py index 28b40b2..372d078 100644 --- a/compLib/__init__.py +++ b/compLib/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.2.6-1" +__version__ = "0.2.7-0" import importlib import compLib.LogstashLogging diff --git a/setup.py b/setup.py index b5d4b9c..119fd76 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ else: setuptools.setup( name="complib", - version="0.2.6-1", + version="0.2.7-0", author="F-WuTs", author_email="--", description="",