From 851c18bc273833e33c02f574c52ad693512b5a40 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Fri, 11 Sep 2026 16:18:24 +0200 Subject: [PATCH] Improved RNode BLE reconnect reliability --- RNS/Interfaces/RNodeInterface.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/RNS/Interfaces/RNodeInterface.py b/RNS/Interfaces/RNodeInterface.py index d39e65a7..d478fe05 100644 --- a/RNS/Interfaces/RNodeInterface.py +++ b/RNS/Interfaces/RNodeInterface.py @@ -386,6 +386,7 @@ class RNodeInterface(Interface): RNS.log(f"Opening BLE connection for {self}...") self.timeout = 1250 if self.ble != None and self.ble.running == False: + RNS.log(f"Cleaning up previous BLE connection for {self}...") self.ble.close() self.ble.cleanup() self.ble = None @@ -442,7 +443,11 @@ class RNodeInterface(Interface): ble_detect_timeout = 5.0 detect_time = time.time() while not self.detected and time.time() < detect_time + ble_detect_timeout: time.sleep(0.1) - if not self.detected: RNS.log(f"RNode detect timed out over BLE", RNS.LOG_ERROR) + if not self.detected: + RNS.log(f"RNode detect timed out over BLE", RNS.LOG_ERROR) + if self.ble: + self.ble.should_run = False + self.ble.must_disconnect = True else: sleep(0.2)