We all know that the nv table persists so long as device is powered up.
This is fine but what is catching me out now is when I do a “Build and Run” following software mods. This overrides / deletes my nv table and I am now trying to think of an elegant way to deal with this scenario. Any suggestions… my nv table has to grab data from the agent.
As I was too hasty this morning (as in the caffeine had not kicked in yet) in posting a question I have now found one method that works following more searching through imp documentation… Hopefully this could help others…
and agent then responds be returning device data for nv table.
device.on("devicePing", function (startuptime) {//... grab data and place in object to be returned back to device.... updateTable = {"pingTime": startuptime, "nvTableData": {.....} }; device.send("nvTableUpdate", updateTable); });
Or you can package up your data, send it to the agent and get the agent to server.save() it. When the device comes back online, the first thing it does is request the data back from the agent, which uses server.load() to retrieve it.