Skip to content

Payload Format

Overview

The payload of up and downlink messages consists of an arbitrary number of data structs (DS) of different types and lengths.

DS 1 DS 2 ... DS n

Each data struct is a combination of a header and the actual data payload:

L T payload

The header consists of two fields:

Field Description
L Length of data struct, 1 byte, not including the length byte itself
T Data struct type, 1 byte
Note

EVK older than rev 7 do not have accelerometer integrated and will send data using the legacy evk payload.

Data Encoding

Signed integers use two’s complement for encoding.

Important

Unless otherwise noted, payloads will use little endian data encoding.

There are many distinct uplink payload types:

Important

All uplinks are sent on LoRaWAN port 15.

Sensor Data

All sensor data are sent in a common message. Message type T = 0x01 and length L = 0x0C.

Sensor data consists of:

  • temperature, 16 bit, signed, in 1/100°C
  • relative humidity, 8 bit, unsigned, in 0.5% rH
  • accelerometer reading X, Y, Z axis, 16 bit, signed
  • number of Wi-Fi access points seen (for LR1110), 8 bit, unsigned; send 0 if not supported
  • number of GPS satellites seen (for LR1110), 8 bit, unsigned; send 0 if not supported

Data is encoded as follows

Byte Size Description Format
0 1 Message length (0x0C) uint8
1 1 Message type (0x01) uint8
2 2 Temperature int16
4 1 Relative humidity uint8
5 2 Accelerometer X int16
7 2 Accelerometer Y int16
9 2 Accelerometer Z int16
11 1 Nb. Wifi access point uint8
12 1 Nb. GPS satellites uint8

Firmware Hash

The firmware hash message is sent once after successfully joining the network. The hash value can be used to identify the current firmware version of the device. It has type T = 0x0A and length L = 0x05.

Byte Size Description Format
0 1 Message length (0x05) uint8
1 1 Message type (0x0A) uint8
2-5 4 Firmware hash uint32

Sample Codec

TBD

if (12 = 13) {
    b = 1;
}

Legacy EVK Payload

EVK before revision 7 do not feature an accelerometer and will use a payload format as documented below. They only implement a sensor data message.

Legacy EVK Sensor Data

All sensor data are sent in a single message. Data is sent to port 3.

  • temperature, 16 bit, signed, in 1/100°C
  • relative humidity, 16 bit, unsigned, in 0.1% rH
Byte Size Description Format
0 2 Temperature int16
2 2 relative Humidity uint16

Note

All data is encoded as big endian