Keep-alive
Keep-alive decoding
The Keep-alive is a periodically sent message which contains the most important device data.
The data is described in the table below, where an example is also given in a second table.
0
-
81
Command byte for this packet.
1
7:3
-
(RFU) - Reserved for future use.
1
2
-
Occupied.
1
1:0
-
Internal temperature sensor data, bits – T[9:8].
2
-
XX
Internal temperature sensor data, bits - T[7:0] .
t [°C] = (T[9:0] - 400) / 10.
3
-
XX
Relative Humidity data; RH [%] = (XX * 100) / 256.
4
-
XX
Device battery voltage data, bits 15:8.
5
-
XX
CO2 value in ppm, bits [7:0].
6
7:3
-
CO2 value in ppm, bits [12:8]. CO2, [ppm]= ((Byte[6] & 0xF8) << 5) | Byte[5].
6
2:0
-
(RFU) - Reserved for future use.
7
-
XX
PIR trigger count.
Keepalive example
0
-
81
Command byte for this packet.
1
7:3
-
(RFU) - Reserved for future use.
1
2
-
Occupied.
1
1:0
02
Internal temperature sensor data, bits - T[9:8].
2
-
88
Internal temperature sensor data, bits - T[7:0].
t [°C] = (T[9:0]-400)/10. t [°C] = (0x0288-400)/10 = (648-400)/10 = 24.8 °C.
3
-
80
Relative Humidity data; RH [%] = (XX*100)/256 = (0x80 * 100)/256 = (128*100)/256 = 50% RH.
4
-
0A
Battery Voltage, [mV] = ((XX * 2200) / 255) + 1600.
5
-
0B
CO2 value in ppm, bits [7:0].
6
7:3
18
CO2 value in ppm, bits [12:8]. Example code:
CO2, [ppm] = ((Byte[6] & 0xF8) << 5) | Byte[5]; CO2 value = ((0x18 & 0xF8) << 5) | 0x0B = 779 ppm.
6
2:0
-
(RFU) - Reserved for future use.
7
-
0B
PIR trigger count = 11.
Keepalive period
Byte index
Hex value - Meaning
0
02 – Command code to set keepalive period
1
XX – keep-alive period in minutes. Value 0x00 isn’t applicable. Default value 0A=10min.
Example command: 0x020F
The example sets the keep-alive period to 15 minutes.
Note that the period value must respect the LoRaWAN messages duty cycle limitations. Otherwise the message will be sent when this is allowed. Also, the bigger period value, the less battery discharge. In most of cases, min. allowed period is 3 minutes and recommended values are 10 minutes or greater.
This command is used to get the period of the keep-alive command messages. Server sends the command code and the response is sent from the device together with the next keep-alive command.
The keep-alive in the example is omitted for clarity.
Byte index
Sent request
Received response
0
12 – The command code.
12 – The command code.
1
XX – device keep-alive period in minutes.
Example command: 0x12
Example response: 0x120A – the keep-alive is 10 minutes.
Last updated
Was this helpful?