- build gateways into docker images?
- Chirpstack LoRaWAN Server (Dockerised)
- LoRaWAN Gateway (Optional)
Automated LoRaWAN Server and Gateway installation.
Dockerised server Chirpstack-Docker
Server and Gateway can be installed separately
- SX1302 gateway Lora-net sx1302
- PicoCell gateway Lora-net PicoCell
- Rak gateway rak_common_for_gateway
Note:
- if installting both gateway and server it is recommended to install gateway first as it will be automatically added to the server afterwards.
- Postgres and Redis latest have errors on arm so this requires manually built docker images of older versions.
export LORAWAN_VERSION=x.x.x
where x.x.x
= version number (i.e. export LORAWAN_VERSION=2.2.1
)
wget https://github.com/NubeIO/lorawan-complete/archive/refs/tags/v$LORAWAN_VERSION.zip && wget https://github.com/NubeIO/lorawan-complete/releases/download/v$LORAWAN_VERSION/docker-builds.zip && unzip v$LORAWAN_VERSION.zip && unzip docker-builds.zip -d lorawan-complete-$LORAWAN_VERSION/docker-build && sudo rm docker-builds.zip && cd lorawan-complete-$LORAWAN_VERSION/
sudo bash install-gateway-sx1302.sh -h
OR
sudo bash install-gateway-pico.sh -h
OR
sudo bash install-gateway-rak2247.sh -h
-h
for help
- download the redis and postgres local docker images and copy them to the docker-build/ folder (
postgres-local.tar
&redis-local.tar
) - install with command:
(this will take a few minutes to complete)
sudo bash install-server.sh -h
-h
for help
(can be ran while it's running)
sudo bash uninstall-gateway.sh
or
sudo bash uninstall-server.sh
application/<app_ID>/device/<device_EUI>/event/up
application/+/device/<device_EUI>/event/up
- Check your device EUI is correct.
- Check the Application ID is correct. Go to the web app and check what number is next to the application
Server service
- Start:
sudo service lorawan-server start
- Stop:
sudo service lorawan-server stop
Gateway service
- Start:
sudo service lorawan-gateway start
- Stop:
sudo service lorawan-gateway stop
Start: sudo ./start.sh
Stop: sudo ./stop.sh
A small application to run and decode just the gateway.
Useful for site and sensor testing
docker build --file gateway-decoder/Dockerfile --tag lorawan_gateway_test .
or
bash gateway-decoder-docker-build.sh
docker run -it --rm --name lwan_gw_test --device /dev/ttyACM0 lorawan_gateway_test
-
cd gateway-decoder && npm install && cd ../
- [Optional] Install gateway:
sudo bash install-gateway-<sx1302/pico/rak2247>.sh -s
bash gateway-decode.sh
-h
for options. Can use -j
to print only unformatted JSON and pipe output to file or use in some display format
THIS WAS RELEVENT BEFORE CHIRPSTACK PROVIDED DOCKER IMAGES FOR ARM
Since Chirpstack-Docker currently doesn't support arm, the docker images must be built manually.
This must be done on a seperate system as the build process is too large for an RPi.
chirpstack-docker-build.sh handles this process (run from inside the docker-build/ directory).
This pulls the required chirpstack service repos and performs the docker build with currently experimental build features.
3 .tar
files will be produced and should stay in the docker-build/ directory to be installed on the target
- chirpstack-network-server
- chirpstack-application-server
- chirpstack-gateway-bridge
Build process will take several minutes to complete, potentially over 30 minutes
- Docker v19.03 or higher
- git
Can be tweaked inside chirpstack-docker-build.sh
from qemu-user-static
BUILD_ARCH="arm32v7"
|BUILD_ARCH="arm64v7"
BUILD_OS="debian"
from buildx
BUILD_PLATFORM="linux/arm/v7"
|BUILD_PLATFORM="linux/arm64/v7"
install.sh BUILD_ARCH=
needs to match the above BUILD_ARCH
TODO: slightly out of date.
docker-build/
: folder to build and contain docker imagesconfiguration/chirpstack*
: directory containing the ChirpStack configuration files, see:configuration/postgresql/initdb/
: directory containing PostgreSQL initialization scriptssystemd/
: systemd service files for startup (gets edited by install script to change absolute paths)docker-compose.yml
: the docker-compose file containing the services (edited to utilise local chirpstack images)docker-compose-env.yml
: alternate docker-compose file using environment variables, can be run with the docker-compose-f
flag (edited to utilise local chirpstack images)install.sh
: install script for target (RPi). Installs all dependencies toouninstall.sh
: uninstall script for target (RPi). Removes startup service, all Chirpstack application data and docker containers/imagesstart.sh
: starts gateway and server. Used by startup servicestop.sh
: stops gateway and server. Used by startup servicechirpstack-app-init.py
: initialises Chirpstack application data. Takes 1 argument to set the gateway EUIchirpstack-app-wipe.py
: wipes all Chirpstack application data (including devices)chirpstack-app-device-profiles.py
: adds device profiles located in init data directory. filenames can be provided for specifics or none to add allinit_data/init_data.TEMPLATE.json
: example json file to add devices at install time. (copy to init_data.json and edit to use) (Not used anymore. Potentially removing completely)init_data/resources/
: folders and files containing reusable init data