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];