0% found this document useful (0 votes)
46 views29 pages

6020 - P20 002 - Communication Protocol NEON Temperature Transmitter - C

The document describes the communication protocol for a NEON temperature transmitter. It details the various message schemes including activation, application events, and device status, as well as encoding methods. Uplink and downlink message structures are defined along with examples.

Uploaded by

thijs.buuron
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views29 pages

6020 - P20 002 - Communication Protocol NEON Temperature Transmitter - C

The document describes the communication protocol for a NEON temperature transmitter. It details the various message schemes including activation, application events, and device status, as well as encoding methods. Uplink and downlink message structures are defined along with examples.

Uploaded by

thijs.buuron
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

NEON Temperature Transmitter

Communication Protocol

Version C
05-03-2021
6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C By: ML, TB, ZZ
Contents

1 General 2

2 Message Schemes 2
2.1 Activation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.2 Application Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Device Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.4 Deactivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

3 Message Overview 5
3.1 Message Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

4 Decoding/Encoding 6

5 Message Header 7
5.1 JSON Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5.2 Binary encoding and description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

6 Uplink Messages 8
6.1 Boot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
6.1.1 JSON Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
6.1.2 Binary encoding and description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
6.2 Activated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
6.2.1 JSON Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
6.2.2 Binary encoding and description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
6.3 Deactivated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.3.1 JSON Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.3.2 Binary encoding and description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.4 Application Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6.4.1 JSON Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6.4.2 Binary encoding and description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
6.5 Device Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
6.5.1 JSON Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
6.5.2 Binary encoding and description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

7 Downlink Messages 17
7.1 Device Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
7.1.1 JSON Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
7.1.2 Binary encoding and description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
7.1.3 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7.2 Application Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.2.1 JSON Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.2.2 Binary encoding and description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
7.2.3 Binary encoding and description Temperature event config . . . . . . . . . . . . . . . . . . . . . . 24
7.2.4 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
7.3 Configuration CRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
7.3.1 CRC Calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 1 of 28
2 MESSAGE SCHEMES

1 General
All variables are little endian.

2 Message Schemes
2.1 Activation
Activation of the Temperature Transmitter is initiated by the operator. After activation an Activation Message is sent.
The full sequence is depicted below.

Figure 1: Activation Sequence Scheme

In case of an error during activation, the procedure is aborted. The error situations can be as followed (see numbers
in diagram):

1. No LoRa confirmation message from network server is received: no LoRa coverage

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 2 of 28
2 MESSAGE SCHEMES

2.2 Application Event


The temperature is measured periodically. When a condition change is detected an Application event message is
sent.

Figure 2: Event Message Scheme

2.3 Device Status


Periodically a Device status message is sent. Timing is independent from the temperature measure timer. The
message contains information related to the device.

Figure 3: Device Status Scheme

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 3 of 28
2 MESSAGE SCHEMES

2.4 Deactivation
The operator can deactivate by a long press of the button. This will result in a Deactivation Message.

Figure 4: Deactivation Message Scheme

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 4 of 28
3 MESSAGE OVERVIEW

3 Message Overview
3.1 Message Overview

ID Name Up/Down Purpose


0 Boot up Informs on device reboot
1 Activated up Indicates that a device is activated and
operational.
2 Deactivated up Indicates that a device is deactivated.
3 Application event up Inform on the temperature. It is sent on
event detection, or on a timer.
4 Device status up Informs on device health, battery info,
counter for statistics etc. It is sent
periodically.
5 Device configuration down Configures the device with radio
setting.
6 Application down Configure the application specific
configuration settings.

Table 1: Message Overview

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 5 of 28
4 DECODING/ENCODING

4 Decoding/Encoding
The messages are sent over LoRa in a binary bytestring. A LoRa network server can decode raw bytestrings coming
from the LoRa devices into JSON objects. It can also encode JSON objects back into bytestrings that form the payload
of downlink messages.

Figure 5: Device Status Scheme

Below each message is described and how it is encoded in the bytestring. The Decoder / Encoder is available on
the product support page.

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 6 of 28
5 MESSAGE HEADER

5 Message Header
The header is at the head of all messages. It indicates the protocol version and message type.

5.1 JSON Structure

"header": {
"message_type": <json string>,
"protocol_version": <json number>
}
Listing 1: JSON Header Structure

5.2 Binary encoding and description

Description Binary encoding Byte


index
message_type uint8
0
bits[3..0] message_id
• boot(0)
• activated(1)
• deactivated(2)
• application_event(3)
• device_status(4)
• device_configuration(5)
• application_configuration(6)

protocol_version bits[7..4] protocol version nr.


Version of the protocol, range:
For this protocol version the value is 2

Table 2: Header Binary Encoding

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 7 of 28
6 UPLINK MESSAGES

6 Uplink Messages
6.1 Boot
The boot message is sent when the device is used for the first time or when a reboot occurs. Reboots might occur
intended in case of activating a newly received configuration. Or the device might reboot due to a system error as
a matter to recovery (e.g. continues communication failures, unforeseen situations etc). The boot message contains
information why it has (re)booted. Typically this information can be ignored and is only used for solving problems in the
field. During normal operation and with sufficient network quality reboots seldomly occur, other than activating a newly
received configuration.

6.1.1 JSON Structure

{
"header": {
"message_type": "boot",
"protocol_version": 2
},
"boot": {
"device_type": <json string>,
"version_hash": <json string>,
"device_config_crc": <json string>,
"application_config_crc": <json string>,
"reset_flags": <json number>,
"reboot_counter": <json number>,
"reboot_info": <json string>,
"last_device_state": <json number>,
"bist": <json number>
}
}
Listing 2: Boot JSON Structure

6.1.2 Binary encoding and description

Description Binary encoding Byte


index
message_header uint8 0
As described in Message Header.
device_type uint8 1
The device type as known in the NEON family. For this
device, Temperature Transmitter the value is:

• "tt" (4)

version_hash uint32 2..5


Version hash of the currently running firmware,
represented as a hexadecimal string.

Range: (hex string)


00000000 .. ffffffff

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 8 of 28
6 UPLINK MESSAGES

Description Binary encoding Byte


index
device_config_crc uint16 6..7
CRC of the currently loaded protocol configuration,
represented as a hexadecimal string. This can be
used to verify if the corrected configuration is loaded.

Range: (hex string)


0000 .. ffff
application_config_crc uint16 8..9
CRC of the currently loaded application configuration,
represented as a hexadecimal string. This can be
used to verify if the corrected configuration is loaded.

Range (hex string):


0000 .. ffff
reset_flags uint8 10
A bitmask field from the microcontroller that indicated
the physical reason for the reset that caused the
reboot. This can be used for analysis when a device is
not working properly.

Bit 0 - Option Byte Loader


Bit 1 - Pin
Bit 2 - Power On
Bit 3 - Software
Bit 4 - IWDG
Bit 5 - WWDG
Bit 6 - Low Power

reboot_counter uint8 11
Counter of the number of reboots. Each time a reboot
occurs the counter is increased. The counter is 8bit
and will wrap after 255 to 0. This can be used for
detecting abnormal rebooting behavior.

Range:
0 .. 255
reboot_info uint8[9] 12..20
Informational string with: information on the reboot.
Example values: byte[0] reboot type
byte[1..8] specific payload
• "swdog (ABCD)"
• "assert (test:1234)"
• "application (0xaabbccdd)"
• "system (0xaabbccdd)"

last_device_state uint8 21
Last state the device was in before reboot. This can
be used for analysis when a device is not working
properly.

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 9 of 28
6 UPLINK MESSAGES

Description Binary encoding Byte


index
bist uint8 22
A bitmask with the result of the build in self test. At boot
the device performs a self test in order to verify the
working of essential components. This can be used
for analysis when a device is not working properly.
Bit value:

0: Test Failed
1: Test Succeeded

Bit 0 - Reserved (Always 1)


Bit 1 - Temperature sensor
Bit 2 - Battery Measurement
Bit 3 - Reserved (Always 0)
Bit 4 - Reserved (Always 0)
Bit 5 - LoRa Module
Bit 6 - Provisioning
Bit 7 - Activated

Table 3: Boot Message Binary Encoding

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 10 of 28
6 UPLINK MESSAGES

6.2 Activated
On activation an activated message is sent. It is an indication that the device is operational.

6.2.1 JSON Structure

{
"header": {
"message_type": "activation",
"protocol_version": 2
}
}
Listing 3: Activation JSON Structure

6.2.2 Binary encoding and description.

Description Binary encoding Byte


index
message_header uint8 0
As described in Message Header.

Table 4: Activated Message Binary Encoding

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 11 of 28
6 UPLINK MESSAGES

6.3 Deactivated
When the device is deactivated by a long press a deactivation message is sent. It is an indication that the device is not
operational.

6.3.1 JSON Structure

{
"header": {
"message_type": "deactivation",
"protocol_version": 2
}
}
Listing 4: Deactivation JSON Structure

6.3.2 Binary encoding and description

Description Binary encoding Byte


index
message_header uint8 0
As described in Message Header.

Table 5: Deactivated Message Binary Encoding

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 12 of 28
6 UPLINK MESSAGES

6.4 Application Event


The application event message contains information on a temperature. It is either triggered by an event detection or
periodic (scheduled).

6.4.1 JSON Structure

{
"header": {
"message_type": "application_event",
"protocol_version": 2
},
"application_event": {
"trigger": <json string>,
"temperature": {
"min": <json number>,
"max": <json number>,
"avg": <json number>
},
"condition_0": <json number>,
"condition_1": <json number>,
"condition_2": <json number>,
"condition_3": <json number>
}
}
Listing 5: Application JSON Structure

6.4.2 Binary encoding and description

Description Binary encoding Byte


index
message_header uint8 0
As described in Message Header.
trigger uint8 1
Source of trigger for the application event message.
String with the possible values:

"timer" (0)
- "On the periodic timer"
"condition_0" (1)
"condition_1" (2)
"condition_2" (3)
"condition_3" (4)

temperature int16[3] 2..7


The connected sensor temperature in units of 0.1°C. It 0.1°C per LSB
is reported in the min, max and avg temperature since
the last event message.

Range: -270.0°C .. 1850.0°C

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 13 of 28
6 UPLINK MESSAGES

Description Binary encoding Byte


index
condition_n uint8 8
The current state of each condition. Bit 0 = condition_0
Bit 1 = condition_1
True condition is represented by 1 Bit 2 = condition_2
False condition is represented by 0 Bit 3 = condition_3

Table 6: Application Event Binary Encoding

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 14 of 28
6 UPLINK MESSAGES

6.5 Device Status


This message contains information for maintenance, device health and other analysis. It is sent periodically.

6.5.1 JSON Structure

{
"header": {
"message_type": "device_status",
"protocol_version": 2
},
"device_status": {
"device_config_crc": <json string>,
"application_config_crc": <json string>,
"event_counter": <json number>,
"battery_voltage": {
"low": <json number>,
"high": <json number>,
"settle": <json number>
},
"temperature": {
"min": <json number>,
"max": <json number>,
"avg": <json number>
},
"tx_counter": <json number>,
"avg_rssi": <json number>,
"avg_snr": <json number>
}
}
Listing 6: Device Status JSON Structure

6.5.2 Binary encoding and description

Description Binary encoding Byte


index
message_header uint8 0
As described in Message Header.
device_config_crc uint16 1..2
CRC of the currently loaded protocol configuration,
represented as a hexadecimal string. This can be
used to verify if the corrected configuration is loaded.

Range: (hex string)


0000 .. ffff

application_config_crc uint16 3..4


CRC of the currently loaded application configuration,
represented as a hexadecimal string. This can be
used to verify if the corrected configuration is loaded.

Range: (hex string)


0000 .. ffff

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 15 of 28
6 UPLINK MESSAGES

Description Binary encoding Byte


index
event_counter uint8 5
Counter for number of events. Every time an event
message is sent this counter is increased.
This can be used to detect missed event messages.

After 255 it will wrap to 1. Zero value is reserved for


after boot only.

Range: 0 .. 255
battery_voltage uint16[3] 6..11
Voltage measurement in Volt, meant as input for 0.001V per LSB
battery charge estimation in the backend.

Note that a single voltage level on itself is not


suitable for battery charge determination because of
the type of battery.

To feed the model on the backend with accurate


data the voltage is measured on different moments.
During low load, high load and after a settle time after
high load.

Range: 0.000V .. 4.000V


temperature uint8[3] 12..14
PCB temperature in units of 1 °C. It is reported in 1°C per LSB
the min, max and avg temperature since the last
device status message. The number of temperature
measurements can be configured.

Range: -40°C .. 80°C


tx_counter uint8 15
Number of LoRa transmissions since the last device
status message.

It is reset after the device status message is sent. If


the number of LoRa transmissions becomes bigger
than 255 this field is set to 255.
avr_rssi uint8 16
The average RSSI of received messages since the -1dBm per LSB
last device status message. The value is in units of 1
dBm.

Range: -255 dBm .. 0 dBm


avr_snr uint8 17
The average SNR of received messages since the last
device status message.

Range: 0 dB .. 255 dB

Table 7: Device Status Binary Encoding

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 16 of 28
7 DOWNLINK MESSAGES

7 Downlink Messages
7.1 Device Configuration
In the device configuration the non application related behavior can be configured. Changing these parameters will have
an effect on battery life and quality of service.

7.1.1 JSON Structure

{
"switch_mask": {
"enable_confirmed_event_message": <json bool>
},
"communication_max_retries": <json number>,
"unconfirmed_repeat": <json number>,
"periodic_message_random_delay_seconds": <json number>,
"status_message_interval_seconds": <json number>,
"status_message_confirmed_interval": <json number>,
"lora_failure_holdoff_count": <json number>,
"lora_system_recover_count": <json number>,
"lorawan_fsb_mask": [
<json string>,
<json string>,
<json string>,
<json string>,
<json string>
],
"header": {
"message_type": <json string>,
"protocol_version": <json number>
}
}
Listing 7: Device Config JSON Structure

7.1.2 Binary encoding and description

Description Default value Binary encoding Byte


index
message_header uint8 0
As described in Message Header.
switch_mask true uint8 1
booleans to turn features on or off. bitmask
Binary (hex): Bit 0
enable_confirmed_changed_message (0) 0x01 (other bits are unused)
Enable confirmed application event message.
communication_max_retries 3 uint8 2
The maximum number of retries on failing confirmed
messages. Binary (hex):
0x03
Range: 0 .. 254

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 17 of 28
7 DOWNLINK MESSAGES

Description Default value Binary encoding Byte


index
unconfirmed_repeat 2 uint8 3
The number of repeating on unconfirmed messages.
Binary (hex):
Range: 0 .. 5 0x02

periodic_message_random_delay_seconds 60 uint8 4
To avoid clustering and collisions of uplink
transmissions of multiple devices a random delay is Binary (hex):
added to periodic messages (device status message 0x3C
and timer triggered event message).

Range: 0 .. 255 seconds

status_message_interval_seconds 86400 (once uint16 5..6


Interval in seconds at which periodic device status per day) 60 seconds per LSB
messages are sent.
Binary (hex):
Range: 60 .. 604800 seconds (= 7 days) 0xA0
0x05
status_message_confirmed_interval 1 uint8 7
Confirm every n messages, the messages in between
are sent unconfirmed. Default is 1, such that all Binary (hex):
periodic messages are confirmed. 0x01
The number can be increased to require less
downlinks (for reasons of gateway RF duty cycle or
network server costs), but will degrade the quality of
service.

Range: 0 .. 255

DISCLAIMER: Although it is possible to make status


messages always unconfirmed (by setting the value to
0) it is highly recommended to not to use this to avoid
problems when join sessions are invalidated by the
network server (due to network server problems).
lora_failure_holdoff_count 1 uint8 8
In case of persistent network problems (not receiving
acknowledgements on confirmed messages) the Binary (hex):
device tries to recover by a device reboot. This 0x02
parameter configures the number of consecutive failed
confirmed messages needed before it reboots.

Range: 0 .. 255
lora_system_recover_count 1 uint8 9
The number of attempts the LoRa handler is trying to
recover from a system failure (not responsive radio). Binary (hex):
0x01
Range: 0 .. 255

DISCLAIMER: This value should not be changed


for normal use.

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 18 of 28
7 DOWNLINK MESSAGES

Description Default value Binary encoding Byte


index
lorawan_fsb_mask US915 Hybrid: uint16[5] 10..19
Frequency sub-band (FSB) mask for upstream. [Only {"0x00FF",
for US915] "0x0000",
"0x0000",
"0x0000",
"0x0000"}

Binary (hex):
0xFF
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00

EU868:
{“0x0000”,
“0x0000”,
“0x0000”,
“0x0000”,
“0x0000”}

Binary (hex):
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00

device_config_crc See uint16 20..21


CRC of the configuration values above. It is calculated Configuration
by the Encoder. CRC

Table 8: Device Configuration Binary Encoding

7.1.3 Example

The device configuration message is constructed of the 1 byte header, the configuration payload and the 2 byte CRC.
The default configuration is obtained by concatenating the header (0x25) with the default values of config payload and
the calculated CRC.

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 19 of 28
7 DOWNLINK MESSAGES

For the EU868 variant this results in:

Header Config Payload (hex) CRC (hex)


25 01,03,02,3c,a0,05,01,02,01,00,00,00,00,00,00,00,00,00,00 d4,55

Table 9: Example Configuration payload EU868

For the US915 Hybrid variant this results in:

Header Config Payload (hex) CRC (hex)


25 01,03,02,3c,a0,05,01,02,01,ff,00,00,00,00,00,00,00,00,00 c0,82

Table 10: Example Configuration payload US915

The calculation of the CRC is explained in chapter Configuration CRC.

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 20 of 28
7 DOWNLINK MESSAGES

7.2 Application Configuration


7.2.1 JSON Structure

{
"device_type": <json string>,
"temperature_measurement_interval_seconds": <json number>,
"periodic_event_message_interval": <json number>,
"events": [
{
"mode": <json string>,
"threshold_temperature": <json number>,
"measurement_window": <json number>
},
{
"mode": <json string>,
"threshold_temperature": <json number>,
"measurement_window": <json number>
},
{
"mode": <json string>,
"threshold_temperature": <json number>,
"measurement_window": <json number>
},
{
"mode": <json string>,
"threshold_temperature": <json number>,
"measurement_window": <json number>
}
],
"header": {
"message_type": <json string>,
"protocol_version": <json number>
}
}
Listing 8: Application Config JSON Structure

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 21 of 28
7 DOWNLINK MESSAGES

7.2.2 Binary encoding and description

Description Default value Binary encoding Byte


index
message_header uint8 0
As described in Message Header.
device_type "tt" uint8 1
The device type as known in the NEON family. For this "tt" = 4
device the value is: Binary (hex):
0x04
• "tt" (4)

temperature_measurement_interval_seconds 900 (15 uint16 2..3


Interval in seconds, at which the connected minutes)
temperature sensor is read. Changing this value
has an effect on responsiveness and battery life. Binary (hex):
0x84
Range: 1 .. 28800 seconds (8 hours) 0x03

periodic_event_message_interval 16 uint16 4..5


Interval in number of measurements at which the 1 measurement per LSB
application event messages are periodically sent. The Binary (hex):
periodic counter is reset on every event message. The 0x10
periodic counter is reset on every event message. 0x00

Range: 0 .. 28800 measurements

Example setups of periodic event message interval:

• once per 4 hours (default):set


this parameter to 16 (default) and
measurement_interval_seconds to 900 seconds
(15 minutes)
• once per 8 hours: set this parameter to 28800
(max) and measurement_interval_secondsis set
to 1 second
• never: set this parameter to 0

Example setups of periodic event with single


measurement:

• once per 4 hours: set this parameter to 1 and


measurement_interval_seconds to 14400

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 22 of 28
7 DOWNLINK MESSAGES

Description Default value Binary encoding Byte


index
events [ event[4] 6..21
Configuration of four independent events. See ?? {"mode":"off"},
{"mode":"off"},
{"mode":"off"},
{"mode":"off"}
]

Binary (hex):
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00

application_config_crc See uint16 22..23


CRC of the configuration values above. It is calculated Configuration
by the Encoder. CRC

Table 11: Device Configuration Binary Encoding

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 23 of 28
7 DOWNLINK MESSAGES

7.2.3 Binary encoding and description Temperature event config

Description Default value Binary encoding Byte


index
mode "off" "off"=0 0
The operational mode of this event: "above"=1
Binary (hex): "below"=2
• “off” 0x00 "increasing"=3
• “above” "decreasing"=4
• “below”
• “increasing”
• “decreasing”

off mode: Disables condition detection.

above mode: If the maximum temperature


along the measurement_window is above the
temperature_threshold then the condition is true. A
transition of the condition from false to true or true to
false will trigger an event message.

below mode: If the minimum temperature


along the measurement_window is below the
temperature_threshold then the condition is true. A
transition of the condition from false to true or true to
false will trigger an event message.

increasing mode: The condition is true


when the current temperature is at least
temperature_threshold higher than the minimum
temperature in the measurement_window. A
transition of the condition from false to true or true to
false will trigger an event message.
Note that in increasing mode the accepted
configuration for threshold_temperature is only
positive.

decreasing mode: The condition is true


when the current temperature is at least
temperature_threshold lower than the maximum
temperature in the measurement_window. A
transition of the condition from false to true or true to
false will trigger an event message.
Note that in decreasing mode the accepted
configuration for threshold_temperature is only
negative.
threshold_temperature 0 uint16 1..2
The threshold temperature in units of 0.01°C. 0.01°C per LSB
Binary (hex):
Range: -120.00°C .. 120.00°C 0x00
0x00
Only positive in mode increasing.
Only negative in mode decreasing.

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 24 of 28
7 DOWNLINK MESSAGES

Description Default value Binary encoding Byte


index
measurements_window 1 uint8 3
The maximum number of measurements to observe
delta temperature to trigger an event. Binary (hex):
0x00
For mode "off" the default value is 0. For all other
modes:
Range: 1 .. 144 measurements

Table 12: Device Configuration Binary Encoding

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 25 of 28
7 DOWNLINK MESSAGES

7.2.4 Example

The application configuration message is constructed of the 1 byte header, the configuration payload and the 2 byte
CRC. The default configuration is obtained by concatenating the header (0x26) with the default values of config payload
and the calculated CRC, which results in the following byte string:

Header:(hex) Config Payload (hex) CRC (hex)


26 04,84,03,10,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 0b, 4f

Table 13: Example payload Application Configuration

The calculation of the CRC is explained in chapter Configuration CRC.

7.3 Configuration CRC


The config messages contain a CRC to identify different configuration payloads. This CRC is reported back to the
backend via the boot and status messages. The messages are constructed as followed:

Part Size (bytes)


Header 1
Config Payload n
CRC 2

Table 14: Message construction and sizes

The payload length n is fixed per config type. The CRC is calculated over the config payload only, so without the
message header.

7.3.1 CRC Calculation

The two CRC bytes are the inverse of the lower two bytes of a CRC32 calculation. For the CRC32 calculation the CRC-
32/ISO-HDLC is used. This is the default in many protocols and the implementation is widely available in many libraries.
The two CRC bytes in the protocol can be extracted as followed (pseudo code):
crc = default_crc32([config_payload])
inverse_crc = crc ^ 0xFFFFFFFF
crc_byte0 = inverse_crc & 0xFF
crc_byte1 = (inverse_crc >> 8) & 0xFF
Listing 9: CRC Function Pseudo

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 26 of 28
7 DOWNLINK MESSAGES

Python
CRC function in Python.
import binascii
def calc_crc(bs):
crc = binascii.crc32(bs)
return (crc & 0xFFFF) ^ 0xFFFF
Listing 10: CRC Function Python

Javascript
CRC function in Javascript.
// calc_crc inspired by https://github.com/SheetJS/js-crc32
function calc_crc(buf) {
function signed_crc_table() {
var c = 0, table = new Array(256);

for (var n = 0; n != 256; ++n) {


c = n;
c = ((c & 1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
c = ((c & 1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
c = ((c & 1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
c = ((c & 1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
c = ((c & 1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
c = ((c & 1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
c = ((c & 1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
c = ((c & 1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));
table[n] = c;
}

return typeof Int32Array !== ’undefined’ ? new Int32Array(table) :


table;
}
var T = signed_crc_table();

var C = -1, L = buf.length - 3;


var i = 0;
while (i < buf.length) C = (C >>> 8) ^ T[(C ^ buf[i++]) & 0xFF];
return C & 0xFFFF;
}
Listing 11: CRC Function JS

Example using the Javascript CRC function


The calc_crc function can be used as followed (this can be tested using online services like https://jsfiddle.net/):
var configPayload = [0x01, 0x03, 0x02, 0x3c, 0xa0, 0x05, 0x01, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00];
var crc = calc_crc(configPayload);
console.log("Calculated CRC: 0x" + crc.toString(16));
Listing 12: CRC Example JS

This results in "Calculated CRC: 0x55d4", which are encoded as the two CRC bytes (hex): d4,55

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 27 of 28
Revision History

Revision Date Author(s) Description


2.0.0 09-04-2020 ZZ, ML Split combined protocol in VS-QT, VS-MT and TS specific
protocol documents.
Separate downlink to protocol configuration and application
configuration.
2.1.0 15-05-2020 ZZ, ML Updated event configuration.
Corrected ranges and cleanup.
2.1.1 18-05-2020 ML Corrected double entries.
2.2.0 05-06-2020 ZZ Rounded the range of status_message_confirmed_interval.
Removed 500 kHz channel from lorawan_fsb_mask.
Added disclaimer about lorawan_fsb_mask.
2.2.1 01-09-2020 TB Added TT range and resolution.
2.2.2 02-10-2020 TB Corrected device type from 1 to 4
2.2.3 06-10-2020 TB, ML Corrected spelling mistake in the Application configuration.
Added ‘Binary (hex)’ for default values.
Added CRC example.
C 05-03-2021 TB, ML Conversion to LATEX.
Small layout improvements.
Applied new versioning.

6020_P20-002_Communication-Protocol-NEON-Temperature-Transmitter_C 28 of 28

You might also like