How do I encode a General Configuration Downlink message?

How do I encode a General Configuration Downlink message?

A downlink message is one that is sent to the sensor from the cloud and is used to configure the sensor itself. 
Messages cannot be initiated from the cloud since the sensor is typically sleeping and the radio is turned off, so the sensor itself must initiate a downlink message. 
The supervisory, reset, and tamper-open (not tamper close) messages all request a downlink message as a response, and the response must be received within 30 seconds of the request.

There are two types of downlink messages which apply to all sensor types: General Configuration and Rate Limit Configuration.

NOTE:  All downlinks must contain a total of (8) bytes, padded with zeros at the end when necessary.

General Configuration Message: 0x01 
      Byte            Description      
      0                 Disable Sensor Events (Events Enabled = 0x00,  Events Disabled = 0x01)
      1                  Radio Configuration * (Normal Operation = 0x00, Adaptive Data Rate = 0x01)
      2                 Supervisory period (default = 19 hours)

      * Adaptive Data Rate applies to LoRaWAN only and is available in firmware v1.4 and above.

Supervisory Period Configuration: 
      Bit 7            Bits 6:0
      0                  Period defined in hours (1-127 hours)
      1           Period defined in minutes (1-127 minutes)
      Note that prior to firmware version 1.3, only hourly reporting is available. 
      The firmware version can be found in the reset message and is logged on the Radio Bridge console.


The Rate Limit is the number of messages allowed between supervisory messages.
This is a protection mechanism to ensure the sensors do not flood the wireless network with messages.

Rate Limit Configuration Message: 0xFC
      Byte            Description      
      0                 Maximum Messages Between Supervisory Messages (disabled = 0x00, default = 100 = 0x64)


General Configuration Downlink Example:

      01 00 00 30 00 00 00 00

      01            Downlink Message Type (General Configuration = 0x01)
      00           Events Enabled (Disabling Off = 0x00)
      00           Adaptive Data Rate (Disabled = 0x00)
      30           Supervisory Period (48 hours = 0x30)
      00....      Zero padding to make up 8 bytes.

Rate Limit Configuration Downlink Example:

      FC C8 00 00 00 00 00 00

      FC          Downlink Message Type (Rate Limit Configuration = 0xFC)
      C8          Max Number of Messages Between Supervisory Messages (200 = 0xC8)
      00....      Zero padding to make up 8 bytes.


If the configuration is successful the sensor will respond with a Downlink Acknowledge uplink message:

      1 0 FF 02

      1                    Protocol Version (currently always 0x1)
      0                   Packet Counter, increments by 1 each message and wraps from 0xF to 0x0
      FF                 Message Type (Downlink ACK = 0xFF)
      02                 Downlink Message Valid (Invalid/Undefined = 0x01, Valid = 0x02)

See Also:

    • Related Articles

    • How do I encode a Configuration Downlink for an Air Temperature and Humidity Sensor?

      A downlink message is one that is sent to the sensor from the cloud and is used to configure the sensor itself. Messages cannot be initiated from the cloud since the sensor is typically sleeping and the radio is turned off, so the sensor itself must ...
    • What is the procedure for sending downlink messages to sensors?

      The recommended way to send a downlink is to use the RadioBridge Console API which uses a simple POST request.  From there you can use the uplink and downlink APIs described in the RadioBridge API Documentation.  To access the API section of the ...
    • Decoding battery information from the supervisory message

      The RadioBridge Sensors use a 3V battery which measures about 3.2 volts when freshly installed. Once the battery depletes to 2.5V the sensor will cease to function. The Supervisory Message periodically sent from the sensor uses the last byte to ...
    • How do I decode a sensor's Supervisory Message?

      The wireless sensors will send a periodic supervisory message so that a backend system can verify that the device is still alive and to report error conditions.  The supervisory message also contains a payload that contains the status (current) of ...
    • Can I enable a sensor to receive downlinks at any time?

      A downlink message is one that is sent to the sensor from the cloud and is used to configure the sensor itself.  For Class A devices, messages cannot be initiated from the cloud since the sensor is typically sleeping and the radio is turned off, so ...