Page 1 of 1

store a variable persistent in config section

Posted: 06 Jan 2019, 11:10
by riker1
Hi
I am wondering if I can store a variable persistent in a flash part maybe config sections ?

thanks T

Re: store a variable persistent in config section

Posted: 06 Jan 2019, 11:26
by grovkillen
Yes and no. Nothing which is set dynamically will survive a boot. BUT you can use a MQTT broker and MQTT import to fetch the value from there (if you have the retained setting checked).

But we're discussing a external flash (EEPROM) which could be used.

Re: store a variable persistent in config section

Posted: 06 Jan 2019, 12:09
by riker1
ok thanks

Re: store a variable persistent in config section

Posted: 12 Aug 2019, 15:16
by obod0002c
grovkillen wrote: 06 Jan 2019, 11:26 Nothing which is set dynamically will survive a boot.
I'd like to re-activate this question: for quite a few of my ESP's I programmed myself, I had the necessity to store values that would survive even long periods of no power.
Either because I do not want to enable WiFi or simply because I can't.

Yes, I know, memory cells are wearing out, like all hardware and us human beings, too.
But a change from time to time shouldn't really harm the devices.
Maybe there's a chance to get this feature - or is it already available - and I have browsed only those messages were it wasn't?

As ESP Easy already uses persistent storage, it shouldn't be a big effort ... credentials, drivers, rules, all seem to be pretty persistent. Maybe a small change in the device's section or a few new system variables would do?

Re: store a variable persistent in config section

Posted: 12 Aug 2019, 17:28
by grovkillen
We're discussing implementing external EEPROM as well as a command to store to flash.

Re: store a variable persistent in config section

Posted: 05 Aug 2023, 21:01
by muppet96
I was just looking at the same thing as I need to be able to save threshold values from time to time that need to survive a cold re-boot. At the moment I am trying an instance of regulator (PO21) where I can use the setlevel and getlevel commands. I couldn't find any reference to any other method. Prior to this I was using the MQTT method but this needs to be stand alone with no MQTT broker within reach.

Re: store a variable persistent in config section

Posted: 05 Aug 2023, 21:25
by Ath
Currently, using P021, the Level plugin, is the easiest way of storing and retrieving a value that'll survive a cold boot/power down. Just be aware that storing the value (too) often will wear out the flash storage.