Fix Wi-Fi ESP_ERR_WIFI_STOP_STATE (12308) reboot on network save/reset - #584
Open
joelhawksley wants to merge 1 commit into
Open
Fix Wi-Fi ESP_ERR_WIFI_STOP_STATE (12308) reboot on network save/reset#584joelhawksley wants to merge 1 commit into
joelhawksley wants to merge 1 commit into
Conversation
The captive portal and credential-reset paths stopped and reinitialized the ESP-IDF Wi-Fi driver behind the Arduino WiFi layer, so a following boot or CPU reset could hit an in-progress radio shutdown. esp_wifi_init then failed with ESP_ERR_WIFI_STOP_STATE (12308) via wifi_init_default netstack cb reg, leaving Wi-Fi unusable until another reset. - startPortal(): drop the raw esp_wifi_stop/deinit/init/start AMPDU-RX workaround that conflicts with the Arduino-managed Wi-Fi lifecycle. - Validate submitted credentials with enableSTA(true) so the portal AP stays up (AP+STA) instead of switching AP -> STA and racing the driver. - resetSettings() and the pre-sleep paths disconnect without powering the driver off; the reset/deep sleep handles teardown.
joelhawksley
marked this pull request as ready for review
August 25, 2026 17:14
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.
Problem
On ESP32-S3 devices, saving or resetting a Wi-Fi network could leave the radio unusable, with the boot log showing:
12308isESP_ERR_WIFI_STOP_STATE("Wi-Fi is stopping"). The captive portal and credential-reset paths stopped and reinitialized the ESP-IDF Wi-Fi driver behind the ArduinoWiFilayer, so a subsequent boot or CPU reset could begin while a radio shutdown was still in progress.esp_wifi_init()then failed and Wi-Fi stayed down until another reset, sometimes looping throughRTC_SW_CPU_RST/RTCWDT_RTC_RST.