This repository contains device-profiles for LoRaWAN devices grouped by vendor. A device-profile contains important information about the capabilities of the device. For example which LoRaWAN mac-version has been implemented, which regions are supported, if the device supports Class-B or Class-C, etc... The aim is to build a complete list of LoRaWAN device-profiles that then can be imported by ChirpStack or potentially any other LNS.
Unfortuantely the https://github.com/thethingsnetwork/lorawan-devices repository can no longer be used as a whole. The open-source license has been removed and users are not allowed to extract and/or reuse the Device Repositoryas as a whole or a substantial part of its content. This prevents ChirpStack users (and other LNS providers) from importing this repository into their database.
The goal of this repository is to provide an open-source database of LoRaWAN device-profiles that can be freely imported.
Example structure for an example-vendor
with an example
device:
vendors/
└── example-vendor
├── codecs
│ ├── example.js
│ ├── test_decode_example.json
│ └── test_encode_example.json
├── devices
│ └── example.toml
├── profiles
│ └── example-EU868.toml
└── vendor.toml
Please take a look at the vendors/example-vendor
example documented
configuration files.
This is the root of the example vendor. It must contain a vendor.toml
file. This vendor.toml
.
This directory contains the payload codecs. Codecs can be used by one or multiple devices. E.g. some vendors have a generic payload codec.
Each codec is expected to have tests for encoding and decoding. If the
codec filename is example.js
, then you should create two test-files
called test_decode_example.json
(thus + test_decode_
prefix and .json
extension) and test_encode_example.json
.
This directory contains the devices. Each device will have its own .toml
configuration.
This directory contains the profiles. These profiles can be used by one or multiple devices. The profile also defines the region.
In summary, these are the steps to create a new device-profile.
-
Add a new vendor directory in
vendors/
. This directory should be lower-cased, and spaces must be replaced by-
. For example for My Vendor you would create a directoryvendors/my-vendor/
. -
Create
vendor.toml
file. Inside the directory created in the previous step, create avendor.toml
file (e.g.vendors/my-vendor/vendor.toml
). Please usevendors/example-vendor/vendor.toml
as an example. Underdevices
you want to refer to the devices (that you will add in the next steps). If you have a temperature and a humidity sensor device (thus two devices), yourdevices
configuration could look like:devices = ["temperature.toml", "humidity.toml"]
-
Create device file(s). In this step you need to create a file for each device that you configured in the previous step under
devices
. To continue with the previous example, you would create two files:vendors/my-vendor/devices/temperature.toml
vendors/my-vendor/devices/humidity.toml
You can usevendors/example-vendor/devices/example.toml
as an example. For each firmware version (if there are multiple), make sure to also configure theprofiles
andcodec
options (if you provide a payload) codec. For example yourtemperature.toml
device configuration could containprofiles= ["temperature-eu868.toml", "temperature-us915.toml"]
andcodec = "temperature.js"
if there a a codec for this device.
-
Create profile file(s). In this step you need to create a file for each profile that you configured in the previous step for your device(s). To continue with the previous example, you would create:
vendors/my-vendor/profiles/temperature-eu868.toml
vendors/my-vendor/profiles/temperature-us915.toml
You can usevendors/example-vendor/profiles/example-EU868.toml
as an example.
-
Create codec file(s). If you have configured any
codec
options, you must create these codec files. To continue with the previous example, you would create a file namedvendors/my-vendor/codecs/temperature.js
. You can usevendors/example-vendor/codecs/example.js
as an example. -
Add codec tests (optional). To validate that the codec returns the expected output given a certain input you can add tests to your codecs. To continue with the previous example, you would create two files:
vendors/my-vendor/codecs/test_decode_temperature.json
vendors/my-vendor/codecs/test_encode_temperature.json
Please seetest_decode_example.json
andtest_encode_example.json
in thevendors/example-vendor/codecs
directory.
-
Run tests. This validates that the above configuration can be parsed correctly and that the codec return the expected output.
To run the test-runner, execute:
make test
This will run all tests within a Docker Compose environment.
This repository is distributed under the MIT license. See also LICENSE
.