LoRaWAN – Moving Data from Device to Dashboard

A LoRaWAN Trip Report for Austin IoT - Dec 23, 2020

LoRaWAN (a network architecture and protocol) is a type of low-power wide-area-network (LPWAN). LPWANs are used for low-power and low-data applications. In the US, LoRaWAN uses the ISM Band centered at 915 MHz (902-928 MHz). Battery-powered end-nodes can be deployed 1+ kilometers from the nearest RF gateway.

Kris Thompson (Austin Voice Data) will provide a “Trip Report” on his journey into the mechanics of LoRaWAN data acquisition, transmission, storage, and publishing using LoRaWAN.

  • LoRaWAN System Components packed on this trip:
    • LoRaWAN End-nodes – AdaFruit Feather, Tektelic HomeSensor
    • LoRaWAN RF Gateways – Tektelic, Raspberry Pi
    • LoRaWAN Network Server – EveryNet
    • LoRaWAN Application Server – AeXonis CemTore

  • Open-source Software used for Data Retention and Analysis
    • Publish data to a public MQTT broker
    • Deploy private Node-RED and InfluxDB using Docker-compose
    • RF performance inspection using python, mathplotlib, Django

This trip report is intended to be lightweight and practical in nature. We will touch on a number of subjects in a hop-scotch fashion and entertain questions and discussion to support a collaborative approach to knowledge sharing.

Kris Thompson is a licensed professional engineer (Ontario) and Cisco CCIE #1226. Kris is focused on operational support systems and knowledge engineering and has supported numerous business of all sizes and form factors (state agencies, startups, resellers, MSP). Kris thrives on practical and ethnographic (field emersion) methods, applied to systems application engineering and physical computing . He is experienced with cloud deployments, private and public and all the bits in-between. When not engineering communications systems and fixing computer problems, he enjoys exploring nature, building construction and repair, and the quest to understand humans. 

LoRaWAN – A Low-bandwidth, Low-Power, Data Delivery Service

e.g. Elf Workshops wants to objects in remote working environments, using battery-operated sensors. LoRaWAN is chosen to provide distance and battery advantage. Trade-off: data uplinks are small, and downlinks are very limited.

By the use of analog sensors, and small data reports, we hope to “make better” things. This report is focussed on data delivery over LoRaWAN.

The Path of the Packet

Data packages are being shipped;
from remote sensor locations, to consumers.

Let’s review the “path of the packet” of the LoRaWAN data and frame:

  • End-node (Micro Controller Unit / MCU) reads analogs sensors and encodes data as byte-packed info
  • End-node periodically sends sensor data (limited by Duty Cycle and Time-on-Air limitations) as LoRaWAN Uplinks
  • Local LoRaWAN gateways hear (receive) the Radio Frequency (RF) transmission and forward the packet to the Network Server
  • Network Servers validate and de-duplicate LoRaWAN frames, and forward data payloads to the Application Server
  • Application Servers decrypt and forward data to Applications for decoding, storage, and analysis

Prepare for the LoRaWAN Data Trip

There is a long journey for the LoRaWAN transmitted data to make, from sensor to storage. Various aspects in each stage in the trip can drastically affect the outcome  (success of data package delivery.) 

Prepare for the LoRaWAN Data Trip

Select End-nodes:

  • what are you sensors
  • alpha, beta, production?
  • indoor/outdoor, temp range,
  • antenna, battery
  • Elf Workshops selected:
    • RadioFruit – AdaFruit Feather with LoRa with LoRaWAN-MAC-in-C (LMIC) libraries

 

Document Radio Frequency Plan:

  • select eight (8) channelsl, typically from a single radio frequency (RF) sub-band of US915
    see LoRaWAN Regional Parameters (frequently)
  • define coverage areas, obstructions, mobility
  • document TX power (dBm) and RSSI sensitivity for RF gateway and end-nodes

LoRaWAN Infrastructure: Out-source or In-source 

  • LoRaWAN is designed to easily enable outsourcing of infrastructure – network server and application server use distinct encryption keys
    • Elf Workshops use Aexonis CemTore
    • popular options are The Things Network (TTN) and ChirpStack (open-source, self-hosted)
    • many LoRaWAN equipment vendors can also provide the network and application servers, e.g. Tektelic
  • a provider can supply gateways (radio access network), Network Server, Application servers, and sometimes data hosting

Plan for Data Collection, Storage, Analysis

  • a LorRaWAN application server will post the (raw or decoded) payload data to a consumer defined location such as MongoDB or MQTT
  • Elf Workshops uses Node-RED to collect data posted to a public MQTT Broker, e.g. HiveMQ
  • storage of data is best in a Time Series Database (TSDB) such as InfluxDB
  •  Elf Workshops is building a Django (aka Python on Rails) application to monitor package delivery data

 

Elf Workshops 2020 – Data Package Delivery Plan:

  • Pack sensor data into Frames at LoRaWAN End-nodes
    • RadioFruit – AdaFruit Feather with LoRa
    • Tektelic HomeSensors
  • RF Gateways – with internet backhaul (Ethenet, WiFi, LTE)
    • Tektelic Micro (indoor)
    • RAK2287 on RPi 3B+
    • Gemtek Femto
  • LoRaWAN Infrastructure (Network Server, Application Server)
    • AeXonis CemTore
    • alternates: TTN/ChirpStack
  • Collect data packages from MQTT by HiveMQ (public, free, best-effort)
  • Store data packages in TSDB (Time Series Database) using InfluxDB
  • Data Analysis by Python Custom Application
    • presented via HTTP by Django and MatPlotLib