Commit 8318be7
Ravi Singh
fix(netmgr): mirror sta_configured in memory when credentials change
s_net.sta_configured was computed once at boot from NVS, then never
updated when netmgr_set_credentials() persisted new creds. The result:
on first-time onboarding (fresh-NVS device), the in-memory flag stayed
false even after the user saved creds + STA successfully connected.
ap_should_be_on() checks sta_configured first and unconditionally
returns true if false — which meant the IP_EVENT_STA_GOT_IP handler
saw "AP should still be on" even after STA was up, never armed the
AP teardown timer, and the AP stayed broadcasting forever.
Symptom (from bench): user onboards via captive portal, success modal
shows the IP, device is reachable on home Wi-Fi, but AmbiSense-XXXX
remains visible in the phone's Wi-Fi list indefinitely.
Reboots after the first onboarding worked correctly because the
init path re-reads NVS and computes sta_configured = true.
Fix: set s_net.sta_configured = true alongside settings_set_wifi_ssid()
in the success path, and = false alongside the clear path.
Reproduced on a freshly-erased ESP32-C3 (MAC d8:3b:da:35:06:f0)
running v6.1.0-alpha.2; verified fixed on the same hardware.1 parent 3c4b336 commit 8318be7
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
479 | 482 | | |
480 | 483 | | |
481 | 484 | | |
482 | 485 | | |
483 | 486 | | |
484 | 487 | | |
485 | 488 | | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
486 | 496 | | |
487 | 497 | | |
488 | 498 | | |
| |||
0 commit comments