Link IoT Edge allows you to resume data transmission from a breakpoint. If the local network is disconnected or no response is returned within 15 seconds after data is uploaded to Alibaba Cloud, the data is persisted on premises. After the network connection recovers, historical data will be uploaded again. To resume data transmission from a breakpoint, you must configure a message route in IoT Platform. You can also customize the persistence settings at the edge.
Configure message routes in IoT Platform
Messages at the edge have multiple sources, such as devices, and Function Compute. Link IoT Edge supports configuring an exclusive message route for each message source. If you want to persist messages from a specified source on premises and enable message transmission resumption in case of network interruptions, you must configure a message route. When you configure a message route, you must set the Message Destination parameter to IoT Hub and the Service Level parameter to 1 (QoS = level 1).
This topic describes how to resume data transmission from a breakpoint based on the steps that are specified in the Sample drivers topic.
Persistence settings at the edge
The following three configuration items are included: the file storage path, the number of nodes, and the node storage space.
If the size of persistent files exceeds the limit, the earliest data node is deleted.
You can use the following default configurations.
Configuration item | Default value |
---|---|
File storage path
|
/linkedge/run/history_record |
Maximum number of nodes
|
10 |
Maximum storage space of a node
|
104857600 (100 MB) |
You can also use the following operations to customize configurations.
Operation | Description |
---|---|
Retrieve the file storage path |
|
Configure the file storage path |
|
Retrieve the number of nodes |
|
Configure the number of nodes |
|
Retrieve the maximum storage space of a node |
|
Configure the maximum storage space of a node |
|
Verify the feature of data transmission resumption
The following example uses the LightSensor device that is created in the Sample drivers topic to verify the feature of data transmission resumption.
For the message route that is assigned to the edge instance, the Message Destination and Service Level parameters have been set to IoT Hub and 1, respectively. For the persistent settings at the edge, use the default values.
FAQ
- Will disk I/O performance be affected during data transmission resumption?
Yes. If a network disconnection occurs, Link IoT Edge persists data to be uploaded on premises. Disk I/O performance is affected based on the data size.
- Why historical data has not been submitted to IoT Platform after the network connection
is restored?
The maximum number of records that can be submitted per second is 10. If a large amount of historical data needs to be submitted, the data transmission process is time-consuming.
- How can I customize the storage path and maximum size of persistent files?
For information about how to customize the storage path and maximum size of persistent files, see Persistence settings at the edge in this topic.
- Will new data be saved if the size of persistent files reaches the limit during a
network disconnection period?
Yes. If the size of persistent files reaches the limit, the earliest data is deleted.
- How do I view the logs for data transmission resumption?
You can run the following commands to view the logs:
cd /linkedge/run/logger/message-router/
tail -f log.INFO