Repository navigation
wifi: retry saved networks and reconnect after runtime drops - #2
Merged
Merged
Conversation
The core only auto-reconnects for some disconnect reasons, so an AP that deauthenticates the robot (e.g. for inactivity) leaves it offline until a power cycle, and one missed connect at boot drops it into the setup AP. - Boot: try saved networks for 3 rounds, restarting the radio between rounds, before opening the setup AP. - Runtime: log the disconnect reason; after a 10 s grace, reconnect to the last-good network with 15 s..5 min backoff (full radio restart after the first attempt). - Setup AP opened only because saved WiFi failed: reboot after 5 min if no client has joined, to retry the saved networks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jtruland
marked this pull request as ready for review
October 16, 2026 16:24
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.
Why
On 2026-10-15 the robot dropped off eyja's hotspot at 11:32:51 and never tried to rejoin: eyja logged no association, auth or DHCP attempt afterwards. Three power-cycles then all fell back to the setup AP (192.168.4.1), and a fourth boot finally connected.
Two gaps in
wifi_connect.cpp:_is_staReconnectableReason. A deauth for inactivity (4) or leaving (3) is never retried. Hypothesis for the 10/15 drop; unproven until a reason gets logged.What
Only
src/network/wifi_connect.cppchanges.wifiConnected()semantics are unchanged.reconnect()), and restarts mDNS once it is back.Testing
pio run -e esp32-c3-devkitm-1builds cleanlyWIFI lost, reason Nand a reconnect in the serial log🤖 Generated with Claude Code