Description

Milesight sensors support data retransmission feature which is to ensure no data loss if network is down suddenly for some times. There are two ways to get the lost data:

  • Data Retransmission: re-send data automatically when the device reconnects to network;
  • Historical Data Enquiry: enquire the historical data via sending downlink command. 

This article will describe how to setup configurations to achieve both features.


Requirement

  • Any Standard LoRaWAN Gateway: take Milesight UG65 as example
  • Milesight Sensor which supports data storage and data retransmission function: EM320-TH, WTS Series, AM300 V2 Series
  • ToolBox App or ToolBox software: download here



Configuration

Data Retransmission

1. Sync the time of the device via ToolBox. If the LoRaWAN version of your network server is 1.0.3 and later, it can also assign the time to device automatically. For time sync details, please refer to article How to Sync the Time of Milesight Nodes

2. Enable Data Storage and Data Retransmission function on ToolBox.

 

3. Enable Rejoin mode function and set the number of packets sent. Take below as example, the device will send LinkCheckReq MAC packets to network server at least every 30 minutes to check if the network is disconnected. If the device still gets no response from network server for 8 times (8*30 minutes = 240 minutes = 4 hours) and the last LinkCheckReq sending time is 13:00, the device will record data lost time point as 9:00.


Note: For some models, if the reporting interval is more than 30 minutes, the device will send LinkCheckReq MAC packet according to reporting interval. Please refer to corresponding user guides to check the rejoin mechanism.

 

4. After the network back, the device will send the historical data from the point in time when the data was lost (In this example is 9:00) according to the reporting interval.

 

Note:

1) If the device is rebooted or re-powered when data retransmission is not completed, the device will re-send all retransmission data again after device is reconnected to the network.

2) If the network is disconnected again during data retransmission, it will only send the latest disconnection data.

3) Data retransmission will increase the uplink and shorten the battery life.

 

Get Historical Data via Downlinks

1. Sync the time of the device via ToolBox. If the LoRaWAN version of your network server is 1.0.3 and later, it can also assign the time to device automatically. For time sync details, please refer to article How to Sync the Time of Milesight Nodes

2. Enable Data Storage function on ToolBox.

3. Ensure the device is activated on network server. Take UG65 as example, go to Network Server > Packets of gateway web GUI, type in Device EUI, set the Type to hex, type downlink command in Payload then click Send

Note: For Class A type device, it requires to wait the next uplink packet to response the command.

 

Downlink Command Format: channel(1 Byte) + command type (1 Byte) + command content

Channel

Type

Content Description

fd

6b (Enquire data in time point)

4 Bytes, Unix timestamp

fd

6c (Enquire data in time range)

Start time (4 bytes) + End time (4 bytes), Unix timestamp

fd

6d (Stop query data report)

ff

ff

6a (Report Interval)

2 Bytes, unit: s, range: 30~1200s (60s by default)

 

Example 1: enquire the historical data from 2022/10/12 15:15:00 to 2022/10/12 16:35:00.

Note: The device only uploads no more than 300 data records per range enquiry.

fd6c 74694663 347c4663

Channel

Type

Value

fd

6c (Enquire data in time range)

Start time: 74694663 => 63466974 = 1665558900 =2022/10/12 15:15:00

End time: 347c4663 => 63467c34 = 1665563700 =2022/10/12 16:35:00

 

Example 2: enquire the historical data at 2022/10/12 15:15:00. If there is no data in this time point, the device will upload the data which is closest to the search point within the reporting interval range. 

fd6b 74694663

Channel

Type

Value

fd

6b (Enquire data in time point)

74694663 => 63466974 = 1665558900 =2022/10/12 15:15:00

 

 

4. Check the enquiring result and historical data uplinks on Packet > Network Server page.

Data enquiry result:

fc6b00 or fc6c00: data enquiry success

fc6b01 or fc6c01: enquiry time invalid

fc6b02 or fc6c02: no data in the enquiry time


Historical Data:

 


 

Historical Data Decode

The historical data uses different format from regular uplinks: 20ce+data time stamp (4 bytes) + data contents (mutable). Take EM320-TH as example, one historical uplink shows as below:

20ce 9e744663 1001 5d

Channel

Type

Time Stamp

Value

20

ce (Historical Data)

56991a63 => 2022/10/12 16:03:53

Temperature: 1001=>0110=27.2°C

Humidity: 5d=>93=56.5%

 

For details of historical data decode of every model please refer corresponding user guide here

 

 

---- End ----