From 3cff4e28561ed7e230ceb353829604e06b6745d2 Mon Sep 17 00:00:00 2001 From: Mike Kinney Date: Sat, 11 Dec 2021 17:49:09 -0800 Subject: [PATCH] add change as suggested by OverByThere --- meshtastic/node.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/meshtastic/node.py b/meshtastic/node.py index c611e25..e2c1e61 100644 --- a/meshtastic/node.py +++ b/meshtastic/node.py @@ -214,10 +214,16 @@ class Node: def onResponse(p): """A closure to handle the response packet""" - self.radioConfig = p["decoded"]["admin"]["raw"].get_radio_response - logging.debug("Received radio config, now fetching channels...") - self._timeout.reset() # We made foreward progress - self._requestChannel(0) # now start fetching channels + errorFound = False + if 'routing' in p["decoded"]: + if p["decoded"]["routing"]["errorReason"] != "NONE": + errorFound = True + print(f'Error on response: {p["decoded"]["routing"]["errorReason"]}') + if errorFound is False: + self.radioConfig = p["decoded"]["admin"]["raw"].get_radio_response + logging.debug("Received radio config, now fetching channels...") + self._timeout.reset() # We made foreward progress + self._requestChannel(0) # now start fetching channels # Show progress message for super slow operations if self != self.iface.localNode: