Skip to content

Commit 00f8c8f

Browse files
committed
Discover motes on startup
1 parent 9602de2 commit 00f8c8f

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

otbox.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,7 @@ def bootload_mote(self, serialport, firmware_file):
171171
stderr=subprocess.PIPE)
172172

173173
def on_mqtt_connect(self):
174-
# in case of IoT-LAB mote discovery is started immediately upon `otbox.py` startup
175-
payload_status = {
176-
'token': 123
177-
}
178-
self._otbox._mqtt_handler_discovermotes('box', 'all', json.dumps(payload_status))
174+
pass
179175

180176
class WilabTestbed(Testbed):
181177

@@ -202,11 +198,7 @@ def bootload_mote(self, serialport, firmware_file):
202198
return subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
203199

204200
def on_mqtt_connect(self):
205-
# in case of WiLab mote discovery is started immediately upon `otbox.py` startup
206-
payload_status = {
207-
'token': 123
208-
}
209-
self._otbox._mqtt_handler_discovermotes('box', 'all', json.dumps(payload_status))
201+
pass
210202

211203

212204
AVAILABLE_TESTBEDS = {
@@ -307,6 +299,8 @@ def _on_mqtt_connect(self, client, userdata, flags, rc):
307299

308300
self.tb.on_mqtt_connect()
309301

302+
# discover motes
303+
self._excecute_command_safely('box', 'all', json.dumps({'token': 123}), 'discovermotes')
310304

311305
def _on_mqtt_message(self, client, userdata, message):
312306

0 commit comments

Comments
 (0)