added debug

Signed-off-by: Ebbe Baß <ebbe.bass>
main
Ebbe Baß 2024-02-14 22:18:41 +01:00
parent 9f67bac60c
commit 03fe682a0e
1 changed files with 14 additions and 11 deletions

View File

@ -126,18 +126,21 @@ def start_mqtt_publishers(universe_count):
if artNetPacket is not None and artNetPacket.data is not None: if artNetPacket is not None and artNetPacket.data is not None:
#Checks to see if the current packet is for the specified DMX Universe #Checks to see if the current packet is for the specified DMX Universe
dmxPacket = artNetPacket.data dmxPacket = artNetPacket.data
for i in range(512): # for i in range(512):
print(str(i)) # print(str(i))
print(str(artNetPacket.universe)) # print(str(artNetPacket.universe))
try: # try:
# Create MQTT topic based on the universe and channel # # Create MQTT topic based on the universe and channel
topic = f"{str(artNetPacket.universe)}/{str(i)}" # topic = f"{str(artNetPacket.universe)}/{str(i)}"
# Publish the DMX value to the MQTT topic # # Publish the DMX value to the MQTT topic
mqtt_client.publish(topic, str(dmxPacket[i-1])) # mqtt_client.publish(topic, str(dmxPacket[i-1]))
except KeyboardInterrupt: # except KeyboardInterrupt:
break # break
time.sleep(float(0.0001)) # time.sleep(float(0.0001))
print(str(artNetPacket.universe))
time.sleep(0.01)
except Exception as e: except Exception as e:
print(e) print(e)