Skip to content

Fix slow espressif BLE discovery#11050

Open
dhalbert wants to merge 3 commits into
adafruit:mainfrom
dhalbert:dhalbert/fix-espressif-ble-discovery
Open

Fix slow espressif BLE discovery#11050
dhalbert wants to merge 3 commits into
adafruit:mainfrom
dhalbert:dhalbert/fix-espressif-ble-discovery

Conversation

@dhalbert

@dhalbert dhalbert commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

#11051 should be merged before this is merged.

The code in this PR was largely created by Copilot, after a session I had to debug slow discovery on LEGO WeDo 2.0.

  • Do not write to remote characteristics while constructing discovered remote characteristics. This was done erroneously.
  • There was one global timeout for the entire discovery process. Make discovery timeouts apply per discovery step.
  • stop descriptor discovery at the next characteristic definition handle

Tested that discovery works against a LEGO WeDo 2.0 device with original NimBLE settings.

dhalbert and others added 2 commits June 12, 2026 09:13
Avoid writing to remote characteristics during discovery, and make descriptor discovery use per-step timeouts and the correct end handle.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dhalbert dhalbert force-pushed the dhalbert/fix-espressif-ble-discovery branch from 7c1f59f to 4433e99 Compare June 12, 2026 13:13
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

Successfully merging this pull request may close these issues.

LEGO WeDo 2.0 BLE service discoverycauses MemoryError: Nimble out of memory and then a crash

1 participant