Private LoRaWAN: ChirpStack setup

For LoRaWAN Network Server we prefer ChirpStack solution. It is open-source easy2deploy application. Installation procedure was tested on OnLogic industry computer with Ubuntu Server installation. Make sure you have successfully installed Ubuntu Server and computer is accessible via SSH - need to enable openssh-server during installation. Connecting to Ubuntu server via SSH is the same as connection to Raspberry.

Install ChirpStack dependencies

Step 1: Install mosquito with clients

sudo apt install mosquitto mosquitto-clients

Step 2: Install Redis server

sudo apt install redis-server

Step 3: Install PostgreSQL database

sudo apt install postgresql

Setup PostgreSQL

Step 1: Login into PostgreSQL database shell

sudo -u postgres psql

In following steps, stay in PostgreSQL shell.

Step 2: Create ChirpStack application server role

create role chirpstack_as with login password 'dbpassword';

Instead of dbpassword choose your secured password!

Step 3: Create ChirpStack network server role

create role chirpstack_ns with login password 'dbpassword';

Instead of dbpassword choose your secured password!

Step 4: Create database for application server

create database chirpstack_as with owner chirpstack_as;

Step 5: Create database for network server

create database chirpstack_ns with owner chirpstack_ns;

Step 6: Change database

\c chirpstack_as

Step 7: Enable pg_trgm extension

create extension pg_trgm;

Step 8: Enable hstore extension

create extension hstore;

Step 9: Exit PostgreSQL

\q

Add ChirpStack repository

Step 1: Install repository dependencies

sudo apt install apt-transport-https dirmngr

Step 2: Setup repository key

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1CE2AFD36DBCCA00

Step 3: Add repository to system list

sudo echo "deb https://artifacts.chirpstack.io/packages/3.x/deb stable main" | sudo tee /etc/apt/sources.list.d/chirpstack.list

Step 4: Update cache

sudo apt update

Install ChirpStack Gateway bridge

Step 1: Install ChirpStack Gateway bridge

sudo apt install chirpstack-gateway-bridge

Step 2: Start ChirpStack Gateway Bridge service

sudo systemctl start chirpstack-gateway-bridge

Step 3: Enable ChirpStack Gateway Bridge service

sudo systemctl enable chirpstack-gateway-bridge

Chirpstack Gateway Bridge service has it's own configuration file located in /etc/chirpstack-gateway-bridge/chirpstack-gateway-bridge.toml. Configuration options are well configured on ChirpStack website.

Install ChirpStack Network Server

Step 1: Install ChirpStack Network Server

sudo apt install chirpstack-network-server

Step 2: Start ChirpStack Network Server

sudo systemctl start chirpstack-network-server

Step 3: Enable ChirpStack Network Server

sudo systemctl enable chirpstack-network-server

Step 4: Edit ChirpStack Network Server configuration file

Change postgresql part in configuration, just replace dbpassword to your password from Setup PostgreSQL chapter.

/etc/chirpstack-network-server/chirpstack-network-server.toml
[postgresql]
dsn="postgres://chirpstack_ns:dbpassword@localhost/chirpstack_ns?sslmode=disable"

Chirpstack Gateway Bridge service has it's own configuration file located in /etc/chirpstack-network-server/chirpstack-network-server.toml. Configuration options are well configured on ChirpStack website.

For different bands is needed to change configuration attributes. ChirpStack has examples on GitHub.

Install ChirpStack Application server

Step 1: Install ChirpStack Application Server

sudo apt install chirpstack-application-server

Step 2: Start ChirpStack Application Server

sudo systemctl start chirpstack-application-server

Step 3: Enable ChirpStack Application Server

sudo systemctl enable chirpstack-application-server

Step 4: Edit ChirpStack Application Server configuration file

Change postgresql part in configuration - replace dbpassword to your password from Setup PostgreSQL chapter and instead of verysecret generate your own key for example by following command:

openssl rand -base64 32
/etc/chirpstack-application-server/chirpstack-application-server.toml
[general]
log_level=4
[postgresql]
dsn="postgres://chirpstack_as:dbpassword@localhost/chirpstack_as?sslmode=disable"
[application_server.external_api]
jwt_secret="verysecret"

Reboot system

sudo reboot

After rebooting system, you should be able to access <IP ADDRESS>:8080 in web browser. Default login is admin for both username and password.