How to Identify Frequently Dropped and Constant Offline Devices among 50,000 Devices
Monitor the Device Status Change Using the Rule Engine
1) Online and Offline Status Messages
When a device connecting to the IoT platform goes offline, a message of a specific topic is generated to signify the device status change. Easily learn about the device status change by subscribing to this topic on the server.
1.1 Format of the Online/Offline Status Change
The following table shows the Payload Data Format Parameter description.
| Parameter | Type | Description |
|---|---|---|
| status | String | The device status. Valid values: online and offline. |
| productKey | String | The unique identifier of the product to which the device belongs. |
| deviceName | String | The device name. |
| time | String | The time when the message is sent. |
| utcTime | String | The UTC time when the message is sent. |
| lastTime | String | The last communication time before the status change. Note: The possible type of the last communication is PUBLISH or PING. |
| utcLastTime | String | The UTC time of the last communication before the status change. |
| clientIp | String | The public network egress IP address of the device. |
2) Configure the Rule Engine to Change the Device Status
2.1 Configure SQL
Next, configure SQL to retrieve the device status, currentTime, and lastTime from the message body. The following snapshot shows the data processing interface of the rule engine.

2.2 Configure Data Transmission RDS
The following snapshot shows how to configure the Data Transmission RDS in a data transmission interface of the rule engine.

In the device_status_history table, run SQL statements to display the online and offline statistics about the device:

2.3 Configure Data Transmission OTS
Now, configure the Data Transmission OTS as shown below.

When a device goes online, transmits service data, and then goes offline, the following records are generated in the table. The Status column indicates the device status, lastTime indicates the last communication time, and currentTime indicates the time when this message is generated, which equals to the online or offline time.

Conclusion
Tracking the status change of IoT devices in real-time helps to ensure hassle-free functioning of IoT devices. This article comprehensively outlines the steps to effectively monitor whether the IoT device is online or offline using the rule engine. For more details, visit https://www.alibabacloud.com/product/iot .
Read previous post:
How to Analyze the Network Behaviors of IoT-enabled Devices Using Wireshark
Read next post:
How to Manage Control Instructions for Offline Devices through Device Shadow
Comments
Related Products
-
IoT Platform
Provides secure and reliable communication between devices and the IoT Platform which allows you to manage a large number of devices on a single IoT Platform.
Learn More -
IoT Solution
A cloud solution for smart technology providers to quickly build stable, cost-efficient, and reliable ubiquitous platforms
Learn More -
Microservices Engine (MSE)
MSE provides a fully managed registration and configuration center, and gateway and microservices governance capabilities.
Learn More -
DBStack
DBStack is an all-in-one database management platform provided by Alibaba Cloud.
Learn More
More Posts by GXIC
- Using Service Subscription (HTTP/2) to Retrieve Device Status
- Using HTTPS to Access IoT Platform from a Device
- Usage Tips for the IoT Platform: Retrieving Device Status by Calling API Operations
- IoT Development Practices: Decoding a Cloud Solution
- How to Manage Control Instructions for Offline Devices through Device Shadow
- How to Analyze the Network Behaviors of IoT-enabled Devices Using Wireshark
- Alibaba Launches AliOS Things 3.0 at Apsara Conference 2019
- Taking a Go at Gateway and Sub-device Development
- Building a Simple Entry-Exit Monitoring System on Alibaba Cloud IoT Platform