From 1c80fd9399857f5138d00dce0c466bbf72e10202 Mon Sep 17 00:00:00 2001 From: Orne Brocaar Date: Tue, 4 Jun 2019 09:03:54 +0200 Subject: [PATCH] Configuration files for Basic Station + US915 config. --- README.md | 1 - .../lora-app-server/lora-app-server.toml | 3 + .../lora-gateway-bridge.toml | 19 +++++++ configuration/loraserver/loraserver.toml | 33 ++--------- .../initdb/004-loraserver_as_hstore.sh | 6 ++ docker-compose-env.yml | 55 ------------------- docker-compose.yml | 2 +- 7 files changed, 34 insertions(+), 85 deletions(-) create mode 100644 configuration/postgresql/initdb/004-loraserver_as_hstore.sh delete mode 100644 docker-compose-env.yml diff --git a/README.md b/README.md index 3db5f99..bf1c105 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,6 @@ but keep in mind that for production usage it might need modifications. ## Directory layout * `docker-compose.yml`: the docker-compose file containing the services -* `docker-compose-env.yml`: alternate docker-compose file using environment variables, can be run with the docker-compose `-f` flag * `configuration/lora*`: directory containing the LoRa Server configuration files, see: * https://www.loraserver.io/lora-gateway-bridge/install/config/ * https://www.loraserver.io/loraserver/install/config/ diff --git a/configuration/lora-app-server/lora-app-server.toml b/configuration/lora-app-server/lora-app-server.toml index 7a18539..d670c46 100644 --- a/configuration/lora-app-server/lora-app-server.toml +++ b/configuration/lora-app-server/lora-app-server.toml @@ -15,4 +15,7 @@ public_host="appserver:8001" [application_server.external_api] bind="0.0.0.0:8080" + +# JWT secret used for api authentication / authorization +# You could generate this by executing 'openssl rand -base64 32' for example jwt_secret="verysecret" diff --git a/configuration/lora-gateway-bridge/lora-gateway-bridge.toml b/configuration/lora-gateway-bridge/lora-gateway-bridge.toml index b94818e..0308298 100644 --- a/configuration/lora-gateway-bridge/lora-gateway-bridge.toml +++ b/configuration/lora-gateway-bridge/lora-gateway-bridge.toml @@ -1,6 +1,25 @@ # See https://www.loraserver.io/lora-gateway-bridge/install/config/ for a full # configuration example and documentation. +[backend] +type="basic_station" + + [backend.basic_station] + bind=":3001" + read_timeout="1h" + region="US915" + frequency_min=902000000 + frequency_max=928000000 + + [backend.basic_station.filters] + net_ids=[ + "000000", + ] + + join_euis=[ + ["0000000000000000", "ffffffffffffffff"], + ] + [integration.mqtt.auth.generic] server="tcp://mosquitto:1883" username="" diff --git a/configuration/loraserver/loraserver.toml b/configuration/loraserver/loraserver.toml index ea1bb37..02027ef 100644 --- a/configuration/loraserver/loraserver.toml +++ b/configuration/loraserver/loraserver.toml @@ -1,7 +1,7 @@ # See https://www.loraserver.io/loraserver/install/config/ for a full # configuration example and documentation. # -# This file is for the EU868 band. See the examples/ folder for more +# This file is for the US915 band (channels 0-7). See the examples/ folder for more # configuration examples. [postgresql] @@ -14,34 +14,10 @@ url="redis://redis:6379" net_id="000000" [network_server.band] -name="EU_863_870" +name="US_902_928" -[network_server.network_settings] - - [[network_server.network_settings.extra_channels]] - frequency=867100000 - min_dr=0 - max_dr=5 - - [[network_server.network_settings.extra_channels]] - frequency=867300000 - min_dr=0 - max_dr=5 - - [[network_server.network_settings.extra_channels]] - frequency=867500000 - min_dr=0 - max_dr=5 - - [[network_server.network_settings.extra_channels]] - frequency=867700000 - min_dr=0 - max_dr=5 - - [[network_server.network_settings.extra_channels]] - frequency=867900000 - min_dr=0 - max_dr=5 + [network_server.network_settings] + enabled_uplink_channels=[0, 1, 2, 3, 4, 5, 6, 7] [network_server.gateway.backend.mqtt] server="tcp://mosquitto:1883" @@ -51,3 +27,4 @@ server="http://appserver:8003" [geolocation_server] server="geoserver:8005" + diff --git a/configuration/postgresql/initdb/004-loraserver_as_hstore.sh b/configuration/postgresql/initdb/004-loraserver_as_hstore.sh new file mode 100644 index 0000000..810a1a4 --- /dev/null +++ b/configuration/postgresql/initdb/004-loraserver_as_hstore.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e + +psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname="loraserver_as" <<-EOSQL + create extension hstore; +EOSQL diff --git a/docker-compose-env.yml b/docker-compose-env.yml deleted file mode 100644 index 84ba6eb..0000000 --- a/docker-compose-env.yml +++ /dev/null @@ -1,55 +0,0 @@ -version: "3" - -services: - loraserver: - image: loraserver/loraserver:3 - environment: - - POSTGRESQL.DSN=postgres://loraserver_ns:loraserver_ns@postgresql/loraserver_ns?sslmode=disable - - REDIS.URL=redis://redis:6379 - - NETWORK_SERVER.BAND.NAME=EU_863_870 - - NETWORK_SERVER.GATEWAY.BACKEND.MQTT.SERVER=tcp://mosquitto:1883 - - JOIN_SERVER.DEFAULT.SERVER=http://appserver:8003 - - GEOLOCATION_SERVER.SERVER=geoserver:8005 - - appserver: - image: loraserver/lora-app-server:3 - ports: - - 8080:8080 - environment: - - POSTGRESQL.DSN=postgres://loraserver_as:loraserver_as@postgresql/loraserver_as?sslmode=disable - - REDIS.URL=redis://redis:6379 - - APPLICATION_SERVER.INTEGRATION.MQTT.SERVER=tcp://mosquitto:1883 - - APPLICATION_SERVER.API.PUBLIC_HOST=appserver:8001 - - APPLICATION_SERVER.EXTERNAL_API.JWT_SECRET=verysecret - - gatewaybridge: - image: loraserver/lora-gateway-bridge:3 - ports: - - 1700:1700/udp - environment: - - INTEGRATION.MQTT.AUTH.GENERIC.SERVER=tcp://mosquitto:1883 - - geoserver: - image: loraserver/lora-geo-server:3 - environment: - - GEO_SERVER.BACKEND.NAME=collos - - postgresql: - image: postgres:9.6-alpine - volumes: - - ./configuration/postgresql/initdb:/docker-entrypoint-initdb.d - - postgresqldata:/var/lib/postgresql/data - - redis: - image: redis:5-alpine - volumes: - - redisdata:/data - - mosquitto: - image: eclipse-mosquitto - ports: - - 1883:1883 - -volumes: - postgresqldata: - redisdata: diff --git a/docker-compose.yml b/docker-compose.yml index 825c475..40a6f3b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,7 @@ services: gatewaybridge: image: loraserver/lora-gateway-bridge:3 ports: - - 1700:1700/udp + - 3001:3001/tcp volumes: - ./configuration/lora-gateway-bridge:/etc/lora-gateway-bridge