parent
887843e703
commit
92596c9111
|
@ -112,8 +112,7 @@ def connect_mqtt():
|
||||||
return client
|
return client
|
||||||
|
|
||||||
|
|
||||||
def mqtt_publisher(universe):
|
def mqtt_publisher(artnetUniverse):
|
||||||
artnetUniverse = universe-1
|
|
||||||
mqtt_client = connect_mqtt()
|
mqtt_client = connect_mqtt()
|
||||||
artnetBindIp = "192.168.0.1"
|
artnetBindIp = "192.168.0.1"
|
||||||
artNet = Artnet.Artnet(BINDIP = artnetBindIp, DEBUG = False, SHORTNAME = "PiXelTubeMaster", LONGNAME = "PiXelTubeMaster", PORT = 6454, REFRESH=30)
|
artNet = Artnet.Artnet(BINDIP = artnetBindIp, DEBUG = False, SHORTNAME = "PiXelTubeMaster", LONGNAME = "PiXelTubeMaster", PORT = 6454, REFRESH=30)
|
||||||
|
@ -149,19 +148,15 @@ def start_mqtt_publishers(universe_count):
|
||||||
used_universes = universe_count
|
used_universes = universe_count
|
||||||
print("universe count: "+str(used_universes))
|
print("universe count: "+str(used_universes))
|
||||||
universes_to_publish = list(range(1, used_universes + 1))
|
universes_to_publish = list(range(1, used_universes + 1))
|
||||||
print(2)
|
|
||||||
# Create and start a thread for each universe
|
# Create and start a thread for each universe
|
||||||
for universe in universes_to_publish:
|
for universe in universes_to_publish:
|
||||||
threads = [threading.Thread(target=mqtt_publisher, args=(universe,))]
|
threads = [threading.Thread(target=mqtt_publisher, args=(universe,))]
|
||||||
print(3)
|
|
||||||
|
|
||||||
for thread in threads:
|
for thread in threads:
|
||||||
thread.start()
|
thread.start()
|
||||||
print(4)
|
|
||||||
|
|
||||||
for thread in threads:
|
for thread in threads:
|
||||||
thread.join()
|
thread.join()
|
||||||
print(5)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
start_mqtt_publishers(universe_count)
|
start_mqtt_publishers(universe_count)
|
||||||
|
|
Loading…
Reference in New Issue