LoRaWAN Custom Decoder
The LoRaWAN Custom Device Decoder allows you to write your own decoder function to process incoming LoRaWAN uplink messages.
Last updated
The LoRaWAN Custom Device Decoder allows you to write your own decoder function to process incoming LoRaWAN uplink messages.
Last updated
The LoRaWAN Custom Device Decoder allows you to write your own decoder function to process incoming LoRaWAN uplink messages.
This provides flexibility to handle custom payload formats that are not available as pre-built templates.
If a is enabled, data will be processed before storage. The decoder applies first, and then any defined transformation function modifies the data before it is stored in Qubitro.
JavaScript payload formatters allow you to write functions to encode or decode messages. These functions are executed using a JavaScript ECMAScript 5.1 runtime.
Avoid non-trivial logic or polyfills; they may not be supported.
Use arithmetic operations and bit shifts to convert binary data into readable fields.
Keep payload formatters simple and lightweight.
Need help reviewing your custom formatter? Our team can assist in checking your code for compatibility. Reach out via the .
A decoder function processes raw uplink messages and returns a JSON object containing the decoded fields.
The function name and parameter name cannot be modified.
The decoder function has a single parameter: input. Qubitro automatically provides this parameter, which contains three properties:
Metadata: A dynamic object containing metadata from the LNS provider (e.g., RSSI, SNR, timestamp). The structure varies depending on the provider.
fPort: The LoRaWAN fPort used for the uplink.
Bytes: A byte array representing the raw payload from the uplink message.
To ensure compatibility with Qubitro’s no-code suite, the output should be a key-value JSON object.
For example, if the payload represents temperature, the function can extract and return it as follows:
Select the Function Type
Open the device details page in the Qubitro Portal.
Click the Functions tab.
Click Create function and select Decoder Function.
Choose LoRaWAN Custom Device as the formatter type.
Write the Decoder Code
Enter your custom decoder function in the editor.
Modify the formatter code to match your device’s payload.
Save and Apply the Function
Click Save and complete to apply the decoder function.
The function will now process all incoming data for this device automatically.
If you need assistance, our team can review your custom formatter code. Open a from the Support Page.
Absolutely! If your device does not appear after setting up the integration, open a , and our team will assist you in troubleshooting the issue.
While Qubitro provides flexibility for writing custom decoders, our team can review your formatter code to ensure compatibility and suggest improvements. Feel free to reach out via the .