From 1e1dff1f264b067a6bb9842f6d92320f7eff4faa Mon Sep 17 00:00:00 2001 From: Torben Petersen <petersen@ibr.cs.tu-bs.de> Date: Thu, 21 Nov 2019 11:18:47 +0100 Subject: [PATCH] Coordinator now uses seld.server to generate rx topics --- software/coordinator2.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/software/coordinator2.py b/software/coordinator2.py index 14a0a13..543bb7e 100644 --- a/software/coordinator2.py +++ b/software/coordinator2.py @@ -180,7 +180,7 @@ class PRREvalClient(Thread): self.client.on_disconnect = self.on_disconnect self.client.loop_start() - self.server = "pc13" + self.server = "pi-a279" self.HUB_DISCOVERY_TOPIC = "hotplug/{}/discovery".format(self.server) self.HUB_DISCOVERY_ANSWER_TOPIC = "hotplug/{}/discovery/answer".format(self.server) @@ -207,10 +207,10 @@ class PRREvalClient(Thread): self.logger.debug("Got nodes: {}".format(all_nodes)) for node in all_nodes: if node not in self.my_nodes and node is not '': - self.logger.debug("Subscribing!") self.my_nodes.append(node) - rx_topic = "hotplug/pc13/{}/rx".format(node) + rx_topic = "hotplug/{}/{}/rx".format(self.server, node) self.client.subscribe(rx_topic, qos=2) + self.logger.debug("Subscribing to {}!".format(rx_topic)) print("My Nodes: {}".format(self.my_nodes)) elif topic[0] == "hotplug" and len(topic) == 4: unpacked_msg = str(msg.payload)[2:][:-1] -- GitLab