From c1fc907ecb4820272eb9d7c87eb9c54ba06900cb Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Wed, 3 Jan 2024 22:04:50 +0100 Subject: [PATCH] Fix: Access Point not working after firmware update Fixes #1613 --- include/Configuration.h | 2 +- src/Configuration.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/Configuration.h b/include/Configuration.h index d355f46f2..673b2e9ba 100644 --- a/include/Configuration.h +++ b/include/Configuration.h @@ -5,7 +5,7 @@ #include #define CONFIG_FILENAME "/config.json" -#define CONFIG_VERSION 0x00011900 // 0.1.24 // make sure to clean all after change +#define CONFIG_VERSION 0x00011a00 // 0.1.26 // make sure to clean all after change #define WIFI_MAX_SSID_STRLEN 32 #define WIFI_MAX_PASSWORD_STRLEN 64 diff --git a/src/Configuration.cpp b/src/Configuration.cpp index d1ff8fec6..9ca9aaec6 100644 --- a/src/Configuration.cpp +++ b/src/Configuration.cpp @@ -7,6 +7,7 @@ #include "defaults.h" #include #include +#include CONFIG_T config; @@ -339,6 +340,14 @@ void ConfigurationClass::migrate() config.Dtu.Nrf.PaLevel = dtu["pa_level"]; } + if (config.Cfg.Version < 0x00011a00) { + // This migration fixes this issue: https://github.com/espressif/arduino-esp32/issues/8828 + // It occours when migrating from Core 2.0.9 to 2.0.14 + // which was done by updating ESP32 PlatformIO from 6.3.2 to 6.5.0 + nvs_flash_erase(); + nvs_flash_init(); + } + f.close(); config.Cfg.Version = CONFIG_VERSION;