Decode raw LoRaWAN uplink bytes from a cold-chain temperature sensor into structured data using a The Things Stack payload formatter

domain: thethingsindustries.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Register your LoRaWAN temperature sensor as an end device in a The Things Stack (Community Edition) application
  2. Write a JavaScript decodeUplink(input) function that reads input.bytes and input.fPort and returns { data: {...}, warnings: [...] }
  3. Add an optional normalizeUplink(input) function to map your decoder's output into the standard normalized schema, e.g. air.temperature in Celsius
  4. Set the formatter via the Console (Application > Payload Formatters, or per-device), the CLI (ttn-lw-cli applications link set ... --default-formatters.up-formatter FORMATTER_JAVASCRIPT), or the REST API (PUT /api/v3/as/applications/{application_id}/link)
  5. Confirm decoded output appears in the uplink message's decoded_payload field alongside the raw frm_payload when the device sends data
  6. If your device model exists in the Device Repository, use FORMATTER_DEVICEREPO instead of writing a custom decoder

Known gotchas

Related routes

Set up a LoRaWAN payload formatter on The Things Stack to decode uplink bytes
the-things-stack · 6 steps · unrated
Configure an HTTP webhook integration in The Things Stack to receive LoRaWAN uplink messages
iot · 6 steps · unrated
Receive LoRaWAN uplink messages from The Things Stack (TTN) via its MQTT server
thethingsindustries.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans