Skip to content

Commit 81d594f

Browse files
committed
Force reconfiguration of software access point when updating config or initializing APSettingsService instance.
1 parent be1c867 commit 81d594f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/APSettingsService.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ void APSettingsService::manageAP() {
3232
void APSettingsService::startAP() {
3333
Serial.println("Starting software access point");
3434
WiFi.softAP(_ssid.c_str(), _password.c_str());
35-
3635
if (!_dnsServer) {
3736
IPAddress apIp = WiFi.softAPIP();
3837
Serial.print("Starting captive portal on ");
@@ -81,4 +80,7 @@ void APSettingsService::writeToJsonObject(JsonObject& root) {
8180

8281
void APSettingsService::onConfigUpdated() {
8382
_lastManaged = millis() - MANAGE_NETWORK_DELAY;
83+
84+
// stop softAP - forces reconfiguration in loop()
85+
stopAP();
8486
}

src/WiFiSettingsService.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class WiFiSettingsService : public SettingsService {
2121
void readFromJsonObject(JsonObject& root);
2222
void writeToJsonObject(JsonObject& root);
2323
void onConfigUpdated();
24-
2524
void reconfigureWiFiConnection();
2625

2726
private:

0 commit comments

Comments
 (0)