How to save 4-5 variables in the cloud ...?

Hi …

I am new in the world of IMP …
I have got a project , that i need to retain every day / month /etc one counter of total pieces …
If i restart / switch off /on the IMP it restart with 0 and i lost my total pieces … What i need it is to save this value ( integer) in the cloud and when restarting recover the old number …

Will be possible with persisten storage ? I tried but i can not get to work correctly …

Thanks a lot

Not sure of your electronic experience. Someone like @hugo or @peter will provide the answer about persistent storage as I’ve never used that before. There is another option by using an FRAM.

See this example:

Doesn’t store much, but enough for your data and it is permanently saved until you overwrite or erase it. If the Imp loses the agent, you still won’t lose data.

You can pretty easily store this in the cloud with the agent-side server.save; the device can just send an “increment” message to the agent that will increment this counter.

Does the device need to know the count (it can always ask the agent) or is it ok if the total count is just available via http to the agent?