Skip to content

Commit

Permalink
Fix for espressif32@6.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Sep 6, 2023
1 parent b9b9c1b commit 056e261
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/framework/WiFiSettingsService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
}
Expand Down

0 comments on commit 056e261

Please sign in to comment.