Implements first-boot Wi-Fi setup with no companion app required: a SoftAP + captive portal (DNS wildcard redirect, DHCP option 114, HTTP form) lets the user submit Wi-Fi credentials from any browser. On submit, credentials are saved to NVS and the device switches to STA mode; on subsequent boots it reconnects automatically via stored credentials. dns_server.c/.h are vendored from ESP-IDF's official captive_portal example (Unlicense/CC0). Requests both link-local and global IPv6 addresses once the STA connection has an IPv4 address (not on WIFI_EVENT_STA_CONNECTED -- esp_netif_create_ip6_linklocal() reliably fails there because esp-netif's own handler, which marks the lwIP netif "up", hasn't run yet due to event-handler registration order). Verified end-to-end on real ESP32-C6 hardware: SoftAP comes up, credential submission works, STA reconnects on reboot, and both a link-local and a router-assigned global IPv6 address are obtained via SLAAC. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
17 lines
709 B
Plaintext
17 lines
709 B
Plaintext
# Shared defaults. Target-specific settings are generated into `sdkconfig`
|
|
# by `idf.py set-target esp32c6` (first-time setup, see README) rather than
|
|
# hardcoded here.
|
|
|
|
CONFIG_PARTITION_TABLE_CUSTOM=y
|
|
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
|
|
|
|
# Matches the 4MB layout assumed in partitions.csv (TODO: adjust both
|
|
# together once real hardware's actual flash size is confirmed).
|
|
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
|
|
|
|
# IPv6 is required (not just the ESP-IDF default) -- transport/commissioning
|
|
# requests a link-local IPv6 address once Wi-Fi STA connects. Explicit here
|
|
# so it can't silently regress even though CONFIG_LWIP_IPV6 already
|
|
# defaults to y in this ESP-IDF version.
|
|
CONFIG_LWIP_IPV6=y
|