Hex Payload Decoder

The Hex Payload Decoder allows you to convert incoming hex string payloads into valid JSON data

Overview

The Hex Payload Decoder allows you to convert incoming hex string payloads into valid JSON data for non-LoRaWAN data sources.

The Hex Payload Decoder is only applicable for non-LoRaWAN data sources, such as MQTT, HTTP, or Onomondo. LoRaWAN devices use Device Templates or Custom Decoder for decoding.

How It Works

Tips

  • Avoid unnecessary logic or external dependencies that could slow down execution.

  • Use arithmetic operations and bit shifts to convert hex values into readable fields.

  • Keep payload formatters simple and lightweight.

Required Input Format

Data must be published as JSON with the following structure:

{ "payload_hex": "hex_value" }

Function Schema

A decoder function processes incoming hex payloads and returns a structured JSON object.

Function Parameters

The decoder function receives a single parameter: input, which contains:

  • bytes → A byte array representing the raw payload received.

Return Values

Example

1

Incoming payload

2

Formatter code

3

Decoded payload

Creating a Custom Decoder Function

1

Select the Function Type

  1. Open the device details page in the Qubitro Portal.

  2. Click the Functions tab.

  3. Click Create Function and select Decoder Function.

  4. Choose Hex Payload Decoder as the formatter type.

2

Write the Decoder Code

  1. Enter your custom decoder function in the editor.

  2. Adjust the function to match your device’s payload format.

3

Save and Apply the Function

  1. Click Save to apply the decoder function.

Last updated