feat: add Wi-Fi SoftAP provisioning - #209
Open
IM-TechieScientist wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Sorry @IM-TechieScientist, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Reviewer's GuideImplements first-run Wi-Fi SoftAP provisioning on the ESP32 bridge by introducing a dedicated provisioning module that serves a minimal HTTP form, persists credentials in NVS, and integrates with the existing Wi-Fi startup flow to switch between AP provisioning and normal station mode based on saved credentials and connection success. Sequence diagram for Wi-Fi startup and SoftAP provisioning flowsequenceDiagram
participant ESPMain as main.c
participant WifiProv as wifi_provisioning
participant NVS as nvs
participant WiFi as esp_wifi
ESPMain->>WifiProv: wifi_provisioning_load_credentials(credentials)
WifiProv->>NVS: nvs_open / nvs_get_str
NVS-->>WifiProv: ssid/password or error
WifiProv-->>ESPMain: loaded? (bool)
alt no saved credentials
ESPMain->>WifiProv: wifi_provisioning_run(credentials)
WifiProv->>WiFi: esp_wifi_set_mode(WIFI_MODE_AP)
WifiProv->>WiFi: esp_wifi_set_config(WIFI_IF_AP, ap_config)
WifiProv->>WiFi: esp_wifi_start()
WifiProv->>WifiProv: start_server()
WifiProv-->>ESPMain: credentials
end
ESPMain->>WiFi: start_station(credentials)
WiFi-->>ESPMain: connected? (bool)
alt saved station connection failed
ESPMain->>WifiProv: wifi_provisioning_run(credentials)
WifiProv-->>ESPMain: new credentials
ESPMain->>WiFi: start_station(credentials)
end
Sequence diagram for HTTP-based credential provisioningsequenceDiagram
actor User
participant AP as SoftAP_192_168_4_1
participant Httpd as esp_http_server
participant WifiProv as wifi_provisioning
participant NVS as nvs
User->>AP: Connect to PSLab-Pico-XXXX
User->>Httpd: GET /
Httpd->>WifiProv: setup_page_handler()
WifiProv-->>Httpd: setup_page (HTML)
Httpd-->>User: Wi-Fi setup form
User->>Httpd: POST /configure (ssid, password)
Httpd->>WifiProv: configure_handler(request)
WifiProv->>WifiProv: get_form_value("ssid") / get_form_value("password")
WifiProv->>WifiProv: credentials_are_valid()
WifiProv->>NVS: nvs_set_str / nvs_commit
NVS-->>WifiProv: ESP_OK
WifiProv->>WifiProv: xEventGroupSetBits(PROVISIONING_COMPLETE_BIT)
WifiProv-->>Httpd: httpd_resp_sendstr("Saved")
Httpd-->>User: Confirmation page
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
IM-TechieScientist
force-pushed
the
wifi-softap-provisioning
branch
from
August 11, 2026 15:48
2310f4c to
9f782c4
Compare
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.
Working on #208.
Adds first-run Wi-Fi provisioning to the ESP32 SPI bridge.
Instead of compiling station credentials into the firmware, a board without
saved credentials now starts a temporary WPA2 setup access point named:
The user connects to that access point and opens http://192.168.4.1 to enter
the target Wi-Fi SSID and password. Credentials are stored in ESP NVS and the
bridge then switches to normal station mode.
Changes:
wifi_provisioningmodule.192.168.4.1.Summary by Sourcery
Add first-run Wi-Fi SoftAP provisioning to the ESP32 SPI bridge so boards can be configured via a local web setup page and then connect as Wi-Fi stations using stored credentials.
New Features:
Enhancements:
Build:
Documentation: