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