Skip to main content

Data Format Document

Click here for the decoding code: JavaScript decoding example code

The following is a detailed description of the data format.

1. LoRaWAN Node Data Upload Format

1.1 Overall Data Packet Format

Sensor-1 IDTotal Length(bytes)Sensor Data Packet 1-1Sensor Data Packet 1-2...Sensor Data Packet 1-n...Sensor-2 IDTotal Length(bytes)Sensor Data Packet 1-1...
2 bytes1 byte2 bytes1 byte
note

Each LoRaWAN packet can contain data from multiple sensors.
Each sensor can contain multiple types of sub-data.

1.2 Sensor Data Packet Format

Sensor Data PacketID Data Type Inside the PacketTotal Valid Data Length (bytes)Valid Data of This Sensor Packet
4 bits4 bits1 byte...
note

Total Valid Data Length (bytes): This field is only present for arrays, omitted for other data types.

Data TypeValueBytes Occupied
array0b0000max 64
double0b00018
float0b00104
bool0b00111
int8_t0b01001
uint8_t0b01011
int16_t0b01102
uint16_t0b01112
int32_t0b10004
uint32_t0b10014

1.3 Sensor Raw Data Conversion Instructions

All data types (except for arrays) are split in the same way as floats.
When packing, the low byte comes first.

typedef union {
union bits_32_raw_data {
uint32_t uint32_t_raw_data;
int32_t int32_t_raw_data;
float float_raw_data;
};
uint8_t bits_32_convert_data[4];
} bits_32_type_convert_t;

data[0] = bits_32_convert_data[0];
data[1] = bits_32_convert_data[1];
data[2] = bits_32_convert_data[2];
data[3] = bits_32_convert_data[3];

1.4 Data Packet Decoding Example

This is an example of a complete LoRaWAN data packet upload. (The data below is in hexadecimal):

04 00 0A 02 2B 34 BB 41 12 88 C5 B3 41 00 00 02 05 07

Data (Hex)Description
0x04 0x00Parent ID. According to the sensor table, this identifies the GXHTC temperature and humidity sensor.
0x0AGXHTC data length is 10 bytes.
0x02 (0b0000 0010)High 4 bits: Sub ID, represents GXHTC temperature.
Low 4 bits: Data type is float.
0x2B 0x34 0xBB 0x41Temperature value, converted to 23.40047264099121.
0x12 (0b0001 0010)High 4 bits: Sub ID, represents GXHTC humidity.
Low 4 bits: Data type is float.
0x88 0xC5 0xB3 0x41Humidity value, converted to 22.471450805664062.
0x00 0x00Parent ID. According to the sensor table, this identifies battery power.
0x02Battery data length is 2 bytes.
0x05 (0b0000 0101)High 4 bits: Sub ID, represents battery percentage.
Low 4 bits: Data type is uint8_t.
0x07Battery remaining: 7%.

2. Special Circumstances

2.1 Sensor Data Reading Error

When a sensor reading error occurs, the data length field is set to 0, and no data for this sensor is filled afterward. However, if there are multiple sensors and one sensor encounters an error, it does not affect the data transmission of other sensors.

This is an example of a complete LoRaWAN data packet upload. (The data below is in hexadecimal):

04 00 00 00 00 02 05 07

The GXHTC sensor reading error, so the length field is set to 0. However, the battery data transmission is not affected.

3. Sensors

3.1 Sensor ID Summary Table

Sensor NameParent IDData NameSub IDData TypeDecimal PlacesMeasurement RangeUnitDescription
Battery Power0x0000Battery Percentage0x00uint8_t0~100
Charging State0x01uint8_t0: uncharged; 1: charging
RS4850x0001uint8_tRS485 uploads array data
BMP2800x0002Atmospheric Pressure0x00float2300~1100hPa
Temperature0x01float2-40~85°C
BH17500x0003Light Intensity0x00float11~65535lx
GXHTC0x0004Temperature0x00float2-40~125°C
Humidity0x01float20~100%RH
DA2170x0005X-axis Acceleration0x00float2±16g
Y-axis Acceleration0x01float2±16g
Z-axis Acceleration0x02float2±16g
OUTDOOR_VALVE0x0006VALVE_0_STATUS0x00bool
VALVE_1_STATUS0x01bool
PULSE_COUNTER_00x02uint32_t
PULSE_COUNTER_10x03uint32_t
IO0x0007IO_NUMBER0x00uint8_tNumber of IOs
IO_EDIT0x01int16_tEach bit represents an IO; 0: non-adjustable, 1: adjustable
IO_MODE0x02int16_tEach bit represents an IO; 0: input, 1: output
IO_STATUS0x03uint16_tEach bit represents an IO; 0: low, 1: high
PT1000x0008Temperature0x00float1°C
DOOR_MONITOR0x0009DOOR_MONITOR0x00booltrue: door open; false: door closed
BODY_DETECTOR0x000ABODY_DETECTOR0x00booltrue: presence; false: no presence
SEN0563_HCHO0x000BHCHO0x00uint16_t0~3ppmQualitative sensor
SEN0564_CO0x000CCO0x00uint16_t5~5000ppmQualitative sensor
SEN0565_CH40x000DCH40x00uint16_t1~10000ppm(C3H8)Qualitative sensor
SEN0566_VOC0x000EVOC0x00uint16_t1~500ppmQualitative sensor
SEN0567_NH30x000FNH30x00uint16_t1~300ppmQualitative sensor
SEN0568_H2S0x0010H2S0x00uint16_t0.5~50ppmQualitative sensor
SEN0569_EtOH0x0011EtOH0x00uint16_t1~500ppmQualitative sensor
SEN0570_SMOKE0x0012SMOKE0x00uint16_t10~1000ppmQualitative sensor
SEN0571_ODOR0x0013ODOR0x00uint16_t0.5~50ppmQualitative sensor
SEN0572_H20x0014H20x00uint16_t0.1~1000ppmQualitative sensor
SEN0574_NO20x0015NO20x00uint16_t0.1~10ppmQualitative sensor