feat(platform): migrate to softap web provisioning portal

This commit is contained in:
admin
2026-02-28 20:47:24 +08:00
parent 66a3f79205
commit 421fd9da62
6 changed files with 1303 additions and 52 deletions

View File

@@ -77,8 +77,10 @@ idf.py build
## Config
In `menuconfig -> TQ Controller Config`:
- `TQ_WIFI_SSID`
- `TQ_WIFI_PASSWORD`
- `TQ_WIFI_PROV_SOFTAP_SSID`
- `TQ_WIFI_PROV_SOFTAP_PASSWORD`
- `TQ_WIFI_PROV_SOFTAP_CHANNEL`
- `TQ_WIFI_PROV_SOFTAP_MAX_CONN`
- `TQ_HTTP_PORT`
- `TQ_API_KEY` (optional)
- Z-Image HTTP auth and model fields:
@@ -123,9 +125,12 @@ When `TQ_API_KEY` is not empty, each request must include:
X-API-Key: <your-key>
```
STA-only behavior:
- If SSID is empty, startup fails.
- If STA connect fails, startup fails (no AP fallback).
Wi-Fi provisioning behavior:
- Device first tries saved STA credentials from NVS (`wifi_cfg` namespace).
- If no valid credentials exist or STA connect fails, device starts a SoftAP portal.
- Connect to the SoftAP and open `http://192.168.4.1`; the static page auto-scans nearby SSIDs for selection.
- Provisioning page supports Chinese/English switching and remembers the selected language in browser local storage.
- Credentials are written to NVS only after STA connect succeeds.
## Flash