Multiple connections and handling bleak errors #574
Replies: 2 comments
-
Can i see the code of the GUI alongwith the script for multiple connections. I have recently figured out my script for my 5 BLE devices, and it works really well. But the problem is that on Windows the maximum connections i have seen is 3 or sometimes 4. But the Windows ble stack disconnects the devices very often. Then I tried it on raspberry pi, that has a 4.2 bluetooth on-board.It connects to all 5 devices every time i run the script. |
Beta Was this translation helpful? Give feedback.
-
I have added this discussion the the #266 issue. There needs to be some basic documentation on how to use GUI software with Bleak in the documentation, and this problem with handling exceptions that crash the GUI is a prime example of what needs to be in there. |
Beta Was this translation helpful? Give feedback.
-
My gui program crashes when bleak throws an error like the following:
raise BleakError( bleak.exc.BleakError: Could not stop notify on 6e400003-b5a3-f393-e0a9-e50e24dcca9e: Unreachable
This kind of thing doesn't happen too often, but seems to be more likely when trying to connect to multiple devices at once. This is a capability I'd really like to have (currently testing 3 devices and getting unreliable results). What are the limitations of multiple BLE connections at once? Are there known issues with Windows and/or Bleak?
How do I keep my gui from crashing when things go wrong? The gui itself is the main event loop, and I'm calling bleak from a worker thread using PyQt's built-in Qthread. In that thread, the asyncio loop is created and called. This happens for each device on a new thread.
Beta Was this translation helpful? Give feedback.
All reactions