-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python SDK does not robustly handle BLE connection failures / drops #487
Comments
I've made some changes to this in the last release. However the bigger issue here is that the Wire(less)GoPro objects are not designed to persist through subsequent connections. I haven't spent much time on this because I don't think bleak robustly manages, at least on Windows, failed / reconnections. In any case, there is a large investigation required to improve the robustness here. |
I'm going to use this ticket as the gathering location for all BLE connection-robustness issues. |
Another symptom: BLE connection drops after provisioning COHN even though there is still a communication channel through COHN cause state management to break. We're going to need to rearchitect the entire connection scheme to be scalable for multiple connections / types. |
Relevent bleak ticket here: hbldh/bleak#367 |
@tcamise-gpsw Is there any prospect of this issue being resolved? Best regards, |
Note! This ticket will capture any and all issues relating to Python SDK BLE:
In general, these use cases have not yet been designed for / tested against and I'm not sure much of this is even solvable in the Python SDK due to the lack of robustness in Bleak and the OS's BLE stack. But it needs a major investigation on each operating system.
Component
In the Python SDK.
Describe the bug
If the connection to a GoPro fails, the WirelessGoPro._periodic_keep_alive coroutine is left open.
To Reproduce
Start connection to a GoPro and have it fail (stop ble adapter or remove GoPro battery)
Then we can observe _periodic_keep_alive by checking the running coroutines:
tasks = asyncio.all_tasks()
coroutine_name = task.get_coro().qualname
Expected behavior
I would expect the keepalive to be stopped once the Connection fails.
Hardware
Hero 11
Linux 6
Additional context
I'll try to investigate later if this can be solved by initiating connection within a contextlib.AsyncExitStack().
The text was updated successfully, but these errors were encountered: