Store and Forward

Depending on the Cloud Interface configuration for a device, data is either pushed directly to the cloud or stored locally. This storage is set up by configuring Store and Forward for the device which manages an underlying file containing encoded data.

Store and Forward Configuration Parameters

Store and Forward is configured for a device via the /cloudInterface/store_forward Resource. This Resource provides the following parameters:

  • /cloudInterface/store_forward/flush: trigger to manually flush both the Store and Forward memory and the persisted data. Manual flushing means that you can choose when to flush, in an on demand fashion. A typical use case is as follows: there is an Observation on the Store and Forward /cloudInterface/store_forward/level value (described below), and when it reaches a certain amount of data, the flush is called via an Edge Action. A manual flush is therefore different than an automatic periodical flush programmed with the period Resource (described below).
  • /cloudInterface/store_forward/heartbeat_on_empty: when enabled, the device will repeatedly send a heartbeat even if there is no data, at the period (in seconds) specified in /cloudinterface/store_forward/period.
  • /cloudInterface/store_forward/level (introduced in firmware 3.0.0): indicates how full the Store and Forward storage is. This Resource can be used by a client application to stop sending data until Store and Forward goes below a threshold defined by the app. Note that when a Cloud Observation is added on level/value, the data is pushed to the cloud without flushing the Store and Forward storage. This is a specific behavior that allows the level to be tracked without disturbing the filling of the Store and Forward storage.
    • enable: when enabled, then /level/value is updated at the frequency set in /level/period.
    • period: the frequency, in seconds, at which to update the storage level value. Must be set to a value greater than 0.
    • value: the current storage level, as a percentage between 0 through 100%.
  • /cloudInterface/store_forward/period: the frequency, in seconds, at which to automatically flush the Store and Forward memory and the persisted data, or to send a heartbeat if there is no data.
  • /cloudInterface/store_forward/persistence/: configures the persistence of data to the underlying encoded file:
    • /cloudInterface/store_forward/persistence/enable: when enabled, data will be repeatedly persisted at the period (in seconds), specified in /cloudInterface/store_forward/persistence/period.
    • /cloudinterface/store_forward/persistence/period: the frequency, in seconds, at which to persist data to the file. The value must be greater than 0.
    • /cloudInterface/store_forward/persistence/trigger: indicates if the data in memory can be manually persisted.
  • /cloudInterface/store_forward/storage_empty: indicates if the Store and Forward memory currently contains data.

Behavior When Store and Forward is Full

When Store and Forward is full (5MB), the data is automatically flushed, if connectivity allows it. When Store and Forward reaches the 7 MB limit, the device triggers a self-healing measure and clears all the data stored; the data will therefore be lost.