TTS/TTN decoder#

About#

Receive and decode telemetry data from devices on the The Things Stack (TTS) / The Things Network (TTN).

The Things Network logo

Configuration#

Getting the system configured properly is important, please read this section carefully.

The Things Network Console#

First, you will need to use The Things Network Console at https://console.cloud.thethings.network/, in order to configure an outbound Webhook.

The Things Network Console Webhook configuration

The Things Network Console Webhook configuration#

Please configure the following settings:

  • Webhook ID: An arbitrary label identifying the Webhook.

  • Webhook format: Choose JSON here.

  • Base URL: Like outlined at the HTTP documentation section, this setting will obtain the full URL to the data acquisition channel, modulo the /data suffix, which will be added per “Enabled event types” configuration option.

  • Filter event data: If you want to filter the submitted telemetry payload, and only submit the nested decoded_payload data structure, you can use a path accessor expression like up.uplink_message.decoded_payload.

  • Enabled event types: For the event type Uplink message, add the URL path suffix /data.

Example#

This would be a corresponding set of example default values:

Webhook ID:             expert-bassoon
Webhook format:         JSON
Base URL:               https://daq.example.org/api/mqttkit-1/testdrive/area-42/node-1
Filter event data:      up.uplink_message.decoded_payload
Enabled event types:    /data

Example#

Now, JSON data payloads submitted from the TTN infrastructure to your system, like this example, will be decoded by Kotori transparently.

{
  "uplink_message": {
    "decoded_payload": {
      "temperature_1": 53.3,
      "voltage_4": 3.3
    }
  }
}

Todo

Provide an example how a corresponding message can be submitted to TTN from the terminal, in order to emulate the real scenario, but demonstrate the telemetry data acquisition works well, almost end-to-end. In the meanwhile, submit an example JSON message payload to Kotori’s HTTP API directly:

http https://github.com/daq-tools/kotori/raw/main/doc/source/handbook/decoders/tts-ttn-uplink.json \
    | http POST https://daq.example.org/api/mqttkit-1/testdrive/area-42/node-1/data