From 30cd752d132f17a20edead2a2e37554235fde937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Wed, 14 Feb 2024 22:29:33 +0100 Subject: [PATCH] added publisher back MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/server/app.py b/server/app.py index dc32209..017819b 100644 --- a/server/app.py +++ b/server/app.py @@ -126,21 +126,18 @@ def start_mqtt_publishers(universe_count): if artNetPacket is not None and artNetPacket.data is not None: #Checks to see if the current packet is for the specified DMX Universe dmxPacket = artNetPacket.data - # for i in range(512): - # print(str(i)) - # print(str(artNetPacket.universe)) - # try: - # # Create MQTT topic based on the universe and channel - # topic = f"{str(artNetPacket.universe)}/{str(i)}" + for i in range(512): + print(str(i)) + print(str(artNetPacket.universe)) + try: + # Create MQTT topic based on the universe and channel + topic = f"{str(artNetPacket.universe)}/{str(i)}" - # # Publish the DMX value to the MQTT topic - # mqtt_client.publish(topic, str(dmxPacket[i-1])) - # except KeyboardInterrupt: - # break - # time.sleep(float(0.0001)) - - print(str(artNetPacket.universe)) - time.sleep(0.01) + # Publish the DMX value to the MQTT topic + mqtt_client.publish(topic, str(dmxPacket[i-1])) + except KeyboardInterrupt: + break + time.sleep(0.001) except Exception as e: print(e)