Blog/LoRa

LoRa9 June 20265 minutes

Decoding the LoRa payload: TTN template, decoder and test tools

The radio link works, the gateway receives, the network server shows packets – and nobody can say how many kilowatt hours they contain. This is the most common stumbling block in LoRa projects, and it has nothing to do with radio.

Key points

  • The payload is tightly packed and not human-readable – a decoder is essential.
  • In TTN, the EMU Professional II LoRa is available as a template, decoder included.
  • For other network servers, the decoder is publicly available on GitHub.
  • The payload generator lets you test the chain before a single meter is installed.

Why the payload is not readable

LoRa packets are small, and the duty cycle makes every byte expensive. So readings are packed tightly: no field names, no separators, no units. A meter reading is an integer spread over several bytes, with an implicitly agreed factor.

What arrives at the network server is therefore a block of bytes. To turn it into “active energy import, tariff 1” with a number and a unit, you need a payload decoder: a small piece of code that splits the bytes according to the documented structure.

Where projects get stuck

Writing such a decoder takes an hour. The problem comes afterwards: it is not documented, not versioned, and when new firmware extends the payload format, nobody remembers why there was a shift at byte 7.

That is why the question “is there an official decoder?” matters more in device selection than it sounds – certainly more than two extra dB of reception.

The Things Network: a template instead of manual work

In The Things Network, the EMU Professional II LoRa is available directly as a template. Create the device, select the template, enter the keys – the decoder is part of the template.

For the most common case, the issue disappears completely. Readings arrive with names, and further processing can build on them directly.

Other network servers: decoder on GitHub

If you run a different network server, you can get the decoder publicly on GitHub under emuag/professional_II_lora. There are also two tools that run in the browser:

  • Payload Decoder – paste a received packet and check what it contains
  • Payload Generator – create test packets without a meter transmitting

All links are on the LoRa page.

Test before anyone climbs a ladder

The payload generator allows an order of work that saves a lot of trouble: first build the whole chain from the network server through processing to the target system and check it with test packets – then install the meters.

This moves troubleshooting from the basement to the desk. If something does not arrive later, the cause is clearly on the radio link, because the processing chain has already been shown to work.

The radio terms – spreading factor, duty cycle, OTAA – are explained in LoRa or LoRaWAN.

Frequently asked questions


Is there a ready-made TTN template for the EMU Professional II?

Yes. In The Things Network, the EMU Professional II LoRa is available directly as a template. Create the device, select the template, enter the keys – the payload decoder is included.

How do I integrate the meter with a different network server?

With the decoder that is publicly available on GitHub under emuag/professional_II_lora. There is also a payload decoder and a payload generator as web tools.

Can I test the processing before any meters are installed?

Yes, with the payload generator. It creates test packets that let you check the whole chain from the network server to the target system – before the first meter is mounted.

Read more


SEITELoRa interfaceInterface TXTLoRa or LoRaWAN? Two terms, clearly separatedBlog post SEITEEMU Professional IIProduct

Questions about your project?


Send us your meter list and the target system. We will tell you what works together – and what does not.

Phone
+41 (0)41 545 03 00

Technical support
helpdesk [at] emuag.ch
Support form →