The best way to protect state from temporary power failure

In my solution I push some configuration and data to my imp app via http, and this state is registered in some imp-local variables. But those variables are wiped out in case of power loss. Once the imp recovers, I’d like it to restore its configuration and state as close to the moment of power loss as possible.

What’s the best suggested method how to handle this? Should I regularly copy my data to the agent what persists in the cloud and can pass back the last known values, if the imp asks for them (ie, at startup)?

Take a look at and server.load().

Those methods load/save data in the cloud, and will persist across a power cycle.

Thanks! Exactly what I was looking for!