floatplane / MitsuQTT

Use ESP8266/ESP32 hardware to control Mitsubishi heat pumps via MQTT
GNU Lesser General Public License v2.1
3 stars 2 forks source link

Replace SPIFFS with LittleFS #70

Closed Allram closed 3 months ago

Allram commented 3 months ago

Tried to replace SPIFFS with LittleFS, It builds and works on Wemos D1, have not tested on other devices.

Allram commented 3 months ago

This should close https://github.com/floatplane/MitsuQTT/issues/26

Regarding the questions in the Issues: board_build.ldscript = eagle.flash.4m2m.ld

board_build.ldscript: This is a configuration option that tells the build system which linker script to use. The linker script defines the memory layout of the microcontroller and how different sections of the program (like code, data, stack, and heap) are allocated in the microcontroller's memory.

eagle.flash.4m2m.ld: This is the name of the linker script file. It typically contains instructions for the linker on how to place program sections into the available memory of the microcontroller. The name suggests a specific memory configuration, often used for ESP8266 or ESP32 microcontrollers:

eagle: A common prefix for ESP8266 linker scripts, originating from the original Espressif SDK. flash.4m2m: Indicates the memory configuration: 4m refers to 4 megabytes (32 megabits) of flash memory. 2m might refer to 2 megabytes allocated for the file system (like SPIFFS or LittleFS). In summary, this setting tells the build system to use the eagle.flash.4m2m.ld linker script, which configures the memory layout for a microcontroller with 4MB of flash memory, with a specific partitioning scheme, likely suited for an ESP8266 or similar microcontroller.

floatplane commented 3 months ago

hi @Allram! sorry to be so quiet - I must not have had my notifications set up correctly for this project 🙈. Thanks for your kind words and the detailed explanation on the linker options!

I think my big concern in the past about switching to LittleFS is that it's not backwards compatible, at least AFAICT. And I'm currently 1350 miles from my house, so if I'm correct I wouldn't be able to apply this update to my own devices to test it out - my current config would get wiped out and the ESP board would go back into adhoc wifi mode.

Do you have any thoughts about how to handle upgrading an existing install that has config data saved on SPIFFS? I can't think of a clean way to do it :(

WDYT about making this an #ifdef for now and creating new build configs for LittleFS/SPIFFS? We could just keep producing builds that support either one and then axe the SPIFFS builds at some point.

floatplane commented 3 months ago

I am taking a swing at this in #72 - the default builds will switch to LittleFS but SPIFFS will also be an option for back-compat. LMK if that makes sense!

Allram commented 3 months ago

I agree with you here. Didnt think about that scenario at all 🙈

Will close this. And will follow you in #72 Building double for a time seems like to be a good way to do this and then see if its possible to make a migration or just remove SPIFFS.