Skip to content

Windows: BleakClientWinRT _get_services frequently times out #1829

@gudnimg

Description

@gudnimg

I've tried also tried extending the timeout to 30 seconds. No luck. I'm unsure how to debug this further. When I use nRF Connect for Desktop or the nRF Connect app, discovering services is pretty quick. My peripheral is using Zephyr / NCS 3.1.0 firmware, not sure if that can affect things.

2025-09-19 12:12:40,060 bleak.backends.winrt.scanner DEBUG: 46 devices found. Watcher status: <BluetoothLEAdvertisementWatcherStatus.STOPPED: 3>.
2025-09-19 12:12:40,174 bleak.backends.winrt.client DEBUG: Connecting to BLE device @ [MY BDA]
2025-09-19 12:12:40,237 bleak.backends.winrt.client DEBUG: getting services (service_cache_mode=None, cache_mode=None)...
2025-09-19 12:13:10,253 bleak.backends.winrt.client DEBUG: closing requester
2025-09-19 12:13:10,256 bleak.backends.winrt.client DEBUG: closing session

Some info about my setup:

Code:

# start the connection, here it hangs on discovering services
async with BleakClient( device, disconnected_handler ) as client:
    # Just some code not relevant to issue

I find the device using await BleakScanner.find_device_by_name and also sometimes await BleakScanner.find_device_by_address. I don't see a difference in behavior when it comes to discovering services.


I can debug further and share logs if possible. Any advice how to debug the issue further would be very appreciated! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    3rd party issueThe issue is with the Bluetooth stack, the BLE device, or other 3rd party code not with Bleak itselfBackend: WinRTIssues or PRs relating to the WinRT backend

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions