Skip to content

Upstream draft: esp32 BLE reports the MTU exchange before the connection - #11

Merged
bdbarnett merged 1 commit into
mainfrom
upstream-mtu-draft
Sep 25, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
upstream-mtu-draft

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

A draft issue for micropython/micropython, for Brad to post; nothing has been posted. It's in docs/upstream/esp32-ble-mtu-before-connect.md, beside the WebREPL Ctrl-C draft.

What it says: on the esp32 port, a central that exchanges the MTU as it connects (Windows always does) gets _IRQ_MTU_EXCHANGED about 60 ms before _IRQ_CENTRAL_CONNECT. aioble then drops the MTU, and the board sends 20-byte notifications on a 247-byte link. The cause is in the IDF's NimBLE: it reports the connection only after reading the peer's version and features, while ATT is already answering. The NimBLE the other ports use (mynewt 1.4) reports the connection at once.

The repro in the draft was run today: Windows + bleak against an S3 showed MTU-first 5 times out of 5; a second S3 as the central showed the normal order 5 times out of 5, which is why board-to-board tests never caught it.

We carry no firmware patch for this. bledev works around it in Python (PyDevices/pydevices#81). The draft offers either fix, in the NimBLE binding or in aioble, and doesn't promise a PR beyond offering one.

@bdbarnett
bdbarnett merged commit 887ee25 into main Sep 25, 2026
@bdbarnett
bdbarnett deleted the upstream-mtu-draft branch September 25, 2026 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant