LoRaWAN Device Driver

Installation

The LoRaWAN Driver can be deployed by adding the "App - ECP LoRaWAN Driver" to your Space from the Marketplace.

There are a number of available override parameters. In practice only the lora.gatewayID needs to be set. If left blank one will be auto-generated.

Device Profiles can be auto generated upon startup by setting the override parameters as described on the next page, called "Device Profiles".

Introduction

The LoRaWAN device driver acts as bridge between the Chirpstack Application Server and the Edge Compute Platform where the LoRa frames are translated into Web-of-Things (WoT) messages and vice versa.

Overview:
  • gRPC for application server API
  • subscribe to mosquitto topics for LoRa frames
  • configure as WoT, set properties, run actions, etc.
  • standard driver interaction with ECP

Initialization

The driver does the following:
  • set up a default organization (edge-compute-platform) (using gRPC)
  • set up a default network server (ecp-network-server, server URL for LoRa Server Stack network server) (using gRPC)
  • set up a default service profile (ecp-service-profile) (using gRPC)
  • set up a default application (ecp-application) (using gRPC)
  • set up a default gateway (ecp-gateway) (using gRPC)
  • (optional) set up placeholders for device profiles (using gRPC)

All of this can be fully managed using the API endpoints for the device driver.

API Endpoints

Available "/drivers/lorawan/{keyword}" API endpoints that use the Chirpstack API format for:
  • organizations (CRUD, using gRPC)
  • network-servers (CRUD, using gRPC)
  • service-profiles (CRUD, using gRPC)
  • applications (CRUD, using gRPC)
  • gateways (CRUD, using gRPC)
  • device-profiles (CRUD, using gRPC)
  • devices (CRUD, using gRPC)

This allows for setting up the gateway, device profiles, and devices. The API endpoints are documented on ECP API Documentation. (Only devices are modelled using WoT Thing Descriptions and are available as Things throughout the Altair IoT Studio system.)

The complete Chirpstack API can be used via the proxy endpoint: /drivers/lorawan/proxy/application-server/{chirpstack-endpoint}

The proxied API runs REST requests to the application server of the LoRa stack (extra overhead compared to gRPC).

Device Commissioning

The LoRaWAN specification allows for two types of activation: Over-the-Air Activation (OTAA) (preferred) and Activation by Personalization (ABP).

Code has been added to allow setting device keys and device (de)activation for OTAA and ABP devices respectively. This works by requesting actions on the devices (WoT Thing descriptions). See the respective Thing description pages for both OTAA and ABP setup.

Telemetry

The driver subscribes to the LoRA Server Stack mosquitto broker to receive telemetry data and publishes it into the ECP stack as raw telemetry after necessary decryption and/or payload conversion (see page on conversion templates). This allows for publishing to the cloud using the existing mechanisms.