From e90e68fe77e6acea19b30ff747ce4788a0bb944b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Wed, 14 Feb 2024 22:33:40 +0100 Subject: [PATCH] removed universe count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/server/app.py b/server/app.py index 017819b..84e1986 100644 --- a/server/app.py +++ b/server/app.py @@ -38,8 +38,6 @@ db = MySQLdb.connect( database=config['mysql']['database'], ) -universe_count = config['artnet']['universe_count'] - mqtt_client_id = "PiXelTubeMaster-"+wlan_mac_address # Function to register a tube in the database @@ -109,7 +107,7 @@ def connect_mqtt(): client.connect("localhost", 1883) return client -def start_mqtt_publishers(universe_count): +def start_mqtt_publishers(): # Create and start a thread for each universe mqtt_client = connect_mqtt() artnetBindIp = get_eth0_ip() @@ -119,7 +117,6 @@ def start_mqtt_publishers(universe_count): try: while True: try: - # for universe in range(universe_count): # Gets whatever the last Art-Net packet we received is artNetPacket = artNet.readPacket() # Make sure we actually *have* a packet @@ -136,9 +133,7 @@ def start_mqtt_publishers(universe_count): # Publish the DMX value to the MQTT topic mqtt_client.publish(topic, str(dmxPacket[i-1])) except KeyboardInterrupt: - break - time.sleep(0.001) - + break except Exception as e: print(e) except KeyboardInterrupt: @@ -147,7 +142,7 @@ def start_mqtt_publishers(universe_count): print(e) if __name__ == "__main__": - start_mqtt_publishers(universe_count) + start_mqtt_publishers() # flask_thread = threading.Thread(target=flask_api()) # flask_thread.start() # flask_thread.join()