I am struggling a bit to understand the way ULPM can be used with Octave and the various timers. Ideally I would like an app to take periodic action and to be able to send and receive messages to the cloud. I feel like this is a basic building block for any low power application.
For example the device could be autonomous but occasionally would need to send a message to the cloud. Also it might need to react to changes in the cloud config so I would want it to poll the cloud periodically to see if there were any new instructions.
I have found the util/ulpm and also util/counter, so I can periodically take action and at the end of the action shutdown for a period. I have used virtual resources to implement a basic state machine. I have turned off developer mode.
The device is reliably sleeping and waking as required, and the virtual resources are working to store state locally.
The problem I have is managing connection to the cloud. I have no way to tell if octave has successfully completed transmission before I shutdown. I know developer mode is off and the web portal no longer shows the count of edge action activations / errors even though it is obviously running. How can I implement ‘shutdown’ after cloud sync?
My best approach so far introduces delays which don’t guarantee communication and increase power consumption. I feel there must be a better way.