From e48a43710e9d0cb0d928202326a3e7bd0b0014ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Fri, 16 Feb 2024 00:11:37 +0100 Subject: [PATCH] test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 23 +++++++++++------------ server/exampleReceiver.py | 4 ++-- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/server/app.py b/server/app.py index f89e565..8a98c65 100644 --- a/server/app.py +++ b/server/app.py @@ -119,18 +119,17 @@ def start_mqtt_publishers(): # Gets whatever the last Art-Net packet we received is artNetPacket = artNet.readPacket() # Make sure we actually *have* a packet - 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): - 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 + #Checks to see if the current packet is for the specified DMX Universe + dmxPacket = artNetPacket.data + for i in range(512): + 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(0.01) except Exception as e: print(e) diff --git a/server/exampleReceiver.py b/server/exampleReceiver.py index ceed5d9..1868c9e 100644 --- a/server/exampleReceiver.py +++ b/server/exampleReceiver.py @@ -15,8 +15,8 @@ def get_eth0_ip(): debug = False ### ArtNet Config ### -artnetBindIp = str(get_eth0_ip()) -# artnetBindIp = "10.0.0.4" +# artnetBindIp = str(get_eth0_ip()) +artnetBindIp = "10.0.0.4" artnetUniverse = 0 ### Art-Net Setup ###