Monitoring the connection of a connected product involves keeping track of its connectivity status to ensure it's functioning properly and staying connected to the network. By default, for each thing, the Connection Status metric is made available and automatically kept updated by the DPS backend engine.
The Connection Status metric indicates whether a product/machine is ONLINE or OFFLINE, and a value is stored whenever the status changes.
The metric is of type INTEGER, and each value returned corresponds to a precise status
Value | Meaning |
-1 | UNREACHABLE |
0 | OFFLINE |
1 | ONLINE |
By entering the edit page of the Connection Status raw data metric, you can change several aspects of the metric, including how the status is kept up-to-date.

Disable automatic update
By default, the Connection Status is automatically updated according to the received messages.

In the alternative, you can disable the automatic update, and in this case, it will be up to you to change the status when needed.
If disabled, you can update the Connection Status by sending a special MQTT message.
Timeout
In this section, you can configure the timeout to be used to evaluate when a product/machine is offline according to the latest received message.

For instance, if a 2-hour timeout has been configured, the thing goes OFFLINE only 2 hours after the last received value.
Take care to configure a timeout, which is in line with the urgency in detecting whether the object is connected or not.
LWT
In case you want a real-time connection status detection in order to be informed immediately when the thing goes OFFLINE, you can enable the LWT (Last Will and Testament), which relies on the MQTT protocol.

The LWT requires that, during the MQTT channel establishment, the thing publishes to a specific topic the WILL message.
Generally, this is done by the client, so it is enough to specify the LWT topic and message in the client configuration options.
TOPIC: <PATH_PREFIX>/<USERNAME>/<ASSET_ID>/<LWT_PATH>
PAYLOAD
{
"will": true
}Other than the Path, you also need to specify the Path Prefix, which depends on the underlying MQTT broker:
IoT Connector | LWT Path Prefix |
STC | |
$EDC |
Once the LWT is configured, in case the thing loses the cloud connection, the MQTT broker resends to the subscribers the WILL message notifying them that the thing is OFFLINE. Note that the WILL message is sent to the subscribers only after one and a half keep-alive periods have passed. For instance, if the keep-alive interval is 5 minutes, the WILL message is notified only 7:30 minutes after the thing has sent the last message (measure, keep-alive ping). So be careful to set the right connection keep-alive interval if you want a real-time (or near real-time) connection status update. It is suggested to avoid periodically sending the keep-alive PING, even if the thing is publishing measures (generally, this is automatically handled by the MQTT library).
Optionally, if you are using Everyware Device Cloud, you can specify the Birth path, which allows collecting birth information sent when the thing connects to the cloud. The birth certificate can be used to send connectivity information (e.g., SIM ICCID, signal level).
Predefined Properties
Other than the metric, on each thing object, you can find two additional properties:
connectionStatus: the last registered connection status value for the thing.
connectionStatusLastUpdateTimestamp: the timestamp related to the last connection status change.
You can reference these properties within widgets.
Here is an example of a Thing List showing the Connection Status as a column.
<thing-list-widget-v2>
<property name="name"></property>
<property name="serialNumber"></property>
<property name="connectionStatus" filter="connectionStatus"></property>
</thing-list-widget-v2>These properties are also available via API or in the Algorithms computation.