Finish captive portal: NVS config, POST handler, STA connect, AP identity

Splits provisioning (softAP + captive portal + NVS-backed config) into
wifi_provisioning.c and home-network connection into frame_client.c.
/save_config now parses the form body and persists it to NVS; on boot the
device goes straight to STA mode if a config exists, retrying a few times
before falling back to provisioning if the home network is unreachable.

The provisioning AP is now always named ESPRESSO with a random per-device
password (generated once, persisted in NVS) instead of a fixed Kconfig
value, drawn from a charset that avoids visually ambiguous characters since
it'll be read off the e-ink panel and possibly typed by hand.
This commit is contained in:
2026-07-18 10:48:52 -04:00
parent cb50c99c98
commit de449d5973
7 changed files with 610 additions and 189 deletions
+24 -11
View File
@@ -1,16 +1,14 @@
menu "Example Configuration"
menu "ESPresso Frame Configuration"
config ESP_WIFI_SSID
string "SoftAP SSID"
default "esp32_ssid"
config ESP_AP_SSID
string "Provisioning softAP SSID"
default "ESPRESSO"
help
SSID (network name) to set up the softAP with.
config ESP_WIFI_PASSWORD
string "SoftAP Password"
default "esp32_pwd"
help
WiFi password (WPA or WPA2) for the example to use for the softAP.
SSID of the softAP the device brings up when it needs provisioning.
The password is generated randomly per device on first boot and
shown on the e-ink panel both as a WiFi-join QR code and as
plaintext underneath it, so it can be typed in by hand on a
desktop/laptop that can't scan the QR.
config ESP_MAX_STA_CONN
int "Maximal STA connections"
@@ -29,4 +27,19 @@ menu "Example Configuration"
default y
help
Enables more modern DHCP-based Option 114 to provide clients with the captive portal URI
config FRAME_STA_CONNECT_MAX_RETRIES
int "Home WiFi connect max retries before falling back to provisioning"
default 3
help
Number of failed connection attempts to the stored home WiFi network
before the device gives up and re-enters provisioning (softAP) mode.
config FRAME_STA_CONNECT_TIMEOUT_MS
int "Home WiFi connect timeout per attempt (ms)"
default 15000
help
How long to wait for an IP address on each connection attempt to the
stored home WiFi network before counting it as a failed retry.
endmenu