Connect The Things Stack to Humly Sensor Gateway
If your LoRaWAN sensors use The Things Stack, you connect it to Humly Sensor Gateway (HSG) with a webhook. This covers The Things Network and The Things Industries.
In this article
- Before you start
- Make HSG reachable
- Step 1: Create a webhook token in HSG
- Step 2: Add the webhook
- Step 3: Check that data arrives
Before you start
- HSG is set up and paired. See Humly Sensor Gateway - First-time setup.
- You can edit the application in The Things Stack console.
- Each device has a payload formatter that decodes its data.
Make HSG reachable
The Things Stack runs in the cloud. It sends the webhook from the internet, so HSG must be reachable from outside your network.
- Publish only the webhook path,
/lora/uplink, through a reverse proxy or firewall rule. - Use HTTPS with a certificate from a public certificate authority.
- Do not expose the HSG dashboard to the internet.
If sensor data must stay in your network, use an on-site network server such as ChirpStack instead. See Connect ChirpStack to Humly Sensor Gateway.
Step 1: Create a webhook token in HSG
- In the HSG dashboard, go to Settings.
- Under LNS webhook tokens, click + Create LNS token.
- Name it, for example
the-things-stack, and click Create. - Copy the Bearer token. HSG shows it only once.
Step 2: Add the webhook
- Open your application and go to Integrations > Webhooks.
- Click + Add webhook and choose Custom webhook.
- Enter a Webhook ID, for example
humly-hsg. - Set Webhook format to JSON.
- Set Base URL to the public HTTPS address of HSG, for example
https://hsg.example.com. - Under Additional headers, add
Authorizationwith the valueBearer <token>. - Under Enabled event types, tick Uplink message and set its path to
/lora/uplink. Leave the other event types off. - Click Add webhook.
Step 3: Check that data arrives
- Wait for the sensors' next uplink.
- In HSG, go to Sensors. The sensors appear as Pending, with the source TTN.
- Click Confirm on each sensor you want in Humly, and give it a name.
If nothing arrives, open the webhook in The Things Stack console. A failed webhook shows an error there. HTTP 401 means the token is wrong.
Humly Sensor Gateway guide
Get started
- Humly Sensor Gateway - Overview
- Humly Sensor Gateway - Use cases
- Humly Sensor Gateway - Requirements
Install and set up
- Install Humly Sensor Gateway on Windows
- Install Humly Sensor Gateway on Linux
- Humly Sensor Gateway - First-time setup
Connect sensors
- Connect LoRaWAN sensors to Humly Sensor Gateway
- Connect ChirpStack to Humly Sensor Gateway
- Connect The Things Stack to Humly Sensor Gateway
- Connect MQTT sensors to Humly Sensor Gateway
Manage and troubleshoot