From e2dcf9a1f311fdd2b3982b83962650e2f145d840 Mon Sep 17 00:00:00 2001 From: Alex Hope-O'Connor Date: Sat, 5 Sep 2026 23:40:35 +1000 Subject: [PATCH] fix: keep external station profiles authoritative --- CHANGELOG.md | 5 +++++ README.md | 2 +- docs/GETTING_STARTED.md | 2 +- lib/WiFiManager/src/WiFiManager.cpp | 7 +++++++ library.json | 4 ++-- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9ec41c..2ec2baf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 3.2.1 + +- Ensure externally supplied station profiles remain authoritative on ESP32 by clearing stale SDK-owned credentials before opening the portal for an empty or invalid external profile set. +- Pin DFTE 1.2.0, the tested template-engine release used by the maintained portal. + ## 3.2.0 - Refine the device-hosted portal with a startup Wi-Fi scan, stable loading overlays, clearer connection progress, and a resettable configuration timeout. diff --git a/README.md b/README.md index e665055..2541ec8 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ The [Branded Portal](examples/BrandedPortal/) example includes a static SVG, acc ```ini [common] lib_deps = - WiFiManager=https://github.com/alexhopeoconnor/WiFiManager.git#v3.2.0 + WiFiManager=https://github.com/alexhopeoconnor/WiFiManager.git#v3.2.1 ``` The suffix after `#` is a Git ref. PlatformIO clones the repository and checks out that release tag; GitHub Release assets are unrelated. Arduino IDE users can install this repository as a library checkout. diff --git a/docs/GETTING_STARTED.md b/docs/GETTING_STARTED.md index d1e905f..6cbe21e 100644 --- a/docs/GETTING_STARTED.md +++ b/docs/GETTING_STARTED.md @@ -26,7 +26,7 @@ void loop() { ```ini lib_deps = - WiFiManager=https://github.com/alexhopeoconnor/WiFiManager.git#v3.2.0 + WiFiManager=https://github.com/alexhopeoconnor/WiFiManager.git#v3.2.1 ``` The package includes the asynchronous web and TCP dependencies required by the selected ESP8266 or ESP32 target. Add WiFiManager as the application’s direct dependency; do not copy its internal dependency list into your project. diff --git a/lib/WiFiManager/src/WiFiManager.cpp b/lib/WiFiManager/src/WiFiManager.cpp index c4d3168..a665b72 100644 --- a/lib/WiFiManager/src/WiFiManager.cpp +++ b/lib/WiFiManager/src/WiFiManager.cpp @@ -349,6 +349,13 @@ bool WiFiManager::startStationConnection(char const *apName, char const *apPassw _stationStatus.configuredProfiles = configuredStationProfileCount(_stationProfiles); if (!validateStationProfiles(_stationProfiles)) { + // In station-profile mode the caller store is the single source of + // truth. ESP32 can reconnect from credentials retained in its own NVS + // before the portal is started, which would otherwise bypass an empty or + // invalid external profile set. Clear only that SDK-owned state here; + // the external store remains untouched and is what the portal will save. + WiFi_Disconnect(); + WiFi_eraseConfig(); _stationStatus.message = _stationStatus.configuredProfiles == 0 ? F("No WiFi profiles configured") : F("Stored WiFi profiles are invalid"); diff --git a/library.json b/library.json index c4f5009..ffc03d7 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "WiFiManager", - "version": "3.2.0", + "version": "3.2.1", "keywords": [ "wifi", "wi-fi", @@ -58,7 +58,7 @@ }, { "name": "DeviceFrameworkTemplateEngine", - "version": "https://github.com/alexhopeoconnor/DFTE.git#v1.1.0" + "version": "https://github.com/alexhopeoconnor/DFTE.git#v1.2.0" } ], "build": {