Device profiles¶
A device profile describes a kind of device: its region, LoRaWAN version and how to decode its payload. Every device uses exactly one profile, and many devices can share it. Make one profile per device model (and region), not one per device.
Naming
Name profiles after the model and region, e.g. Dragino LDDS75 EU868. You will thank yourself once you have a few hundred devices.
Create a profile¶
In the native UI, Device profiles → Add. The device's datasheet or manufacturer has the values you need.
| Field | Value |
|---|---|
| Region | EU868 / region configuration eu868, or US915 / us915_1 |
| MAC version | The LoRaWAN version of the device, e.g. 1.0.3 |
| Regional parameters revision | As specified by the manufacturer, e.g. A or RP002-1.0.3 |
| Supports OTAA | On for almost all devices (OTAA joins); off only for ABP |
| Expected uplink interval | How often the device reports; used to show it as inactive |
Leave the other settings at their defaults unless the manufacturer says otherwise.
Warning
The profile's region must match the gateways that hear the device. A US915 device needs gateways on sub-band 2.
Payload codec¶
Devices send compact bytes, not JSON. A codec turns them into readable values that show up in your events as object. On the profile's Codec tab choose JavaScript functions and paste the codec for your device; most manufacturers publish one for ChirpStack v4.
// Uplink: bytes in, values out
function decodeUplink(input) {
// input.bytes, input.fPort, input.variables
return { data: { temperature: ((input.bytes[0] << 8) | input.bytes[1]) / 100 } };
}
// Downlink (optional): values in, bytes out
function encodeDownlink(input) {
return { bytes: [input.data.interval] };
}
The codec is part of the profile, so it also comes with your export.
Next: add the device.