Repository navigation
Keep the LED strip in step when the serial link or ESP32 drops out - #33
Open
Nicolas Palpacuer (NickPPC) wants to merge 1 commit into
Open
Nicolas Palpacuer (NickPPC) wants to merge 1 commit into
Nicolas Palpacuer (NickPPC) wants to merge 1 commit into
Conversation
led-bridge wrote a state only when it changed and never read the port, so a line lost while the CP2102 re-enumerated, or an ESP32 that stopped running its sketch, left the strip on its last colour indefinitely. - Resend the current state every 3 s while it is unchanged. - Read the firmware's replies; a failed read drops the port at once, so Status no longer reports a dead handle as connected and it reopens promptly. - Once the firmware has answered, 10 s without a reply hard-resets the ESP32 over RTS/DTR (esptool's sequence), at most every 30 s. - Status gains last_reply_at and firmware_resets. 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
Make led-bridge recover on its own when the LED strip stops following the voice state. On Cappuccina the strip twice stayed orange after a turn ended. Once, a reconnecting USB-serial adapter swallowed
idle; the other time the ESP32 stopped running its sketch, so a deliveredidlechanged nothing.Changes
connected: trueon a dead handle and the next tick reopens itlast_reply_atandfirmware_resetsThe underlying adapter drops look like the strip's current draw browning out the USB port; this PR only makes the bridge recover from them.
Testing
go test -race ./resources/led-bridge/covers resending, reopening an unplugged port, the disconnected Status, resetting firmware that goes silent, and leaving echoing or never-echoing firmware alone🤖 Generated with Claude Code