From bca085c8ffa476e461e2a9f326573e5a3b4c3cc2 Mon Sep 17 00:00:00 2001 From: elims <46279009+theelims@users.noreply.github.com> Date: Mon, 11 Sep 2023 23:31:28 +0200 Subject: [PATCH] Fixes for boot loop issue with Arduino 6.4.0 --- CHANGELOG.md | 6 ++++++ factory_settings.ini | 2 +- lib/framework/WiFiSettingsService.cpp | 14 +++++++------- platformio.ini | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d06b952d..6db7f229 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.2.1] - 2023-09-11 + +### Fixed + +- Fixed the boot loop issue for Arduino 6.4.0 + ## [0.2.0] - 2023-08-03 ### Added diff --git a/factory_settings.ini b/factory_settings.ini index e14e163d..1580865f 100644 --- a/factory_settings.ini +++ b/factory_settings.ini @@ -7,7 +7,7 @@ [factory_settings] build_flags = ; Global Settings - -D FIRMWARE_VERSION=\"0.2.0\" + -D FIRMWARE_VERSION=\"0.2.1\" ; WiFi settings -D FACTORY_WIFI_SSID=\"\" diff --git a/lib/framework/WiFiSettingsService.cpp b/lib/framework/WiFiSettingsService.cpp index 88f127f0..45d0eeca 100644 --- a/lib/framework/WiFiSettingsService.cpp +++ b/lib/framework/WiFiSettingsService.cpp @@ -18,6 +18,13 @@ WiFiSettingsService::WiFiSettingsService(AsyncWebServer *server, FS *fs, Securit _fsPersistence(WiFiSettings::read, WiFiSettings::update, this, fs, WIFI_SETTINGS_FILE), _lastConnectionAttempt(0), _notificationEvents(notificationEvents) +{ + 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. @@ -39,13 +46,6 @@ WiFiSettingsService::WiFiSettingsService(AsyncWebServer *server, FS *fs, Securit WiFi.onEvent(std::bind(&WiFiSettingsService::onStationModeStop, this, std::placeholders::_1, std::placeholders::_2), WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_STOP); - addUpdateHandler([&](const String &originId) - { reconfigureWiFiConnection(); }, - false); -} - -void WiFiSettingsService::begin() -{ _fsPersistence.readFromFS(); reconfigureWiFiConnection(); } diff --git a/platformio.ini b/platformio.ini index 0dad9a98..a6051d03 100644 --- a/platformio.ini +++ b/platformio.ini @@ -18,7 +18,7 @@ default_envs = esp32-s3-devkitc-1 [env] framework = arduino -platform = espressif32 @ 6.3.2 +platform = espressif32 build_flags = ${factory_settings.build_flags} ${features.build_flags}