From 5165c85dedf010fb9feb80d1939f9f5330d654d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Tue, 13 Feb 2024 16:20:52 +0100 Subject: [PATCH] artnet receiver passthrough MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/app.py b/server/app.py index 6e6b337..5ec2b84 100644 --- a/server/app.py +++ b/server/app.py @@ -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: