store a variable persistent in config section

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

store a variable persistent in config section

#1 Post by riker1 » 06 Jan 2019, 11:10

Hi
I am wondering if I can store a variable persistent in a flash part maybe config sections ?

thanks T

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: store a variable persistent in config section

#2 Post by grovkillen » 06 Jan 2019, 11:26

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.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

riker1
Normal user
Posts: 344
Joined: 26 Dec 2017, 18:02

Re: store a variable persistent in config section

#3 Post by riker1 » 06 Jan 2019, 12:09

ok thanks

obod0002c
Normal user
Posts: 119
Joined: 10 Aug 2019, 20:31

Re: store a variable persistent in config section

#4 Post by obod0002c » 12 Aug 2019, 15:16

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?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: store a variable persistent in config section

#5 Post by grovkillen » 12 Aug 2019, 17:28

We're discussing implementing external EEPROM as well as a command to store to flash.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

muppet96
New user
Posts: 8
Joined: 17 May 2019, 13:31

Re: store a variable persistent in config section

#6 Post by muppet96 » 05 Aug 2023, 21:01

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.

User avatar
Ath
Normal user
Posts: 3415
Joined: 10 Jun 2018, 12:06
Location: NL

Re: store a variable persistent in config section

#7 Post by Ath » 05 Aug 2023, 21:25

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.
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests