From 923f0e4685104b1cddf537fec7b6e4d67850a28f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 17 Feb 2024 17:10:56 +0100 Subject: [PATCH] testing some weird siht MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/app.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/server/app.py b/server/app.py index fe536f8..7544491 100644 --- a/server/app.py +++ b/server/app.py @@ -114,10 +114,6 @@ def mqtt_publisher(): artnetBindIp = get_eth0_ip() artNet = Artnet.Artnet(BINDIP = artnetBindIp, DEBUG = True, SHORTNAME = "PiXelTubeMaster", LONGNAME = "PiXelTubeMaster", PORT = 6454) while True: - cur = db.cursor() - cur.execute("SELECT mac_address, universe, dmx_address FROM tubes") - TUBE_INDEX = cur.fetchall() - cur.close() try: # Gets whatever the last Art-Net packet we received is artNetPacket = artNet.readPacket() @@ -149,4 +145,10 @@ if __name__ == "__main__": flask_thread = Process(target=flask_api) flask_thread.start() publisher_thread = Process(target=mqtt_publisher) - publisher_thread.start() \ No newline at end of file + publisher_thread.start() + while True: + cur = db.cursor() + cur.execute("SELECT mac_address, universe, dmx_address FROM tubes") + TUBE_INDEX = cur.fetchall() + cur.close() + time.sleep(1) \ No newline at end of file