Skip to content

LoRaWAN payload decoders

OpenCollar Edge devices send binary payloads on numbered FPorts. A JavaScript decoder turns them into JSON on the network server. There is one decoder family for all Edge devices; it lives in the firmware repository as scripts/ttn_decoder.js and is released with every firmware version as ttn_decoder-vX.js.

  • LoRaWAN payload decoders current


    The JavaScript decoder that turns LoRaWAN uplinks into JSON. It ships with every firmware release as ttn_decoder-vX.js and is installed on the LoRaWAN network server (TTN, ChirpStack, ThingPark).

    Platform: lorawan-server. Firmware: one decoder file per firmware release.

    Open · source

Get the decoder

  • Firmware 7.3.0 and later: download ttn_decoder-vX.js from the firmware release that matches the device firmware.
  • Older firmware: files.smartparks.org/edge/decoder has TTN, ChirpStack v3 and ChirpStack v4 flavours up to 6.15.1, and the legacy toolset repository has ChirpStack v4 decoders for 4.4.3, 6.1.2 and 6.5.0.

v8.0.1 published 2026-09-24 — release page

Asset Size
ttn_decoder-v8.0.1.js 18 kB

Install it

The file defines Decoder(bytes, port). Wrap it for the v3 payload formatter:

function decodeUplink(input) {
  return { data: Decoder(input.bytes, input.fPort) };
}

Same wrapper as TTN v3, or use the CSv4_* files from the file server, which already contain decodeUplink(input).

Use the chirpstack-v3 files from the file server, which define Decode(fPort, bytes, variables).

Which version for which firmware

Device firmware Decoder file Notes
8.0.x, 7.1.0 to 7.3.0 ttn_decoder-v7.2.0.js / ttn_decoder-v8.0.x.js Adds FPort 21 (air quality); drops FPorts 8 and 17
6.15.0 to 6.16.3 ttn_decoder-v6.15.1.js Adds FPorts 18, 19, 20
6.9.0 to 6.14.3 ttn_decoder-v6.11.2.js 15-byte CMDQ records
6.1 to 6.8 CSv4_Decoder_OpenCollar_Edge_v6.5.0.js 13-byte CMDQ records
4.x CSv4_Decoder_OpenCollar_Edge_v4.4.3.js No CMDQ
First generation (pre-Edge) d_opencollar_*.js in the toolset Different protocol

The uplink layouts are backward compatible within these ranges; a newer decoder decodes older firmware for all ports it knows.