-
Notifications
You must be signed in to change notification settings - Fork 0
Installing
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.
-
docker-compose.yml: the docker-compose file containing the services -
configuration/lora*: directory containing the LoRa Server configuration files, see: -
configuration/postgresql/initdb/: directory containing PostgreSQL initialization scripts
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
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.
Add plugins to Grafana in docker-compose.yml under GF_INSTALL_PLUGINS. here's available plugins: https://grafana.com/plugins
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
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
}
},
Before using this docker-compose.yml file, make sure you have Docker
installed.
In order to secure the stack following passwords need to be changed before running dokcer-compose up:
-
postgresPostgreSQL user here:docker-compose.yml -
iotPostgreSQL user here:configuration/postgresql/initdb/004-init-iot-db.sh - Grafana readonly PostgreSQL user here:
configuration/postgresql/initdb/004-init-iot-db.sh - Grafana
adminuser:docker-compose.yml - Node-RED enable admin auth:
data/nodered/settings.js(Currently needs to be done afterdocker-compose upand entailsdocker restart nodered)
TODO:
- HTTPS
- Default Node-RED auth
When configuration and security steps are done start all the LoRaWAN stack components by simply running:
$ docker-compose upNote: 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.