Historical Data Enquiry
The device supports data retrievability feature to send downlink command to enquire the historical data stored in the device. Before that, ensure the device time is correct and data storage feature was enabled to store data.
- Command Format:
-
Item Channel Type Byte Description Enquire Data in Time Point fd 6b 4 Unix timestamp, Unit: s Enquire Data in Time Range fd 6c 8 Byte 1-4: Start timestamp, Unit: s Byte 5-8: End timestamp, Unit: s
Stop Query Data Report fd 6d 1 ff Data Retrievability Interval ff 6a 3 Byte 1: 01 Byte 2-3: UINT16, Unit: s, Range: 30~1200, Default: 60
- Reply Format:
-
Item Channel Type Byte Description Enquiry Result fc 6b/6c 1 00: Enquiry success. The device will report the historical data according to data retrievability interval. 01: Time point or time range invalid
02: No data in this time or time range
- Use Unix Timestamp Converter to calculate the time.
- The device only uploads no more than 300 data records per range enquiry.
-
When enquiring the data in time point, it will upload the data which is closest to the search point within the reporting interval range. For example, if the device’s reporting interval is 10 minutes and users send command to search for 17:00’s data, if the device find there is data stored in 17:00, it will upload this data; if not, it will search for data between 16:50 to 17:10 and upload the data which is closest to 17:00.
- Example:
- Enquire the historical data in a time range.
Reply:fd6c 64735b63 7c885b63 Channel Type Value fd 6c Start time: 64 73 5b 63 => 63 5b 73 64 = 1666937700s End time: 7c 88 5b 63 => 63 5b 88 7c = 1666943100s
fc6c00 Channel Type Value fc 6c 00: Enquiry success
| 20ce 0d755b63 0801 57 00 | |||
|---|---|---|---|
| Channel | Type | Time Stamp | Value |
| 20 | ce | 0d 75 5b 63 => 63 5b 75 0d=1666938125s | Temperature: 0801=>0108=264/10=26.4 °C Humidity: 57=>87/2=43.5%RH Magnet status: 00=close |