feat(wifi): SoftAP captive-portal Wi-Fi provisioning (Phase 7b) - #3
Merged
Conversation
- Add wifi_provision.cpp/.h: open AP edge-dns-setup, captive DNS responder, and /scan + /provision + wildcard portal httpd - Add provision_validate.cpp/.h: pure SSID/password validation against 802.11/WPA2-PSK limits, host-tested - Refactor wifi_connect() into wifi_connect_sta(): read/write Wi-Fi config via esp_wifi's own NVS storage instead of hardcoded credentials, seed from wifi_credentials.h only on first boot - Add 30s connect timeout that falls back to the provisioning portal without erasing stored credentials - Add factory_reset_watch_start(): GPIO0/BOOT hold (~5s) wipes stored Wi-Fi config and reboots into provisioning - Wire the boot branch in main.cpp: provisioned+connected starts the DNS/HTTP/mDNS/OTA tasks as before, otherwise starts the portal - Update ARCHITECTURE.md and README.md for the new boot flow, provisioning walkthrough, and no-auth-by-design portal routes
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.
Summary
edge-dns-setup), redirects any joined client to a scan-and-password form via a minimal captive DNS responder, and reboots into station mode once provisioned.nvs.net80211) instead of the hardcodedwifi_credentials.hpair — that header is demoted to a first-boot seed only, mirroring thedns_records.h/DNS_RECORDS_DEFAULTSdemotion from Phase 5.dns_server.cpp's hot query path.Test plan
idf.py build— firmware builds clean, signedmini_dns.binproducedhost_test— 47/47 Unity tests pass (24 dns_wire + 13 ota_version + 10 newprovision_validateboundary cases)default:case to theProvisionValidationswitch, added anesp_wifi_stop()guard before reconfiguring an already-started Wi-Fi stack on the STA-timeout fallback path