Skip to content

Installing

Anders Barfod edited this page Feb 18, 2019 · 2 revisions

LoRaWAN stack Docker setup

This repository contains a skeleton setting up the LoRa Server, PostgreSQL, Node-RED and Grafana project using docker-compose.

Note: Please use this docker-compose.yml file as a starting point for testing but keep in mind that for production usage it might need modifications.

Directory layout

Persistent storage

Docker volumes are used for persistent storage of data from the different apps and are defined in docker-compose.yml

  • postgresql-data: volume containing the PostgreSQL data
  • redis-data: volume containing the Redis data
  • grafana-data: volume containing the Grafana data
  • nodered-data: volume containing the Node-RED data

Configuration

LoRa Server

The LoRa Server components are pre-configured to work with the provided docker-compose.yml file and defaults to the EU868 LoRaWAN band. Please refer to the configuration/loraserver/loraserver.toml configuration file to configure a different band.

Grafana

Add plugins to Grafana in docker-compose.yml under GF_INSTALL_PLUGINS. here's available plugins: https://grafana.com/plugins

PostgreSQL

The DB needs a bit of tuning to increase performance which is automatically done by timescaledb-tune here: configuration/postgresql/initdb/005-postgresql-tuning.sh

Node-RED

It is recommended to use Node-RED to manage your flow files. In order to activate Projects you have to enable them in the settings.json. Since data from the Node-RED container is a Docker Volume, we can locate the file by using docker volume inspect lorawan-stack_nodered-data and look for the Mountpoint. Go to the mountpoint folder and enable projects by editting the settings.json

   editorTheme: {
       projects: {
           enabled: true
       }
   },

Requirements

Before using this docker-compose.yml file, make sure you have Docker installed.

Security

In order to secure the stack following passwords need to be changed before running dokcer-compose up:

  • postgres PostgreSQL user here: docker-compose.yml
  • iot PostgreSQL user here: configuration/postgresql/initdb/004-init-iot-db.sh
  • Grafana readonly PostgreSQL user here: configuration/postgresql/initdb/004-init-iot-db.sh
  • Grafana admin user: docker-compose.yml
  • Node-RED enable admin auth: data/nodered/settings.js (Currently needs to be done after docker-compose up and entails docker restart nodered)

TODO:

  • HTTPS
  • Default Node-RED auth

Usage

When configuration and security steps are done start all the LoRaWAN stack components by simply running:

$ docker-compose up

Note: during the startup of services, it is normal to see the following errors:

  • ping database error, will retry in 2s: dial tcp 172.20.0.4:5432: connect: connection refused
  • ping database error, will retry in 2s: pq: the database system is starting up

After all the components have been initialized and started, you should be able to open http://localhost:8080/ (LoRa Server), http://localhost:3000/ (Grafana) and http://localhost:1880/ (Node-RED) in your browser.

Clone this wiki locally