Save data on power loss
Posted: Mon Dec 19, 2016 8:43 pm
Hi, I'd like to save the last state of some variables in flash when powered off.
Is there any way to do so?
I am thinking of a power capacitor to buffer power line and using an Input line of the ESP to monitor power state before the capacitor (and a diode I suppose) and trigger data saving when power is lost and, hopefully, before capacitor discharges.
Any other ideas? I't all for avoiding excessive flash memory writes since data is refreshed every second.
Thanks.
Is there any way to do so?
I am thinking of a power capacitor to buffer power line and using an Input line of the ESP to monitor power state before the capacitor (and a diode I suppose) and trigger data saving when power is lost and, hopefully, before capacitor discharges.
Any other ideas? I't all for avoiding excessive flash memory writes since data is refreshed every second.
Thanks.