[codex] Add configurable autostart rocking#2
Draft
giezi wants to merge 4 commits into
Draft
Conversation
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
First, many thanks for the great project :) When you are on the go without your home WiFi, opening the web configuration to start rocking is not really an option. This feature solves that by adding a persisted web configuration for automatic rocking: users can enable autostart from the configuration page and choose the rocking intensity that should be used after a stroller BLE connect.
The implementation keeps the existing 30-minute auto-renew behavior, but makes startup more reliable for mobile/no-WiFi use cases: BLE now starts even when WiFi is unavailable, and autostart is sent only after the initial BLE reads and notification subscriptions have completed. Pending BLE writes are retried when NimBLE reports the GATT procedure is busy.
Changes
/configwith enable and intensity controls.Off,On,Auto).Root Cause
Autostart was previously tied to the BLE connect flow, but the app also waited indefinitely for WiFi before starting BLE at all. That meant automatic rocking could not work away from the configured WiFi network. During testing, sending the rocking command too early in the BLE setup could also be accepted by the stack but not result in stable rocking. Delaying autostart until after initial reads and subscriptions makes the command stick reliably.
Validation
pio runsuccessfully forseeed_xiao_esp32c6.