Closed romanmashta closed 12 months ago
To be honest, I would prefer if the default was set to not write to NVS.
Especially as it does not appear the setting can be changed when flashing using this tool: https://bitmaker-hub.github.io/diyflasher/
NVS does not save to same address by design. It uses new location on every update and mark old as free. It would take years to make few cycles over 20kb NVS partition. Your concerns are valid, but they are already addressed by NVS API under the hood. We can even make it toggleable in WiFi config if it is required.
@roblatour @BitMaker-hub I've added this option to WiFi settings interface with Off by default. So every user can decide if they want to keep stats through device reboot.
Great idea, that's perfect.
This MR store stats to NVS storage. It uses increasing time interval from 5 minutes to 12 hours to store stats. So in the long run it uses 12 hours only intervals. This interval along with the wear levelling feature of NVS api should have minimal impact of nvram lifespan and give tens of years of stats saving. Please see for details:
https://espressif-docs.readthedocs-hosted.com/projects/esp-faq/en/latest/software-framework/storage/nvs.html
This feature can be turned on or off through WiFi settings web interface. Default is — Off