From 111d61ea0ac4c121104d6ec0090b891c15fff7d0 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Sun, 30 Jun 2024 13:00:12 -0700 Subject: [PATCH] bleak reads can hang if a device walks out of range, cope with that. --- meshtastic/ble_interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshtastic/ble_interface.py b/meshtastic/ble_interface.py index bb6e8ec..b5f9f7d 100644 --- a/meshtastic/ble_interface.py +++ b/meshtastic/ble_interface.py @@ -205,7 +205,7 @@ class BLEInterface(MeshInterface): if self._want_receive: self.want_receive = False # Tell the thread we want it to stop - self._receiveThread.join() + self._receiveThread.join(timeout=2) # If bleak is hung, don't wait for the thread to exit (it is critical we disconnect) self._receiveThread = None if self.client: