Repository navigation
fix(ble): slow connects time out, and a failed connect hides the pad until restart - #29
Merged
Merged
Conversation
- The connect plus service discovery shared the 5 s per-command timeout, so a slow macOS connect timed out mid-discovery - Add _BLE_CONNECT_TIMEOUT_SECONDS = 10 for controller.run(); commands keep 5 s - Tests for a slow connect succeeding and an over-limit connect still timing out Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A connect that failed partway left the half-open connection open, so the pad stopped advertising and every retry missed it until restart; disconnect before re-raising - Log connect and auto-reconnect failures with the exception type (e.g. TimeoutError()) instead of a blank message - Tests for both, plus a CHANGELOG entry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
SeanathanVT
added a commit
that referenced
this pull request
Oct 30, 2026
…until restart (#29) * fix(ble): give the connect its own 10 s timeout - The connect plus service discovery shared the 5 s per-command timeout, so a slow macOS connect timed out mid-discovery - Add _BLE_CONNECT_TIMEOUT_SECONDS = 10 for controller.run(); commands keep 5 s - Tests for a slow connect succeeding and an over-limit connect still timing out Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(ble): disconnect after a failed connect and name the error - A connect that failed partway left the half-open connection open, so the pad stopped advertising and every retry missed it until restart; disconnect before re-raising - Log connect and auto-reconnect failures with the exception type (e.g. TimeoutError()) instead of a blank message - Tests for both, plus a CHANGELOG entry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes intermittent failures to connect and reconnect to the WalkingPad. They come from two older bugs in the connect path, both present since #11 (2026-08-25), that compound:
controller.run()covers the OS-level connect plus discovering every service and descriptor on the pad. It shared_BLE_WRITE_TIMEOUT_SECONDS = 5, which is sized for single commands. A macOS connect that took 4.2 s ran out of time partway through service discovery and logged a blankBLE connection attempt failed:. ATimeoutErrorprints as an empty string.Device not founduntil WalkingDad was restarted.Changes
_BLE_CONNECT_TIMEOUT_SECONDS = 10applies only tocontroller.run(). Commands keep 5 s, so the lock and shutdown timeouts sized around one write are unchanged._connect_to_pad()disconnects the half-open client before re-raising.TimeoutError()) instead of a blank.CHANGELOG.md[Unreleased]› Fixed has an entry for each fix.Tests
Six new tests in
tests/test_ble_async.py, each watched failing first:The full suite passes on Python 3.10, 3.12 and 3.13 (505 tests each).
Manual check (macOS)
🤖 Generated with Claude Code