artnet receiver passthrough

Signed-off-by: Ebbe Baß <ebbe.bass>
main
Ebbe Baß 2024-02-13 16:20:52 +01:00
parent bc5ac6de73
commit 5165c85ded
1 changed files with 3 additions and 3 deletions

View File

@ -113,11 +113,12 @@ def connect_mqtt():
return client
def mqtt_publisher(universe, artnetPacket):
def mqtt_publisher(universe, artnet_receiver):
universe = universe-1
mqtt_client = connect_mqtt()
try:
while True:
artnetPacket = artnet_receiver.readPacket()
try:
if artnetPacket is not None and artnetPacket.data is not None:
if artnetPacket.universe == universe:
@ -142,11 +143,10 @@ def start_mqtt_publishers(universe_count):
artnet_receiver = Artnet.Artnet(DEBUG = True, SHORTNAME = "PiXelTubeMaster", LONGNAME = "PiXelTubeMaster - "+str(get_mac_address), REFRESH = 60)
print(str(get_eth0_ip()))
artnetPacket = artnet_receiver.readPacket()
print(2)
# Create and start a thread for each universe
for universe in universes_to_publish:
threads = [threading.Thread(target=mqtt_publisher, args=(universe, artnetPacket))]
threads = [threading.Thread(target=mqtt_publisher, args=(universe, artnet_receiver))]
print(3)
for thread in threads: