Skip to content

[Aioble] Update Parameters request from Central not answered by Peripheral. #841

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

Closed
Quaditz opened this issue Apr 7, 2024 · 2 comments
Closed

Comments

@Quaditz
Copy link

Quaditz commented Apr 7, 2024

Hello,

see

hbldh/bleak#1262

If you just want the measurements: hbldh/bleak#1262 (comment)

On Windows 10, no "Sent LE Connection Update" is sent by the Central GATT Client. In that case, everything works fine.

On Windows 11, a "Sent LE Connection Update" is sent by the Central GATT Client. In that case, the connection breaks down.

The link above has Wireshark Bluetooth logs attached from the computer side, which uses Bleak to create a Central GATT Client. I run Aioble on the Peripheral device side as Peripheral GATT Server.

The problem in the link above is, that Bleak crashes in Windows 11 while it works perfectly fine in Windows 10. Our suspicion is, that the Peripheral does not handle the "Sent LE Connection Update" correctly.

On the Aioble side, I also get an error (in the time where the Bleak client freezes on Windows 11):

Traceback (most recent call last):
File "", line 167, in
File "asyncio/core.py", line 1, in run
File "asyncio/core.py", line 1, in run_until_complete
File "asyncio/core.py", line 1, in run_until_complete
File "", line 164, in main
File "asyncio/funcs.py", line 1, in gather
File "asyncio/core.py", line 1, in run_until_complete
File "", line 88, in advertise
File "aioble/device.py", line 295, in aexit
File "aioble/device.py", line 216, in disconnect
File "aioble/device.py", line 232, in disconnected
File "aioble/device.py", line 232, in disconnected
File "asyncio/core.py", line 1, in run_until_complete
File "aioble/device.py", line 198, in device_task
File "asyncio/event.py", line 1, in wait
CancelledError:

The error does not even referr to a line of code that I have written, so it must happen during the

await connection.disconnected()

stage after I have initiated the connection via

async with await aioble.advertise(...) as connection:
...
await connection.disconnected()

The same code (on both sides, same server code and same client code) runs perfectly on Windows 10. And the only difference that we see in the Wireshark logs (see link above) is that under Windows 11 a Sent LE Connection Update is sent by the client.

@dlech
Copy link

dlech commented Apr 7, 2024

To be more clear, apparently Windows 11 now requires peripherals to support the "Connection Parameter Update procedure" (e.g. Bluetooth core spec 5.3, vol 3, part C, sec 9.3.9) and is hanging because it never gets a response from an RPi Pico running MicroPtython.

This is a low level procedure that should be handled by BTStack already. So if it isn't I'm guessing there is an issue with pumping BTStack events in the MicroPython code somewhere or a bug in BTStack where it doesn't respond to this request under specific conditions.

In any case, this is a core MicroPython issue, not micropython-lib.

@Quaditz
Copy link
Author

Quaditz commented Apr 8, 2024

Duplicated, issue tracked via

micropython/micropython#14268

@Quaditz Quaditz closed this as not planned Won't fix, can't repro, duplicate, stale Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants