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

Data Encoding

Signed integers use two’s complement for encoding.

Important

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

The following table gives an overview of the uplinks of miro Insight and miro Outsight.

Message Description OEM-LWEU868 Size ID Byte Byte Byte Byte Byte Byte
None None 0 0
TempRH Membrane 1+3*m 1 T[1] T[0] RH
CO2 data 1+2*m 2
Battery status 5 3
TempRH_EC2 2 4
Common settings y 6 5
CO2 settings 7 6
SettingsDaynight_EC2 7
SettingsTemp_EC2 5 8
Battery voltage y 3 9
Firmware hash y 5 10
Door alarm 9 11
Door alarm cleared 7 12
Door status 8 13
Door settings 9 14
IAQ data 1+2*m 15
Pressure data 1+3*m 16
ReportInterval 3 17 Intv[1] Intv[0]
Temperature external cable DS18B20 y 1+4*m 18 Ch1_T[1] Ch1_T[0] Ch2_T[1] Ch2_T[0]
TempRH_Internal In the box 1+3*m 19 T[1] T[0] RH
Light data Membrane 1+2*m 20 val[1] val[0]
- m: number of measurements

Important

All uplinks are sent on LoRaWAN port 15.

Report Interval

Measurement data can be accumulated by the sensor sent out as multiple values in one message. As there are no timestamp information within the message, only the time of last measurement is known. It is equal to the timestamp of the message. To be able to calculate the timestamps of older messages, the measurement interval has to be known by the decoder. This can either be a static configuration or it can be enabled on the device to report the current interval with every measurement message.

Byte Size Description Format
0 1 Message length (0x03) uint8
1 1 Message type (0x11) uint8
2 2 measurement interval in sec uint16

Temperature and humidity data

The temperature and humidity data message type is used to upload a number of sensor measurement values. Message length is dependent on the number of accumulated measurements: \(L = 1 + 3 * N\_{meas}\)

Byte Size Description Format
0 1 Message length (0x03) uint8
1 1 Message type (0x01) uint8
2-4 3 Measurement 1 see below
5-7 3 Measurement 2 see below
... ... ... ...
\(3*N-1\) to \(3*N+1\) 3 Measurement \(N\) see below

The number of values per message is depending on the sensor configuration. The oldest measurement value is transmitted first. The last value is taken just before transmission. As the measurement interval configuration is known, the timestamps of all other pairs can be computed upon reception.

Single Measurement

Byte Size Description Format
0-1 2 Temperature in 0.01 °C int16 (two’s complement)
2 1 Humidity in 0.5 % uint8

Important

In case of sensor failure, a single measurement will have the payload 0x8000

Temperature external

The temperature and humidity data message type is used to upload a number of sensor measurement values. Message length is dependent on the number of accumulated measurements: \(L = 1 + 4 * N\_{meas}\)

Byte Size Description Format
0 1 Message length (0x03) uint8
1 1 Message type (0x12) uint8
2 1 Number of channels uint8
3-6 4 Measurement 1, channel 1 and channel 2 see below
7-10 4 Measurement 2, channel 1 see below
... ... ... ...
\(4*N-1\) to \(4*N+2\) 4 Measurement \(N\) see below

The number of values per message is depending on the sensor configuration. The oldest measurement value is transmitted first. The last value is taken just before transmission. As the measurement interval configuration is known, the timestamps of all other pairs can be computed upon reception.

Single temperature (external) measurement

Byte Size Description Format
0-1 2 Temperature channel 1 in 0.01 °C int16 (two’s complement)
2-3 2 Temperature channel 2 in 0.01 °C int16 (two’s complement)

Important

In case of sensor failure, a single measurement will have the payload 0x8000

Light

The light data message type. The message length is dependent on the number of accumulated measurements: \(L = 1 + 2 * N\_{meas}\)

Byte Size Description Format
0 1 Message length uint8
1 1 Message type (0x14) uint8
3-6 4 Measurement 1 see below
7-10 4 Measurement 2 see below
... ... ... ...
\(2*N-1\) to \(2*N+2\) 4 Measurement \(N\) see below

The number of values per message is depending on the sensor configuration. The oldest measurement value is transmitted first. The last value is taken just before transmission. As the measurement interval configuration is known, the timestamps of all other pairs can be computed upon reception.

Single light measurement

Byte Size Description Format
0-1 2 Light in LUX uint16

Important

In case of saturation and/or failure, the sensor delivers 0xFFFF

Common settings

This uplink will transmit the common device settings related uplink interval and retransmissions. It happens right after the sensor has joined a network and when the settings have been changed through a downlink. It will always be transmitted as a confirmed message. Retransmissions happen immediately after the NACK has been received.

Byte Size Description Format
0 1 Message length (0x06) uint8
1 1 Message type (0x05) uint8
2-3 2 Measurement interval in seconds uint16
4 1 Send cycle uint8
5 1 Flags and number of retransmissions, combination of:
Bit 7 = Confirmed uplinks (0 = off, 1 = on)
Bit 6 = LED (0 = off, 1 = on)
Bit 5 = ADR (0 = off, 1 = on)
Bit 4: Cont. VOC measurement
Bit 3: Report Interval
Bit 2-0: RFU
bitfield
6 1 Number of retransmissions: Bit 7-4: RFU
Bit 3-0: Number of retransmission
bitfield
Byte Size Description Format
0 1 Message length (0x05) uint8
1 1 Message type (0x05) uint8
2-3 2 Measurement interval in seconds uint16
4 1 Send cycle uint8
5 1 Flags and number of retransmissions, combination of:
Bit 7 = Confirmed uplinks (0 = off, 1 = on)
Bit 6 = LED (0 = off, 1 = on)
Bit 5 = ADR (0 = off, 1 = on)
Bit 4: Cont. VOC measurement
Bit 3-0: Number of retransmission
bitfield

Battery voltage

The battery voltage message reports the voltage measured by the microcontroller. It is reported in 10 mV.

Byte Size Description Format
0 1 Message length (0x03) uint8
1 1 Message type (0x09) uint8
2-3 2 Battery voltage in 0.01 V uint16

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.

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

Downlink messages are used to change the configuration of the device. They use the same general payload format as uplinks.

Important

All downlinks must be sent on the LoRaWAN port 3!

Common configuration

The common configuration message type is used to set the basic configuration such as measurement interval and send cycle.

Common configuration

Byte Size Description Format
0 1 Message length (0x06) uint8
1 1 Message type (0x87) uint8
2-3 2 Measurement interval in seconds uint16
4 1 Send cycle uint8
5 1 Flags and number of retransmissions:
Bit 7 = Confirmed uplinks (0 = off, 1 = on)
Bit 6 = LED (0 = off, 1 = on)
Bit 5 = ADR (0 = off, 1 = on)
Bit 4: Continuous VOC
Bit 3: Report Interval
Bit 2-0: RFU (send as 0)
bitfield
6 1 Bit 7-4: RFU (send as 0), Bit 4-0: Number of retransmissions

Example: 0x0687B400032002

  • 0x05: length
  • 0x87: type
  • 0xB400: measurement interval 180 seconds (little endian: 0x00B4)
  • 0x03: SendCycle 4x180 = 12min (-1 encoded)
  • 0x20: flags (0b00100000): Not confirmed, LED off, EDR on, VOC off repeated interval off
  • 0x02: number of retransmissions: 2

For FW version 1.2.0 and older a 1 byte shorter message was used and the number or retransmissions was the last 4 bits (LSB) of the flags.

Example for FW version 1.2.0 and older: 0x0587B4000322

  • 0x05: length
  • 0x87: type
  • 0xB400: measurement interval 180 seconds (little endian: 0x00B4)
  • 0x03: SendCycle 4x180 = 12min (-1 encoded)
  • 0x20: flags (0b00100000): Not confirmed, LED off, EDR on, VOC off repeated interval off, number of retransmissions 2

Reset

This downlink will reset the device with delay. Device will reset after reset delay seconds if magic number matches

Byte Size Description Format
0 1 Message length (0x06) uint8
1 1 Message type (0x84) uint8
2-5 4 Magic number 0xF98BD419 uint32
6 1 Reset delay in seconds uint8

Example: 0x0684F98BD4190A

  • 0x06: length
  • 0x84: type
  • 0xF98BD419: magic number
  • 0x0A: delay 10 sec

For FW version 1.2.0 and older a 1 byte shorter message was used and the delay was not available

Example: 0x0584F98BD419

  • 0x05: length
  • 0x84: type
  • 0xF98BD419: magic number