rvdbreemen / OTGW-firmware

A ESP8266 devkit firmware for the Nodoshop version of the Opentherm Gateway (OTGW)
MIT License
145 stars 34 forks source link

Add a second partion to allow user settings to persist between firmware updates #120

Open rlagerweij opened 2 years ago

rlagerweij commented 2 years ago

There are a lot of changes in this pull request but I have tried to separate them into managable commits as best as possible.

As a final test before creating this pull request I reflashed to the 0.9.3 release and littlefs and then applied the new build OTA. This worked flawlessly but it is important that the firmware is flashed first otherwise everything needs to be reflashed through USB.

There is an included batch file which should be used to build the littlefs.bin from this change on. Any parameters changed in this build script would also need to be changed in OTGW-firmware.ino (page size, fs size etc.) For now I have set the systemFS to 1 megabyte but this can be increased to 1.5m fairly easily and without impacting user settings. Flashing the orginal littlefs.bin would override the user partition but should still work.

I have made a few changes to the settings handling as well since some undesirable behaviour showed up while testing my code with failing filesystems. Hope you don't mind.