Skip to content
Snippets Groups Projects
Commit 226746e7 authored by Torben Petersen's avatar Torben Petersen
Browse files

coordinator2.py: Discovery is now only done on startup

parent b6dd75e6
No related branches found
No related tags found
No related merge requests found
......@@ -270,18 +270,20 @@ class PRREvalClient(Thread):
#wait until both clients are connected!
while self.connected < 2:
pass
self.logger.debug("Publishing message on topic: {}".format(self.HUB_ONE_DISCOVERY_TOPIC))
self.client_one.publish(self.HUB_ONE_DISCOVERY_TOPIC, struct.pack("d", 5), qos=2)
self.logger.debug("Publishing message on topic: {}".format(self.HUB_TWO_DISCOVERY_TOPIC))
self.client_two.publish(self.HUB_TWO_DISCOVERY_TOPIC, struct.pack("d", 5), qos=2)
#wait until we have 14 Nodes (7 in each chamber)
self.logger.info("Waiting for Node Data!")
while len(self.my_nodes) != 14:
pass
self.logger.info("Got Data of all Nodes!")
#if we have no nodes, subscribe to discovery topics
if len(self.my_nodes) != 14:
self.logger.debug("Publishing message on topic: {}".format(self.HUB_ONE_DISCOVERY_TOPIC))
self.client_one.publish(self.HUB_ONE_DISCOVERY_TOPIC, struct.pack("d", 5), qos=2)
self.logger.debug("Publishing message on topic: {}".format(self.HUB_TWO_DISCOVERY_TOPIC))
self.client_two.publish(self.HUB_TWO_DISCOVERY_TOPIC, struct.pack("d", 5), qos=2)
#wait until we have 14 Nodes (7 in each chamber)
self.logger.info("Waiting for Node Data!")
while len(self.my_nodes) != 14:
pass
self.logger.info("Got Data of all Nodes!")
global eval_round
self.logger.info("Hallo")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment