Skip to content

Python SDK does not robustly handle BLE connection failures / drops #487

@epheo

Description

@epheo

Note! This ticket will capture any and all issues relating to Python SDK BLE:

  • recovery from failures to establish connection
  • recovery from connection drops
  • closing and re-opening Wired / Wireless GoPro objecvts

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is neededpython sdkPython SDKrobustnessTemporary label to track issues related to (lack of) camera robustness

    Type

    No type

    Projects

    Status

    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions