stuartpittaway / diyBMSv4Code

Software for diyBMS v4
Other
145 stars 66 forks source link

Feature discussion: save/restore all settings via browser #124

Open datenheim opened 2 years ago

datenheim commented 2 years ago

While playing around with the system (Release-2022-05-24-08-14) and starting to modify some code lines (related to MQTT) I noted that all settings (module settings, rules, integrations etc.) are gone if a new firmware is uploaded to the controller (D1 mini in my case).

While this might be unavoidable due to ESP8266 and likely ESP32 it came to my mind that it would be great to just "download" the settings to some kind of file (maybe JSON). Than after flashing the new binary one could restore all settings by "uploading" the formerly mentioned file.

Is there another way or workaround to achieve this? How could that be implemented?

atanisoft commented 2 years ago

The esp32 controller has support for storage of configuration data on an SD card which is checked upon startup to load configuration data from.

sglux commented 2 years ago

Thanks for that hint. I'll take a look, maybe it could be implemented here too. Couldn't SPIFFS (or whatever it's called today) used for that?

atanisoft commented 2 years ago

SPIFFS is stored in flash, when flashing via the single binary method it will wipe flash prior to writing the new image so the SPIFFS data would be lost.

sglux commented 2 years ago

Ok, then a SD-shield is mandatory. Maybe some code from the ESP32 implementation could be pulled over here... :)

stuartpittaway commented 2 years ago

You could simply download the file via a web browser and then upload after the upgrade. No SD card required then.

datenheim commented 2 years ago

You could simply download the file via a web browser and then upload after the upgrade. No SD card required then.

Hi Stuart, I did not find any option in the GUI of the ESP8266 controller (Release-2022-05-24-08-14). Do I miss something?

stuartpittaway commented 2 years ago

No you didn't miss anything, I was just mentioning that an SD card wasn't mandatory, other methods could be written.