ChirpStack Integration
ChirpStack is an open-source LoRaWAN network server. ChirpStack Integration receives the uplink messages ChirpStack forwards over HTTP, decodes them on the Edge, and lets you process and visualize LoRaWAN device data locally, with low latency and without a permanent connection to the server.
Prerequisites
Section titled “Prerequisites”- A ThingsBoard server with tenant administrator access. The templates are created there.
- A ThingsBoard Edge instance connected to the server.
- A ChirpStack network server, installed with Docker Compose or on Debian/Ubuntu, that can reach the Edge over HTTP.
- A LoRaWAN device connected to ChirpStack. See Connect a device in the ChirpStack docs.
Create converter template
Section titled “Create converter template”The uplink converter decodes the ChirpStack payload into ThingsBoard telemetry and attributes. It is created on the server.
-
On the server, go to Edge management > Templates and open the Converter tab. Click Add data converter and select Create new converter.
-
Set Converter type to Uplink, select ChirpStack as the Integration type, and enter the name
ChirpStack uplink converter. -
Decide how to get the decoder:
- Create new: write or paste your own decoder (next steps).
- Library: select a Vendor and a device Model. ThingsBoard fills in a ready-made decoder for that device.
-
In Main decoding configuration, keep Entity type at Device and set Device name, for example
Chirp Device $eui. The$euiplaceholder is replaced by the device EUI from the ChirpStack payload, so the test device in this guide becomesChirp Device 24e124538b223213. -
Select TBEL or JS and paste the decoder script into the
function payloadDecoder(payload, metadata)editor.payloadis the raw LoRaWAN payload (the base64-decodeddatafield) as a byte array.metadataholds the other ChirpStack fields, such aseui,deviceName,rssi,snr, andts(the message time in milliseconds). The example decodes a payload with battery, PIR, and daylight channels.// payload - raw LoRaWAN payload as bytes (the base64-decoded "data" field)// metadata - the other ChirpStack fields, for example eui, deviceName, rssi, snr, tsfunction decodePayload(input) {var result = { attributes: {}, telemetry: {} };var values = { HEX_bytes: bytesToHex(input) };var i = 0;while (i + 1 < input.length) {var channelId = input[i++];var channelType = input[i++];if (channelId == 0x01 && channelType == 0x75) {values.battery = input[i++];} else if (channelId == 0x03 && channelType == 0x00) {values.pir = input[i++] == 0 ? "normal" : "trigger";} else if (channelId == 0x04 && channelType == 0x00) {values.daylight = input[i++] == 0 ? "dark" : "light";} else {break;}}result.telemetry = { ts: metadata.ts, values: values };return result;}var result = decodePayload(payload);return result;// payload - raw LoRaWAN payload as bytes (the base64-decoded "data" field)// metadata - the other ChirpStack fields, for example eui, deviceName, rssi, snr, tsfunction decodePayload(input) {var result = { attributes: {}, telemetry: {} };var values = { HEX_bytes: bytesToHex(input) };var i = 0;while (i + 1 < input.length) {var channelId = input[i++];var channelType = input[i++];if (channelId == 0x01 && channelType == 0x75) {values.battery = input[i++];} else if (channelId == 0x03 && channelType == 0x00) {values.pir = input[i++] == 0 ? "normal" : "trigger";} else if (channelId == 0x04 && channelType == 0x00) {values.daylight = input[i++] == 0 ? "dark" : "light";} else {break;}}result.telemetry = { ts: metadata.ts, values: values };return result;}function bytesToHex(bytes) {var hex = '';for (var j = 0; j < bytes.length; j++) {hex += ('0' + (bytes[j] & 0xFF).toString(16)).slice(-2);}return hex;}var result = decodePayload(payload);return result; -
Optionally expand Advanced decoding parameters. Device profile name, Device label, Customer name, and Device group name accept the same
$-placeholders as the device name. The Telemetry and Attributes lists choose which keys of the ChirpStack payload are saved. Update only keys list saves a key only when its value changed. -
Click Add.
Create integration template
Section titled “Create integration template”-
On the server, go to Edge management > Templates, open the Integration tab, and click Add integration.
-
On the Basic settings step, select ChirpStack as the Integration type. Keep the name
ChirpStack integrationor enter your own. Click Next. -
On the Uplink data converter step, select Select existing, choose
ChirpStack uplink converter, and click Next. -
On the Downlink data converter step, keep Skip selected and click Skip. This guide does not send downlinks.
-
On the Connection step, fill in the fields:
Field Value Base URL The URL of the Edge, for example http://10.7.3.0:8080. The default is the server URL, so replace it.HTTP endpoint URL Built from the Base URL. Copy it; ChirpStack posts the uplinks to this URL. Use API for ChirpStack 4+ Keep enabled for ChirpStack v4. Allow downlink Keep disabled. Enable it only if you want to send downlinks; it unlocks Application server URL (the ChirpStack REST API, for example http://chirpstack-server-ip:8090) and Application server API Token (an API key from Tenant > API Keys in the ChirpStack UI). -
Click Add.
Assign the integration to the Edge
Section titled “Assign the integration to the Edge”-
On the server, go to Edge management > Edges and click the Edge. On the Details tab, click Manage integrations.
-
Click Assign to edge (+), select
ChirpStack integration, and click Assign. -
Log in to the Edge and go to Integrations > Integrations. The ChirpStack integration is listed there. Open it to copy the HTTP endpoint URL if you have not done so yet.
Configure the ChirpStack application
Section titled “Configure the ChirpStack application”Log in to the ChirpStack UI at http://chirpstack-server-ip:8080. The default user name and password are admin / admin.
Add a device profile
Section titled “Add a device profile”-
Go to Tenant > Device Profiles and click Add device profile.
-
On the General tab, fill in the required fields:
Field Description Name Device profile name Region LoRaWAN regional parameters MAC Version LoRaWAN MAC version the device uses Regional parameters revision Parameter set version for your region ADR Algorithm Adaptive data rate logic Expect uplink interval (secs) Expected interval between uplink messages -
Click Submit.
Add the HTTP integration
Section titled “Add the HTTP integration”-
Go to Tenant > Applications, click Add application, enter a name, and click Submit.
-
Open the Integrations tab of the application. Find HTTP in the list and click +.
-
Keep Payload encoding at JSON. Paste the HTTP endpoint URL of the ThingsBoard integration into Event endpoint URL(s) and click Submit.
Add the device
Section titled “Add the device”-
Open the Devices tab of the application and click Add device.
-
On the Device tab, fill in the required fields:
Field Description Name Device name Device EUI (EUI64) Unique 64-bit identifier of the LoRaWAN device Byte order Byte order of the DevEUI (MSB or LSB) Device profile The device profile created above -
Click Submit.
Add the gateway (optional)
Section titled “Add the gateway (optional)”For a test setup you can skip this. To add a gateway, go to Tenant > Gateways, click Add gateway, fill in Name, Gateway ID (EUI64), and Stats interval (secs), and click Submit.
Send an uplink message
Section titled “Send an uplink message”In production, ChirpStack forwards every uplink of the device to the integration. For a test, use the ChirpStack device simulator, or post a message in the ChirpStack format to the integration endpoint yourself:
curl -v -X POST -d '{ "deduplicationId": "7658d04d-7f1c-4eb6-900b-d948f3061a9d", "time": "2025-06-13T12:44:52.653+00:00", "deviceInfo": { "tenantId": "6e073e9a-6b4f-4747-b22c-7507568debfb", "tenantName": "ChirpStack", "applicationId": "c3f2c4aa-07c8-4d6c-8a86-7ea2d4a31dca", "applicationName": "Sample Application", "deviceProfileId": "d8ee6c09-414c-4b2e-888a-8e8f86e3187a", "deviceProfileName": "Default device profile", "deviceName": "chirp device", "devEui": "24e124538b223213", "deviceClassEnabled": "CLASS_A", "tags": {} }, "devAddr": "01a44c4c", "adr": true, "dr": 5, "fCnt": 153, "fPort": 84, "confirmed": false, "data": "AXU9AwABBAAB", "rxInfo": [{ "gatewayId": "e4e124dadef64eee", "uplinkId": 25127, "gwTime": "2025-06-13T12:44:52.653481+00:00", "nsTime": "2025-06-13T12:44:52.670509207+00:00", "timeSinceGpsEpoch": "1433853910.653s", "rssi": -68, "snr": 13.2, "channel": 4, "location": {}, "context": "Hw9+zQ==", "crcStatus": "CRC_OK" }], "txInfo": { "frequency": 867300000, "modulation": { "lora": { "bandwidth": 125000, "spreadingFactor": 7, "codeRate": "CR_4_5" } } }, "regionConfigId": "eu868"}' $YOUR_HTTP_ENDPOINT_URL -H "Content-Type:application/json"Replace these values with your own:
| Value | Description |
|---|---|
deduplicationId |
Any UUID v4 |
tenantId |
Your ChirpStack tenant ID |
applicationId, applicationName |
ChirpStack application ID and name |
deviceProfileId, deviceProfileName |
ChirpStack device profile ID and name |
devEui |
Device EUI of the ChirpStack device |
gatewayId |
ChirpStack gateway ID |
$YOUR_HTTP_ENDPOINT_URL |
HTTP endpoint URL of the ThingsBoard integration |
Then check the result on the Edge:
-
Go to Integrations > Integrations, open the ChirpStack integration, and select the Events tab. An Uplink event with status OK appears. Click the three dots in the Message column to see the raw payload.
-
The device Chirp Device 24e124538b223213 is created automatically (
$euiis replaced by thedevEuiof the payload). Go to Devices & assets > Devices, open it, and select the Latest telemetry tab. The test payload decodes tobattery61,pirtrigger, anddaylightlight. The keys from the Telemetry list, such asrssiandsnr, are saved as well. -
To see how the converter processed the message, go to Integrations > Data converters, open
ChirpStack uplink converter, and select the Events tab. The In column shows the raw payload, the Out column the decoded telemetry and attributes.
Was this helpful?