A comprehensive collection of LoRaWAN payload decoder functions for Helium Console, with a powerful testing tool to validate decoder functionality.
This repository contains payload decoder functions for various LoRaWAN devices that can be used with Helium Console. Each device directory includes decoder functions that convert raw binary payloads into human-readable JSON objects.
- Navigate to the device directory of interest (e.g.,
Dragino/LHT65/
) - Copy the contents of
decoder.js
- Paste into the custom script window in Helium Console
- Save and test with your device
Use our built-in testing tool to validate decoders before deployment:
# Test with raw payload data
node test-decoder.js Dragino/LHT65 --data "AXQBSwqJAkA2Ffi0Cg///NA="
# Test with JSON uplink file
node test-decoder.js RAK/RAK2171 --file "/path/to/uplink.json"
# Get help
node test-decoder.js --help
# List all available decoders
node test-decoder.js --list
- Node.js 14.0.0 or higher
- Git (for cloning and updates)
# Clone the repository
git clone https://github.com/buoy-fish-tech/console-decoders.git
cd console-decoders
# Make the test script executable
chmod +x test-decoder.js
# Test the installation
node test-decoder.js --help
node test-decoder.js <decoder-name> [--data <payload> | --file <path>] [options]
Option | Description | Example |
---|---|---|
--data <payload> |
Test with raw base64 payload | --data "AXQBSwqJAkA2Ffi0Cg///NA=" |
--file <path> |
Test with JSON uplink file | --file "/path/to/uplink.json" |
--port <number> |
Specify fPort (default: 1) | --port 2 |
--decoder <file> |
Specify decoder file (default: decoder.js) | --decoder "decoder-v1.8.js" |
--verbose, -v |
Show detailed output | -v |
--no-log |
Don't write to log file | --no-log |
--list |
List all available decoders | --list |
--help, -h |
Show help message | --help |
# Basic test with payload data
node test-decoder.js Dragino/LHT65 --data "AXQBSwqJAkA2Ffi0Cg///NA="
# Test with specific port
node test-decoder.js Dragino/LHT65 --data "AXQBSwqJAkA2Ffi0Cg///NA=" --port 2
# Test with JSON file from Helium Console
node test-decoder.js RAK/RAK2171 --file "./sample-uplink.json"
# Verbose output with specific decoder version
node test-decoder.js Dragino/LHT65 --data "AXQBSwqJAkA2Ffi0Cg///NA=" --decoder "decoder-v1.8.js" --verbose
# Test without logging to file
node test-decoder.js Dragino/LHT65 --data "AXQBSwqJAkA2Ffi0Cg///NA=" --no-log
When using --file
, your JSON file should contain a data
field with the base64 payload:
{
"deduplicationId": "f7a12418-5e71-48ea-af27-1b4929642d7f",
"time": "2025-06-10T02:42:28.079+00:00",
"deviceInfo": {
"tenantId": "e1d293fb-6dc5-4214-a23a-94696f17f82f",
"applicationName": "RAK Buoys",
"deviceName": "Deck Tying Eel (3AF5)",
"devEui": "ac1f09fffe183af5"
},
"devAddr": "78000190",
"fPort": 2,
"data": "AXQBSwqJAkA2Ffi0Cg///NA=",
"object": {
"voltage_1": 3.31,
"altitude_10": -8.16,
"gps_10": {
"latitude": 37.76258,
"altitude": -8.16,
"longitude": -122.418673
}
}
}
All test results are automatically logged to decoder-test-results.log
with:
- Timestamp - When the test was executed
- Decoder Information - Which decoder was tested
- Input Details - Payload, fPort, and source information
- Output Results - Decoded payload or error details
- Execution Time - Performance metrics
Recent tests appear at the top of the log file for easy access.
Manufacturer | Devices | Status |
---|---|---|
Abeeway | Various trackers | β Active |
Adeunis | Environmental sensors | β Active |
Browan | TBHV100, TBDW100 | β Active |
COTX | Various devices | β Active |
Digital Matter | Asset trackers | β Active |
Dragino | LHT65, LGT92, LSN50, LSE01, and more | β Active |
Elsys | Environmental sensors | β Active |
IMBuildings | Building sensors | β Active |
KS Technologies | Various sensors | β Active |
Laird | Connectivity solutions | β Active |
MCCI | Environmental sensors | β Active |
RAK | WisBlock, trackers, sensors | β Active |
RadioBridge | Sensors and alerts | β Active |
SEEED | SenseCAP series | β Active |
TekTelic | Various IoT devices | β Active |
Ursalink | Industrial sensors | β Active |
- Create a directory:
manufacturer/device-model/
- Add
decoder.js
with your decoder function - Include a
readme.md
with device specifications - Test with the testing tool
- Submit a pull request
All decoders should follow this standard format:
function Decoder(bytes, port, uplink_info) {
// bytes: Array of integers representing the payload
// port: fPort number (integer)
// uplink_info: Optional uplink metadata object
var decoded = {};
// Your decoding logic here
decoded.temperature = ((bytes[0] << 8) | bytes[1]) / 100;
decoded.humidity = bytes[2];
return decoded;
}
- Function Name: Must be
Decoder
- Parameters:
bytes
(required),port
(required),uplink_info
(optional) - Return Value: JavaScript object with decoded values
- Error Handling: Should handle malformed payloads gracefully
# Test a specific decoder
npm run test Dragino/LHT65 --data "AXQBSwqJAkA2Ffi0Cg///NA="
# List all decoders
npm run list
# Get help
npm run help
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-decoder
) - Add your decoder following the format guidelines
- Test thoroughly using the testing tool
- Commit your changes (
git commit -am 'Add NewDevice decoder'
) - Push to the branch (
git push origin feature/new-decoder
) - Submit a Pull Request
- β Test with multiple payload samples
- β Handle edge cases and errors gracefully
- β Include comprehensive documentation
- β Follow consistent naming conventions
- β Validate with the built-in testing tool
- Byte Order: Most devices use big-endian encoding
- Data Types: Common patterns for temperature, GPS, battery levels
- Bit Manipulation: Use bitwise operations for packed data
- Error Handling: Always validate payload length and content
"Decoder file not found"
- Verify the decoder path is correct
- Ensure the directory contains a
decoder.js
file
"Invalid base64 payload"
- Check that the payload is properly base64 encoded
- Verify the payload length matches expected device format
"No Decoder function found"
- Ensure the decoder file contains a
function Decoder(...)
- Check for syntax errors in the decoder file
- Check the test logs in
decoder-test-results.log
- Use
--verbose
flag for detailed debugging - Consult device documentation for payload format
- Open an issue on GitHub with test results
This project is licensed under the MIT License - see the LICENSE file for details.
- JT - Project maintainer and primary contributor
- Community - Various decoder contributions and improvements
- GitHub Issues: Bug reports and feature requests
- Pull Requests: Code contributions welcome
- Documentation: Help improve guides and examples
Made with β€οΈ for the LoRaWAN and Helium communities
π‘ Tip: Start with
node test-decoder.js --list
to explore available decoders, then test with your device payloads using--data
or--file
options!