Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 19 commits into
base: dev
Choose a base branch
from

Conversation

rlagerweij
Copy link
Contributor

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.

rlagerweij and others added 19 commits January 18, 2022 14:48
should help with debugging
the readsettings function would recurse indefinately if writesettings would not generate a file. However, default settings are included in the main firmware header so there is no real need to write them if settings.ini does not exist. We can just write the settings when they change.
the fucntion getUniqueID() depends on networkstuff.h so the definition of MQTT variables is moved below this include, to allow settingMQTTuniqueid to be set from the start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants