Skip to content

Improvements for bluetooth stabiltiy - #1

Open
Amueller36 wants to merge 1 commit into
TheInGoF:mainfrom
Amueller36:main
Open

Improvements for bluetooth stabiltiy#1
Amueller36 wants to merge 1 commit into
TheInGoF:mainfrom
Amueller36:main

Conversation

@Amueller36

Copy link
Copy Markdown

What & why

Improves Bluetooth connection stability and recovery, and adds diagnostics for investigating intermittent PC disconnects.

  • Fixes a race where a Ride disconnect during setup sometimes clears pointers while they were still being used, sometimes leading to crash the ESP32 and dropping both Bluetooth links.
  • Reuses the BLE client and a static callback to eliminate the per reconnect callback leak.
  • Checks the RideOn handshake, notification descriptor, and subscription before marking the Ride ready.
  • Moves scan/reconnect control into the main loop, with finite scans, retry backoff, and disconnect-completion handling.
  • Clears stale button state when the Ride disconnects.
  • Adds separate PC and Ride disconnect logs, PC connection/security information, boot reset reasons, and diagnostics for the heap
  • Pins PlatformIO dependencies for reproducible builds

No related issue.

Tested on

  • Board: ESP32-S3, revision v0.2, with 8 MB embedded PSRAM; built using the esp32-s3-devkitc-1 PlatformIO configuration with PSRAM disabled.
  • Core / library versions:
    • PlatformIO Espressif32 platform: 6.12.0
    • Arduino-ESP32 core: 2.0.17
    • NimBLE-Arduino: 2.5.1
    • ESPAsyncWebServer: 3.12.0
    • AsyncTCP: 3.5.0
    • ESP32 NIMBLE Keyboard: 2.0.1, commit 1f04c0496a398924bf321d7b27956beab485deb2
  • End device + app: Intended for PC Bluetooth HID use with MyWhoosh; end-to-end app testing and reconnect stability testing are not yet confirmed.

PlatformIO firmware build passed and firmware was flashed to the physical ESP32-S3

Checklist

  • Builds in Arduino IDE (ESP32-S3, core 3.x)
  • Tested on real hardware (or marked as untested): flashed successfully; functional and stability testing remain unverified as noted above.
  • No second BLE/Bluedroid keyboard library pulled in
  • UI strings added to both en.json and de.json (if applicable): not applicable; no UI strings changed.
  • No vendor/AI attribution added to commits or docs

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.

1 participant