In case of power fail

themindfactory
Posts: 65
Joined: Mon Mar 26, 2018 7:57 pm

In case of power fail

Postby themindfactory » Wed Oct 30, 2024 1:50 am

How does RM get back the last data that was stored in the cloud, after a powerfail or reset, I thought maybe it was built in but my code currently does not do this.

Richard.

ESP_Piyush
Posts: 309
Joined: Wed Feb 20, 2019 7:02 am

Re: In case of power fail

Postby ESP_Piyush » Tue Nov 05, 2024 4:22 pm

The firmware does not really get the last data stored in the cloud. Rather, the cloud always has the last data reported by the device. For parameters like "Name", the PROP_FLAG_PERSIST flag is provided while creating the parameter as you can see here. This ensures that the value is stored in persistent memory and is retrieved on a reboot. Your registered device write callback gets invoked automatically when you add such a param to the device and a value for that is found in persistent memory.

Alternatively, if you want to be able to send some commands to the device even when it is offline and expect it to receive them when it comes online, you can use the command response framework.

Who is online

Users browsing this forum: No registered users and 11 guests