From 8e784289c48065ea935dc666608821208c51df97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 17 Feb 2024 02:37:31 +0100 Subject: [PATCH] commented publish commands and move cur to a public positiin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server/app.py b/server/app.py index 8bc8f68..1bcda33 100644 --- a/server/app.py +++ b/server/app.py @@ -41,12 +41,12 @@ db = MySQLdb.connect( ) db.autocommit(True) +cur = db.cursor() mqtt_client_id = "PiXelTubeMaster-"+wlan_mac_address # Function to register a tube in the database def register_tube(mac_address): - cur = db.cursor() # Check if the tube already exists in the database cur.execute("SELECT * FROM tubes WHERE mac_address = %s", (mac_address,)) @@ -124,10 +124,12 @@ def start_mqtt_publishers(): #Checks to see if the current packet is for the specified DMX Universe dmxPacket = artNetPacket.data # Create MQTT topic based on the universe and channel - topic = "PiXelTubes/"+str(artNetPacket.universe) + + + # topic = "PiXelTubes/"+str(artNetPacket.universe) - # Publish the DMX value to the MQTT topic - mqtt_client.publish(topic, str(dmxPacket)) + # # Publish the DMX value to the MQTT topic + # mqtt_client.publish(topic, str(dmxPacket)) except KeyboardInterrupt: artNet.close() sys.exit()