Merge branch 'mega' into bugfix/WiFi_state_machine

This commit is contained in:
TD-er
2025-06-26 22:26:15 +02:00
9 changed files with 98 additions and 64 deletions
+5
View File
@@ -30,6 +30,11 @@
"require_upload_port": true,
"speed": 460800
},
"espidf": {
"custom_sdkconfig": [
"CONFIG_FREERTOS_UNICORE=y"
]
},
"url": "https://en.wikipedia.org/wiki/ESP32",
"vendor": "Espressif"
}
@@ -0,0 +1,54 @@
Migrate from SPIFFS to LittleFS (ESP32)
=======================================
Since Espressif IDF 5.x framework (ESP32 chips only), the SPIFFS file-system is no longer supported. As ESPEasy is using a specially crafted framework-release that still included SPIFFS support, we have been able to keep support for SPIFFS, but this requires quite some effort. To reduce that effort, and because SPIFFS won't be made available after IDF 5.1.x for ESPEasy (mega-20250430), it is strongly advised to migrate to a LittleFS build.
NB: A build can not have support for both SPIFFS *and* LittleFS. (Technical limitation.)
Using the 4 steps below, a safe (and easy) migration path is available:
1) Upgrade to the last release with SPIFFS support
--------------------------------------------------
For the best experience, and to ensure a stable running system, the last release of ESPEasy **still including SPIFFS** should be used. This can be downloaded from `Github Release mega-20250430 <https://github.com/letscontrolit/ESPEasy/releases/tag/mega-20250430>`_
.. note:: **The last release that includes ESP32 wth SPIFFS support is** `mega-20250430 <https://github.com/letscontrolit/ESPEasy/releases/tag/mega-20250430>`_
To ensure an uninterrupted upgrade, the ESPEasy P2P network feature should be **disabled** by setting the **ESPEasy p2p UDP port** to ``0`` on the Tools/Advanced page (take note of the port number before setting it to 0), and save that setting. This prevents the sometimes busy, high-priority, P2P traffic to interrupt the download process. After the migration is completed this can of course be re-enabled.
After saving the P2P port setting, the ESP must be rebooted to take the unit out of the P2P network.
In the previous paragraph is shown how to select the correct binary for upgrading. After a successful upgrade, the ESP will be rebooted, and should be left running for *at least* 5 minutes to ensure that the WiFi configuration is stored in the NVS (non-volatile storage) partiton of the flash (this is a background process, activated ~5 minutes after a successful connection to WiFI), to facilitate that these settings can be used to reconnect to WiFi after upgrading to a LittleFS build.
2) Backup the current configuration and file-system content
-----------------------------------------------------------
As all ESP32 builds include support for creating a .tar archive backup, this feature should now be used to create an up-to-date system backup, by using the :cyan:`Backup files` button (as opposed to the :cyan:`Save` button that only stores the configuration files), and storing the archive on a persistent storage medium (local disk, USB stick, network storage, etc.).
NB: Depending on the browser used, it may be needed to confirm that the created archive should *really* be stored, so don't forget to confirm that!
3) Upgrade to the matching LittleFS release
-------------------------------------------
After the backup is created, the matching release with LittleFS support can be downloaded from the `Github Releases page <https://github.com/letscontrolit/ESPEasy/releases>`_ (If your build is not (yet) included, then please request it via a support issue. If your build was without the _ETH suffix, then you should pick the build *with* _ETH, as non-Ethernet builds are discontinued to reduce the number of builds.)
As long as the flash partitioning is the same (``4M316k``, ``8M1M`` etc.) the upgrade can be done via OTA. If the partitioning is different, either the `ESPEasy Web Flash tool <https://td-er.nl/ESPEasy/>`_ or the Espressif Flash Download tool should be used to install the update (flash partitioning can not be changed via an OTA update).
Once the new binary is installed, and the ESP rebooted, the unit should automatically connect to WiFi, as it has the last used credentials stored in the NVS partition. Might that fail, the initial setup via the Setup portal should be started.
4) Restore the backup
---------------------
Now that the unit is available via WiFi again, the backup we created in step **2)** can be restored so alle previously configured devices, controllers, rules, settings, etc. are available again.
From the Tools page, select the :cyan:`Load` button, and browse to the location of the backup .tar file to select it. After the restore is finished, the unit **must** be rebooted immediately (a :cyan:`Reboot` button is available), so the freshly restored settings won't be overwritten by any settings kept in memory.
After that mandatory reboot it is the moment to re-enable the P2P network, by restoring the **ESPEasy p2p UDP port** setting, on the Tools/Advanced page, with the port number noted in step **1)**. The default P2P port is ``8266``.
This requires another reboot to activate the P2P network again.
|
When these steps are completed, the migration from SPIFFS to LittleFS is **successfully completed!**
|
+1 -44
View File
@@ -1019,50 +1019,7 @@ Firmware update
Via the :cyan:`Update Firmware` button, you can browse for an updated firmware, downloaded from the Releases page, an Actions run, or self-built, and install that. When using the same flash configuration (``4M1M``, ``4M316k``, ``8M1M``, etc.) and file system type (SPIFFS v.s. LittleFS) all settings will be preserved. When uncertain, the configuration should be saved first, using either the Save (or Backup files if available) button above.
Migrate from SPIFFS to LittleFS (ESP32)
=======================================
Since IDF 5.x framework (ESP32 chips only), the SPIFFS file-system is no longer supported. As ESPEasy is using a specially crafted framework-release that still includes SPIFFS support, we still have support for SPIFFS, but this requires quite some effort. To reduce that effort, and because SPIFFS won't be made available after IDF 5.1.x for ESPEasy, it is strongly advised to migrate to a LittleFS build.
NB: A build can not have support for both SPIFFS *and* LittleFS. (Technical limitation.)
Using the 4 steps below, a safe (and easy) migration path is available:
1) Upgrade to the latest release
--------------------------------
For the best experience, and to ensure a stable running system, a very recent release of ESPEasy should be used. This can be downloaded from the `Github Releases page <https://github.com/letscontrolit/ESPEasy/releases>`_
Releases that no longer include SPIFFS support will be clearly marked.
In the previous paragraph is shown how to select the correct binary for upgrading. After a successful upgrade, the ESP will be rebooted, and should be left running for *at least* 5 minutes to ensure that the WiFi configuration is stored in the NVS (non-volatile storage) partiton of the flash (this is a background process, activated ~5 minutes after a successful connection to WiFI), so this can be used to reconnect to WiFi after upgrading to a LittleFS build.
2) Backup the current configuration and file-system content
-----------------------------------------------------------
As all ESP32 builds include support for creating a .tar archive backup, this feature should now be used to create an up-to-date system backup, by using the :cyan:`Backup files` button (as opposed to the :cyan:`Save` button that only stores the configuration files), and storing the archive on a persistent storage medium (local disk, USB stick, network storage, etc.).
NB: Depending on the browser used, it may be needed to confirm that the created archive should *really* be stored, so don't forget to confirm that!
3) Upgrade to the matching LittleFS release
-------------------------------------------
After the backup is created, the matching release with LittleFS support cna be downloaded from the `Github Releases page <https://github.com/letscontrolit/ESPEasy/releases>`_ (If your build is not (yet) included, then please request it via a support issue.)
As long as the flash partitioning is the same (``4M316k``, ``8M1M`` etc.) the upgrade can be done via OTA. If the partitioning is different, either the `ESPEasy Web Flash tool <https://td-er.nl/ESPEasy/>`_ or the Espressif Flash Download tool should be used to install the update (flash partitioning can not be changed via an OTA update).
Once the new binary is installed, and the ESP rebooted, the unit should automatically connect to WiFi, as it has the last used credentials stored in the NVS partition. Might that fail, the initial setup via the Setup portal should be started.
4) Restore the backup
---------------------
Now that the unit is available via WiFi again, the backup we created in step **2)** can be restored so alle previously configured devices, controllers, rules, settings, etc. are available again.
From the Tools page, select the :cyan:`Load` button, and browse to the location of the backup .tar file to select it. After the restore is finished, the unit **must** be rebooted immediately (a :cyan:`Reboot` button is available), so the freshly restored settings won't be overwritten by any settings kept in memory.
When these steps are completed, the migration from SPIFFS to LittleFS is **successfully completed!**
|
.. include:: ../Reference/Migrate_SPIFFS_to_LittleFS.rst
File system
***********
+1
View File
@@ -36,6 +36,7 @@ Welcome to ESP Easy's documentation!
Participate/Documentation.rst
Participate/ProjectStructure.rst
Reference/Flashing.rst
Reference/Migrate_SPIFFS_to_LittleFS.rst
Reference/Safety.rst
Reference/Command.rst
Reference/Events.rst
+2 -2
View File
@@ -3,8 +3,8 @@
[esp32_solo1_common_LittleFS]
extends = esp32_base_idf5
board = esp32_solo1_4M
platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF53
platform_packages = framework-arduino-solo1 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/3507/framework-arduinoespressif32-solo1-release_v5.3-2952ac93.zip
;platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF53
;platform_packages = framework-arduino-solo1 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/3507/framework-arduinoespressif32-solo1-release_v5.3-2952ac93.zip
build_flags = ${esp32_base_idf5.build_flags}
-DFEATURE_ARDUINO_OTA=1
-DUSE_LITTLEFS
+1 -3
View File
@@ -14,11 +14,11 @@ lib_ignore = ${esp32_base_idf5.lib_ignore}
NeoPixelBus
NeoPixelBus_wrapper
Adafruit NeoMatrix via NeoPixelBus
board = esp32c2
[env:safeboot_ESP32c2_4M_LittleFS]
extends = esp32c2_common_LittleFS
board = esp32c2
build_flags = ${esp32c2_common_LittleFS.build_flags}
-DPLUGIN_BUILD_CUSTOM
-DPLUGIN_BUILD_SAFEBOOT
@@ -37,7 +37,6 @@ extra_scripts = ${esp32c2_common_LittleFS.extra_scripts}
[env:custom_ESP32c2_4M316k_LittleFS]
extends = esp32c2_common_LittleFS
board = esp32c2
build_flags = ${esp32c2_common_LittleFS.build_flags}
-DPLUGIN_BUILD_CUSTOM
extra_scripts = ${esp32c2_common_LittleFS.extra_scripts}
@@ -45,7 +44,6 @@ extra_scripts = ${esp32c2_common_LittleFS.extra_scripts}
[env:normal_ESP32c2_4M316k_LittleFS]
extends = esp32c2_common_LittleFS
board = esp32c2
build_flags = ${esp32c2_common_LittleFS.build_flags}
lib_ignore = ${esp32c2_common_LittleFS.lib_ignore}
${no_ir.lib_ignore}
+1 -13
View File
@@ -10,11 +10,11 @@ build_unflags = ${esp32_base_idf5.build_unflags}
-fexceptions
board_build.filesystem = littlefs
lib_ignore = ${esp32_base_idf5.lib_ignore}
board = esp32c3cdc
[env:custom_ESP32c3_4M316k_LittleFS_CDC_ETH]
extends = esp32c3_common_LittleFS
board = esp32c3cdc
build_flags = ${esp32c3_common_LittleFS.build_flags}
-DPLUGIN_BUILD_CUSTOM
extra_scripts = ${esp32c3_common_LittleFS.extra_scripts}
@@ -24,56 +24,48 @@ extra_scripts = ${esp32c3_common_LittleFS.extra_scripts}
[env:normal_ESP32c3_4M316k_LittleFS_CDC_ETH]
extends = esp32c3_common_LittleFS
board = esp32c3cdc
build_flags = ${esp32c3_common_LittleFS.build_flags}
lib_ignore = ${esp32c3_common_LittleFS.lib_ignore}
${no_ir.lib_ignore}
[env:collection_A_ESP32c3_4M316k_LittleFS_CDC_ETH]
extends = esp32c3_common_LittleFS
board = esp32c3cdc
build_flags = ${esp32c3_common_LittleFS.build_flags}
-DPLUGIN_SET_COLLECTION_ESP32
-DCOLLECTION_FEATURE_RTTTL=1
[env:collection_B_ESP32c3_4M316k_LittleFS_CDC_ETH]
extends = esp32c3_common_LittleFS
board = esp32c3cdc
build_flags = ${esp32c3_common_LittleFS.build_flags}
-DPLUGIN_SET_COLLECTION_B_ESP32
-DCOLLECTION_FEATURE_RTTTL=1
[env:collection_C_ESP32c3_4M316k_LittleFS_CDC_ETH]
extends = esp32c3_common_LittleFS
board = esp32c3cdc
build_flags = ${esp32c3_common_LittleFS.build_flags}
-DPLUGIN_SET_COLLECTION_C_ESP32
-DCOLLECTION_FEATURE_RTTTL=1
[env:collection_D_ESP32c3_4M316k_LittleFS_CDC_ETH]
extends = esp32c3_common_LittleFS
board = esp32c3cdc
build_flags = ${esp32c3_common_LittleFS.build_flags}
-DPLUGIN_SET_COLLECTION_D_ESP32
-DCOLLECTION_FEATURE_RTTTL=1
[env:collection_E_ESP32c3_4M316k_LittleFS_CDC_ETH]
extends = esp32c3_common_LittleFS
board = esp32c3cdc
build_flags = ${esp32c3_common_LittleFS.build_flags}
-DPLUGIN_SET_COLLECTION_E_ESP32
-DCOLLECTION_FEATURE_RTTTL=1
[env:collection_F_ESP32c3_4M316k_LittleFS_CDC_ETH]
extends = esp32c3_common_LittleFS
board = esp32c3cdc
build_flags = ${esp32c3_common_LittleFS.build_flags}
-DPLUGIN_SET_COLLECTION_F_ESP32
-DCOLLECTION_FEATURE_RTTTL=1
[env:collection_G_ESP32c3_4M316k_LittleFS_CDC_ETH]
extends = esp32c3_common_LittleFS
board = esp32c3cdc
build_flags = ${esp32c3_common_LittleFS.build_flags}
-DPLUGIN_SET_COLLECTION_G_ESP32
-DCOLLECTION_FEATURE_RTTTL=1
@@ -81,14 +73,12 @@ build_flags = ${esp32c3_common_LittleFS.build_flags}
[env:energy_ESP32c3_4M316k_LittleFS_CDC_ETH]
extends = esp32c3_common_LittleFS
board = esp32c3cdc
build_flags = ${esp32c3_common_LittleFS.build_flags}
-D PLUGIN_ENERGY_COLLECTION
[env:display_ESP32c3_4M316k_LittleFS_CDC_ETH]
extends = esp32c3_common_LittleFS
board = esp32c3cdc
build_flags = ${esp32c3_common_LittleFS.build_flags}
-D PLUGIN_DISPLAY_COLLECTION
-D ST7789_EXTRA_INIT=1
@@ -96,13 +86,11 @@ build_flags = ${esp32c3_common_LittleFS.build_flags}
[env:climate_ESP32c3_4M316k_LittleFS_CDC_ETH]
extends = esp32c3_common_LittleFS
board = esp32c3cdc
build_flags = ${esp32c3_common_LittleFS.build_flags}
-D PLUGIN_CLIMATE_COLLECTION
[env:neopixel_ESP32c3_4M316k_LittleFS_CDC_ETH]
extends = esp32c3_common_LittleFS
board = esp32c3cdc
build_flags = ${esp32c3_common_LittleFS.build_flags}
-DFEATURE_ARDUINO_OTA=1
-DFEATURE_SD=1
+25 -2
View File
@@ -1,5 +1,3 @@
[esp32c6_common_LittleFS]
extends = esp32_base_idf5
build_flags = ${esp32_base_idf5.build_flags}
@@ -30,6 +28,31 @@ build_flags = ${esp32c6_common_LittleFS.build_flags}
lib_ignore = ${esp32c6_common_LittleFS.lib_ignore}
${no_ir.lib_ignore}
[env:energy_ESP32c6_4M316k_LittleFS_CDC_ETH]
extends = esp32c6_common_LittleFS
build_flags = ${esp32c6_common_LittleFS.build_flags}
-D PLUGIN_ENERGY_COLLECTION
[env:display_ESP32c6_4M316k_LittleFS_CDC_ETH]
extends = esp32c6_common_LittleFS
build_flags = ${esp32c6_common_LittleFS.build_flags}
-D PLUGIN_DISPLAY_COLLECTION
-D ST7789_EXTRA_INIT=1
-D P116_EXTRA_ST7789=1
[env:climate_ESP32c6_4M316k_LittleFS_CDC_ETH]
extends = esp32c6_common_LittleFS
build_flags = ${esp32c6_common_LittleFS.build_flags}
-D PLUGIN_CLIMATE_COLLECTION
[env:neopixel_ESP32c6_4M316k_LittleFS_CDC_ETH]
extends = esp32c6_common_LittleFS
build_flags = ${esp32c6_common_LittleFS.build_flags}
-DFEATURE_ARDUINO_OTA=1
-DFEATURE_SD=1
-DPLUGIN_NEOPIXEL_COLLECTION
[env:max_ESP32c6_8M1M_LittleFS_CDC_ETH]
extends = esp32c6_common_LittleFS
@@ -400,6 +400,14 @@ def generate_manifest_files(bin_folder, output_prefix):
' See <a href="../" >../</a> for last official build.\n',
' <br>\n',
' <a href="all.zip" >all.zip</a> containing all bin files in a single zip file.\n',
' <br>\n',
' <br>\n',
' <h2>Migrate ESP32 installs from SPIFFS to LittleFS</h2>\n',
' From 2025/06/26 onward, there will be no longer SPIFFS builds for ESP32-xx.\n',
' <br>\n',
' See <a href="https://espeasy.readthedocs.io/en/latest/Reference/Migrate_SPIFFS_to_LittleFS.html" >Migrate from SPIFFS to LittleFS (ESP32)</a> in the documentation on how to migrate older (ESP32) SPIFFS installs to LittleFS\n',
' <script>\n',
' const selectEl = document.querySelector(".pick-variant select");\n',
' const installEl = document.querySelector("esp-web-install-button");\n',