Skip to content

Fix Wi-Fi ESP_ERR_WIFI_STOP_STATE (12308) reboot on network save/reset - #584

Open
joelhawksley wants to merge 1 commit into
usetrmnl:mainfrom
timeframe:fix-wifi-stop-state-reboot
Open

Fix Wi-Fi ESP_ERR_WIFI_STOP_STATE (12308) reboot on network save/reset#584
joelhawksley wants to merge 1 commit into
usetrmnl:mainfrom
timeframe:fix-wifi-stop-state-reboot

Conversation

@joelhawksley

@joelhawksley joelhawksley commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Problem

On ESP32-S3 devices, saving or resetting a Wi-Fi network could leave the radio unusable, with the boot log showing:

E (xxxxx) wifi_init_default: netstack cb reg failed with 12308

12308 is ESP_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 Arduino WiFi layer, 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 through RTC_SW_CPU_RST / RTCWDT_RTC_RST.

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
joelhawksley marked this pull request as ready for review August 25, 2026 17:14
@schrockwell schrockwell added the bug Something isn't working label Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants