Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 5 months ago.
mbed Device Connector Client Store and Forward
Does the mbed Device Connector Client support data store and forward? I have a device that will use a GPS and a 4G network and because it is moving around, it cannot guarantee that it will always have network connectivity to the mbed Server. However I need the GPS data for the period in which it does not have connectivity as I am storing this data for later time series analysis.
1 Answer
8 years, 5 months ago.
Yes, if you look through example code we do a registration update every 25 - 30 seconds. If the connection was lost the registration update will trigger a re-registration on which all unsynced values will be synced to mbed Device Connector.
You can test it out easily using https://github.com/ARMmbed/mbed-os-example-client. Run it on a K64F with ethernet, hit SW2 a couple of times, yank the ethernet cable out of the device, press SW2 a couple of times again and put the cable back. Within 30 seconds the device will re-register and new values will be in Device Connector.
However... for time-series databases this might not be good enough, as this will hold the last value for a resource, and thus might be overridden. In that case, you should cache the values in a vector (w/ RTC clock and GPS value) and only clear it when sync was successful.