Store values between reboots
Moderators: grovkillen, Stuntteam, TD-er
Store values between reboots
Hi all,
I wonder if it possible to store a value (in a dummy task) that will survive after a reboot.
I was thinking about an external SD card:
https://wiki.wemos.cc/products:d1_mini_ ... ard_shield
Is it supported?
Any other idea?
thanks
I wonder if it possible to store a value (in a dummy task) that will survive after a reboot.
I was thinking about an external SD card:
https://wiki.wemos.cc/products:d1_mini_ ... ard_shield
Is it supported?
Any other idea?
thanks
Re: Store values between reboots
You could use the mqtt feature "retain" to store values in combination with the mqtt import plugin.
Re: Store values between reboots
Hi,
thanks for the answer.
I have some questions:
How does it work?
Is it a global parameter?
When the value is restored? After boot?
Where does it stores the value?
Does it store the value everytime there it is published or only when it changes?
What are the implications on the life of the Flash Memory?
thanks
Re: Store values between reboots
>How does it work?
First, you need an mqtt broker for that solution.
>Is it a global parameter?
"mqtt retain msg" is a global advanced setting
>When the value is restored? After boot?
The value is restored after reboot, when the mqtt import plugin subscribes to a specific topic.
>Where does it stores the value?
in the mqtt broker
>Does it store the value everytime there it is published or only when it changes?
you can to publish the value via a rule to control the moment it is stored
>What are the implications on the life of the Flash Memory?
0
First, you need an mqtt broker for that solution.
>Is it a global parameter?
"mqtt retain msg" is a global advanced setting
>When the value is restored? After boot?
The value is restored after reboot, when the mqtt import plugin subscribes to a specific topic.
>Where does it stores the value?
in the mqtt broker
>Does it store the value everytime there it is published or only when it changes?
you can to publish the value via a rule to control the moment it is stored
>What are the implications on the life of the Flash Memory?
0
Re: Store values between reboots
ok. thanks.moebius wrote: ↑13 Mar 2018, 14:05 >How does it work?
First, you need an mqtt broker for that solution.
>Is it a global parameter?
"mqtt retain msg" is a global advanced setting
>When the value is restored? After boot?
The value is restored after reboot, when the mqtt import plugin subscribes to a specific topic.
>Where does it stores the value?
in the mqtt broker
>Does it store the value everytime there it is published or only when it changes?
you can to publish the value via a rule to control the moment it is stored
>What are the implications on the life of the Flash Memory?
0
Now I understand it better.
But that is not what I need.
Assuming a thermostat (ESP1) and a device that controls the heating (ESP2).
I would like the ESP2 device to be fully independant in case any major failure occurs (such as wifi or router failure, power failure, reboot, etc)
So I need a way to store in the ESP2 device the temperature set in ESP1 and in case of reboot the ESP2 needs to restore the previous setting and restart his heating control.
Any idea?
Re: Store values between reboots
If there are already 2 devices involved, a router or wifi problem will also cause a failure...also if the measurement device does not work anymore. For that case, you need something like a heartbeat in the whole process.
Easiest way would be, to boot the heating device with a save setting - i assume you have a hardware safeguard also (like a bi-metal switch on the heating device).
I dont know of a way to save a value in flash and restore it at boot - you could take a look at micropython (there you have the ability to write and read files, etc)
Easiest way would be, to boot the heating device with a save setting - i assume you have a hardware safeguard also (like a bi-metal switch on the heating device).
I dont know of a way to save a value in flash and restore it at boot - you could take a look at micropython (there you have the ability to write and read files, etc)
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Store values between reboots
This might come in handy in the future: https://github.com/letscontrolit/ESPEasy/issues/1011
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
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Store values between reboots
Dummy devices are persistent through reboot.
So you must find solution only for power lost.
First - backup battery.
Second:
Something like my solution for independent thermostat with Domoticz setting and logging only.
I am booting into safe setting for heater.
Setpoint and regulation rules are stored in ESPeasy thermostat ( so it works independently on Domoticz )
and setpoint in Domoticz too.
Domoticz sends this setpoint periodically to thermostat every minute.
So after one minute after power on, thermostat obtains correct setpoint.
You can ask controller for setpoint only when booting too, to eliminate periodical sending.
So you must find solution only for power lost.
First - backup battery.
Second:
Something like my solution for independent thermostat with Domoticz setting and logging only.
I am booting into safe setting for heater.
Setpoint and regulation rules are stored in ESPeasy thermostat ( so it works independently on Domoticz )
and setpoint in Domoticz too.
Domoticz sends this setpoint periodically to thermostat every minute.
So after one minute after power on, thermostat obtains correct setpoint.
You can ask controller for setpoint only when booting too, to eliminate periodical sending.
-
- New user
- Posts: 1
- Joined: 09 Apr 2018, 11:47
Re: Store values between reboots
I love to use standby automatic generator because it not only will the system power far more devices and appliances than a portable model, but it will also kick on automatically in the event of a power outage.leel1967l wrote: ↑13 Mar 2018, 14:15ok. thanks.moebius wrote: ↑13 Mar 2018, 14:05 >How does it work?
First, you need an mqtt broker for that solution.
>Is it a global parameter?
"mqtt retain msg" is a global advanced setting
>When the value is restored? After boot?
The value is restored after reboot, when the mqtt import plugin subscribes to a specific topic.
>Where does it stores the value?
in the mqtt broker
>Does it store the value everytime there it is published or only when it changes?
you can to publish the value via a rule to control the moment it is stored
>What are the implications on the life of the Flash Memory?
0
Now I understand it better.
But that is not what I need.
Assuming a thermostat (ESP1) and a device that controls the heating (ESP2).
I would like the ESP2 device to be fully independant in case any major failure occurs (such as wifi or router failure, power failure, reboot, etc)
So I need a way to store in the ESP2 device the temperature set in ESP1 and in case of reboot the ESP2 needs to restore the previous setting and restart his heating control.
Any idea?
Re: Store values between reboots
I would prefer following solution for keeping configuration which does not change often.
in dummy device (where you can keep up to 4 values) to add configuration if values are selected dummy device are persisted on local file system (similar as rules). And new values to be stored on local file system only if changed to those values already stored.
This can be (IMHO) good solution for keeping configuration parameters which does not change often and you can change such parameters via MQTT.
in dummy device (where you can keep up to 4 values) to add configuration if values are selected dummy device are persisted on local file system (similar as rules). And new values to be stored on local file system only if changed to those values already stored.
This can be (IMHO) good solution for keeping configuration parameters which does not change often and you can change such parameters via MQTT.
Who is online
Users browsing this forum: No registered users and 96 guests