From 056e26132c76f5581f3fae4ed85cdbc17f4bc35b Mon Sep 17 00:00:00 2001 From: MichaelDvP <59284019+MichaelDvP@users.noreply.github.com> Date: Wed, 6 Sep 2023 07:47:17 +0200 Subject: [PATCH] Fix for espressif32@6.4.0 --- lib/framework/WiFiSettingsService.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/framework/WiFiSettingsService.cpp b/lib/framework/WiFiSettingsService.cpp index 1a6b7ad4..de4aeaed 100644 --- a/lib/framework/WiFiSettingsService.cpp +++ b/lib/framework/WiFiSettingsService.cpp @@ -4,6 +4,10 @@ WiFiSettingsService::WiFiSettingsService(AsyncWebServer* server, FS* fs, Securit _httpEndpoint(WiFiSettings::read, WiFiSettings::update, this, server, WIFI_SETTINGS_SERVICE_PATH, securityManager), _fsPersistence(WiFiSettings::read, WiFiSettings::update, this, fs, WIFI_SETTINGS_FILE), _lastConnectionAttempt(0) { + addUpdateHandler([&](const String& originId) { reconfigureWiFiConnection(); }, false); +} + +void WiFiSettingsService::begin() { // We want the device to come up in opmode=0 (WIFI_OFF), when erasing the flash this is not the default. // If needed, we save opmode=0 before disabling persistence so the device boots with WiFi disabled in the future. if (WiFi.getMode() != WIFI_OFF) { @@ -27,10 +31,6 @@ WiFiSettingsService::WiFiSettingsService(AsyncWebServer* server, FS* fs, Securit std::bind(&WiFiSettingsService::onStationModeDisconnected, this, std::placeholders::_1)); #endif - addUpdateHandler([&](const String& originId) { reconfigureWiFiConnection(); }, false); -} - -void WiFiSettingsService::begin() { _fsPersistence.readFromFS(); reconfigureWiFiConnection(); }