Giter Club home page Giter Club logo

chirpstack-docker's Introduction

ChirpStack Docker example

This repository contains a skeleton to setup the ChirpStack open-source LoRaWAN Network Server (v4) 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

  • docker-compose.yml: the docker-compose file containing the services
  • configuration/chirpstack: directory containing the ChirpStack configuration files
  • configuration/chirpstack-gateway-bridge: directory containing the ChirpStack Gateway Bridge configuration
  • configuration/mosquitto: directory containing the Mosquitto (MQTT broker) configuration
  • configuration/postgresql/initdb/: directory containing PostgreSQL initialization scripts

Configuration

This setup is pre-configured for all regions. You can either connect a ChirpStack Gateway Bridge instance (v3.14.0+) to the MQTT broker (port 1883) or connect a Semtech UDP Packet Forwarder. Please note that:

  • You must prefix the MQTT topic with the region. Please see the region configuration files in the configuration/chirpstack for a list of topic prefixes (e.g. eu868, us915_0, au915_0, as923_2, ...).
  • The protobuf marshaler is configured.

This setup also comes with two instances of the ChirpStack Gateway Bridge. One is configured to handle the Semtech UDP Packet Forwarder data (port 1700), the other is configured to handle the Basics Station protocol (port 3001). Both instances are by default configured for EU868 (using the eu868 MQTT topic prefix).

Reconfigure regions

ChirpStack has at least one configuration of each region enabled. You will find the list of enabled_regions in configuration/chirpstack/chirpstack.toml. Each entry in enabled_regions refers to the id that can be found in the region_XXX.toml file. This region_XXX.toml also contains a topic_prefix configuration which you need to configure the ChirpStack Gateway Bridge UDP instance (see below).

ChirpStack Gateway Bridge (UDP)

Within the docker-compose.yml file, you must replace the eu868 prefix in the INTEGRATION__..._TOPIC_TEMPLATE configuration with the MQTT topic_prefix of the region you would like to use (e.g. us915_0, au915_0, in865, ...).

ChirpStack Gateway Bridge (Basics Station)

Within the docker-compose.yml file, you must update the configuration file that the ChirpStack Gateway Bridge instance must used. The default is chirpstack-gateway-bridge-basicstation-eu868.toml. For available configuration files, please see the configuration/chirpstack-gateway-bridge directory.

Data persistence

PostgreSQL and Redis data is persisted in Docker volumes, see the docker-compose.yml volumes definition.

Requirements

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

Importing device repository

To import the lorawan-devices repository (optional step), run the following command:

make import-lorawan-devices

This will clone the lorawan-devices repository and execute the import command of ChirpStack. Please note that for this step you need to have the make command installed.

Note: an older snapshot of the lorawan-devices repository is cloned as the latest revision no longer contains a LICENSE file.

Usage

To start the ChirpStack simply run:

$ docker-compose up

After all the components have been initialized and started, you should be able to open http://localhost:8080/ in your browser.

The example includes the ChirpStack REST API. You should be able to access the UI by opening http://localhost:8090 in your browser.

Note: It is recommended to use the gRPC interface over the REST interface.

chirpstack-docker's People

Contributors

adarshmammen avatar avillacis avatar bconway avatar brocaar avatar dloftus98 avatar ginterp avatar julienbaert avatar niiiibl avatar pululuk avatar skrajewski avatar sophiekovalevsky avatar tinkotvas avatar trivialkettle avatar unclesamswiss avatar wasalm avatar ysoyipek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chirpstack-docker's Issues

Fails on aarch64 "exec format error"

~/l/loraserver-docker> sudo docker-compose up | grep "exec format error"
Starting loraserver-docker_postgresql_1    ... done
Starting loraserver-docker_appserver_1     ... done
Starting loraserver-docker_loraserver_1    ... done
Starting loraserver-docker_geoserver_1     ... done
Starting loraserver-docker_redis_1         ... done
Starting loraserver-docker_mosquitto_1     ... done
Starting loraserver-docker_gatewaybridge_1 ... done
loraserver_1     | standard_init_linux.go:207: exec user process caused "exec format error"
appserver_1      | standard_init_linux.go:207: exec user process caused "exec format error"
geoserver_1      | standard_init_linux.go:207: exec user process caused "exec format error"
gatewaybridge_1  | standard_init_linux.go:207: exec user process caused "exec format error"

Pycom

How to connect pycom-gateway to the chirpstack network server (py-script)

chirpstack-gateway-bridge 3226e542433e (Cant find mqtt broker)

gateway bridge not connecting in latest version.

I double checked my configs and even hard coded the gateway bridge mqtt settings and it always tried to connect to localhost:1883 no matter what I set this to ( it should be going to my container as set in settings tcp://mosquitto:1883 for my server). I was pulling hairs trying to get this to work - I ended up dropping back to version 4.0.3 and it connected and worked straight away with exisiting config.

all other services connect fine, just errors with gateway bridge component.

errors with latest gateway-bridge image 3226e542433e

chirpstack-gateway-bridge          | time="2023-01-27T18:16:39.262411168+11:00" level=info msg="starting ChirpStack Gateway Bridge" docs="https://www.chirpstack.io/gateway-bridge/" version=
chirpstack-gateway-bridge          | time="2023-01-27T18:16:39.264080671+11:00" level=info msg="backend/semtechudp: starting gateway udp listener" addr="0.0.0.0:1700"
chirpstack-gateway-bridge          | time="2023-01-27T18:16:39.264853945+11:00" level=error msg="[client]   dial tcp 127.0.0.1:1883: connect: connection refused" module=mqtt
chirpstack-gateway-bridge          | time="2023-01-27T18:16:39.264865505+11:00" level=warning msg="[client]   failed to connect to broker, trying next" module=mqtt
chirpstack-gateway-bridge          | time="2023-01-27T18:16:39.264877316+11:00" level=error msg="[client]   Failed to connect to a broker" module=mqtt
chirpstack-gateway-bridge          | time="2023-01-27T18:16:39.264887116+11:00" level=error msg="integration/mqtt: connection error" error="network Error : dial tcp 127.0.0.1:1883: connect: connection refused"

Screenshot 2023-01-27 at 18 45 20

same config on v4.0.3 - seems to connect fine.

chirpstack-gateway-bridge          | time="2023-01-27T18:32:38.342638139+11:00" level=info msg="starting ChirpStack Gateway Bridge" docs="https://www.chirpstack.io/gateway-bridge/" version=
chirpstack-gateway-bridge          | time="2023-01-27T18:32:38.342738961+11:00" level=info msg="backend/semtechudp: starting gateway udp listener" addr="0.0.0.0:1700"
chirpstack-gateway-bridge          | time="2023-01-27T18:32:38.348002337+11:00" level=warning msg="[store]    memorystore wiped" module=mqtt
chirpstack-gateway-bridge          | time="2023-01-27T18:32:38.348151912+11:00" level=info msg="integration/mqtt: connected to mqtt broker"
chirpstack-gateway-bridge          | time="2023-01-27T18:32:38.649648149+11:00" level=info msg="integration/mqtt: subscribing to topic" qos=0 topic="au915_1/gateway/b827ebfffec9b93e/command/#"
chirpstack-gateway-bridge          | time="2023-01-27T18:32:38.649938978+11:00" level=warning msg="[store]    memorystore del: message 1 not found" module=mqtt
chirpstack-gateway-bridge          | time="2023-01-27T18:32:38.650358492+11:00" level=info msg="integration/mqtt: publishing state" gateway_id=b827ebfffec9b93e qos=0 state=conn topic=au915_1/gateway/b827ebfffec9b93e/state/conn
- - - -
chirpstack-gateway-bridge          | time="2023-01-27T18:35:57.444655082+11:00" level=info msg="integration/mqtt: publishing event" event=up qos=0 topic=au915_1/gateway/60c5a8fffe76fXXXXevent/up uplink_id=21187
chirpstack-gateway-bridge          | time="2023-01-27T18:35:57.447436063+11:00" level=info msg="integration/mqtt: publishing event" event=up qos=0 topic=au915_1/gateway/dca632fffe6aXXXX/event/up uplink_id=16644

Screenshot 2023-01-27 at 18 51 40

all SubConns are in TransientFailure

When I go to lora-app-server web UI I get Error:all SubConns are in TransientFailure and In my docker compose logs I have following warning:

grpc: addrConn.createTransport failed to connect {localhost:8080 0 <nil>} ...

chirpstack-gateway-bridge environment variables

Is is possible to build the official docker chirpstack-gateway-bridge image with ability to pass in environment variables?
At the moment I have to hard card the mqtt username/password into the config file, it would be handy if something like below would work.

environment:
      - MQTT_USERNAME=${MQTT_USER}
      - MQTT_PASSWORD=${MQTT_PASS}

Whereas with the ChirpStack container I am able to pass in my own environment variables, which is very handy for config settings in the toml files, example bellow.

environment:
      - MQTT_BROKER_HOST=mosquitto
      - MQTT_USERNAME=${MQTT_USER}
      - MQTT_PASSWORD=${MQTT_PASS}
      - REDIS_HOST=${REDIS_HOST}
      - POSTGRESQL_HOST=${POSTGRESQL_HOST}
      - CHIRPSTACK_SECRET=${CHIRPSTACK_SECRET}

Doesn't work with the last version of mosquitto

docker-compose.yml file worked perfectly until 10 days ago. The lastest version of mosquitto container leads now to this error :
Error: Address not available : (eclipse/mosquitto#2040) .

I had to use go back to eclipse-mosquitto:1.5 to make it work.

mosquitto:
image: eclipse-mosquitto:1.5
ports:
- 1883:1883

ERROR: no matching manifest for linux/arm/v7 in the manifest list entries

Hi when installing the docker image on a rpi2 the rest api is failing to start with the error

chirpstack-docker $ docker-compose up
Pulling chirpstack-rest-api (chirpstack/chirpstack-rest-api:4.0.4)...
4.0.4: Pulling from chirpstack/chirpstack-rest-api
ERROR: no matching manifest for linux/arm/v7 in the manifest list entries

Fix postgresql init scripts line ending to work with Windows

The problem is Windows versus Unix line termination in the three shell scripts in the folder \configuration\postgresql\initdb

These files were written into my working directory (git clone) with CR LF line termination. Changing these three files to LF line termination, it appears all the LoRaServer services startup properly when “docker-compose up” is issued. Startup logs look clean and I am able to access http://localhost:8080

I believe the folders containing the above files need a .gitattributes file which forces preservation of the LF line termination when these files are written to the working directory as a result of a git clone.

https://forum.loraserver.io/t/loraserver-docker-compose-wont-run-on-win-10/3592/3

Connect Heltec 32 V2 Gateway

Hi all,
i'm stuck on this, if anyone knows how to fix it i will be very appreciated.

I have a heltec 32 V2 and i want it to use it like a gateway, but i cant communicate my network-server with the gateway.
I have everything install and working, in the arduino IDE y can change the server ip and the port i have try a lot of options but im not know how to make it work.

Im using docker desktop btw.

Any question about the problem just ask.

Here some settings:
D-compose.txt

#	define _TTNSERVER "chirpstack-network-server"
#	define _TTNPORT 8000							// Standard port for TTN
#endif
//Omit the TTN part i want it to chirpstack 

Defects in the file docker-compose.yml

service chirpstack-network-server has no ports setting.

In this case, gRPC will not be able to connect successfully even if it is the default port 8000, which is an obvious defect.

gRPC DNS resolution doesn't seem to work

It seems that in the current version that gRPC DNS resolution is broken. As far as I can tell this is an issue with gRPC and not chirpstack as everything works fine if you use IP addresses.

I've filed an issue against gRPC for this.
grpc/grpc-go#3572

Wanted to file this here for FYI for others and to track updating gRPC once the issue is resolved over there.

Gateway MQTT payload not valid

Hi,

I am getting this error message on gateway event up.

*** PAYLOAD IS NOT VALID JSON DATA *** 

Illegal character ((CTRL-CHAR, code 23)): only regular white space (\r, \n, \t) is allowed between tokens
 at [Source: java.io.StringReader@345fdb0d; line: 2, column: 2]

the topic for this is eu868/gateway/REDACTED/event/up

The gateway itself is a Laird Sentrius (outdoor) connected over port 1700 (Semtech packet forwarder)

The device event is however showing the correct JSON
(application/REDACTED/device/REDACTED/event/up)

My chirpstack-gateway-bridge.toml looks like this:

# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
# configuration example and documentation.

[integration.mqtt.auth.generic]
servers=["tcp://mosquitto:1883"]
username=""
password=""

[integration.mqtt]
event_topic_template="eu868/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
state_topic_template="eu868/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
command_topic_template="eu868/gateway/{{ .GatewayID }}/command/#"

[integration]
# Payload marshaler.
#
# This defines how the MQTT payloads are encoded. Valid options are:
# * protobuf:  Protobuf encoding
# * json:      JSON encoding (easier for debugging, but less compact than 'protobuf')
marshaler="protobuf"

Any help appreciated.

Packet forwarder installation?

IIUC this docker install doesn't include the packet forwarder?

Is there a plan to add it or at least add description how to install separately?

docker-compose.yml, missing restart: unless-stopped lines.

In the docker-compose.yml file in this repository, the line restart: unless-stopped is only added for the chirpstack service. This implies that the gateway-bridge, postgres, etc. are not restarted after boot.
please add restart: unless-stopped for all services.

Channel mask not working

https://github.com/brocaar/loraserver-docker/blob/5572ae904ad9e5b9d6534b50e2665919aa1bbeea/configuration/loraserver/loraserver.toml#L36

I tried changing the CF list sent from the network server to any 8 channel sub-band of US 902-923 through the config file and it didn't seem to work.
Eventually though, I figured out that the line above needs to be preceded by [network_server.network_settings] using your example config file.
Either than that, your server is excellent! I really like the LoRaWAN 1.1 support.

lora-app-server not using environmental variables

Hello,

I'm trying to use environmental variables (from what I understand in commit 0485199 in lora-app-server, there should be support for this) instead of the configuration file lora-app-server.toml, but it's failing on finding the values/vars.

I've have first verified and set the values in the lora-app-server.toml to be sure that it's working with the generated token on http://localhost:8080/api which worked fine.

Error
time="2019-02-28T12:11:31Z" level=fatal msg="jwt secret must be set for external api"

In the docker-compose.yml I've modified like below:

  appserver:
    image: loraserver/lora-app-server:2
    ports:
      - 8080:8080
    environment:
      - APPLICATION_SERVER.EXTERNAL_API.JWT_SECRET=19ELC2DYRUK66YWAML0SPU13SRDTFB5V

I can find the environmental variable on in the docker container, but the lora-app-server doesn't seem to be able to identify it, it's only working when set in the lora-app-server.toml

The reason why I'm doing this is that I want to center my config to the docker-compose.yml file instead of having to edit in several locations. I'm also using the token generated of the jwt secret for my app and this is working > (to verify env passing in docker-compose working) and for my case it's grabbable via process.env.API_TOKEN (nodejs)

    environment:
      - API_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJsb3JhLWFwcC1zZXJ2ZXIiLCJhdWQiOiJsb3JhLWFwcC1zZXJ2ZXIiLCJuYmYiOjE1MDg3NDgxNTAsImV4cCI6MTYwMDAwMDAwMCwic3ViIjoiYWRtaW4iLCJ1c2VybmFtZSI6ImFkbWluIn0.P0lE0Q1TstDLnMcSpA94q-NtQUgBzahkc3vLFkHpT8k

I've been trough the documentation yesterday, and almost all day today but am unable to find anything to help me move forward with using environmental variables in this setup.

Kind regards,
Tin

No LORAWAN Frames: level=error msg="gateway: handle gateway stats error" error="update gateway state error: object does not exist"

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

What happened?

I use this gateway without any connected devices.
In application-server Status seen is a few seconds ago, Gateway activity is None, GPS coordinates is (0, 0), Live LORAWAN Frames is None.

What did you expect?

Right status in application-server: correct GPScoordinates and LORAWAN frames.

Steps to reproduce this issue

Steps:

  1. Run docker-chirpstack by docker-compose up
  2. Create gateway in application-server.

Could you share your log output?

time="2022-05-06T10:57:20.073539229Z" level=info msg="starting ChirpStack Network Server" band=EU868 docs="https://www.chirpstack.io/" net_id=000000 version=
time="2022-05-06T10:57:20.077905827Z" level=info msg="storage: setting up storage module"
time="2022-05-06T10:57:20.077929453Z" level=info msg="storage: setting up Redis client"
time="2022-05-06T10:57:20.07898924Z" level=info msg="storage: connecting to PostgreSQL"
time="2022-05-06T10:57:20.13645922Z" level=info msg="storage: applying PostgreSQL data migrations"
time="2022-05-06T10:57:20.162216879Z" level=info msg="gateway/mqtt: connecting to mqtt broker" server="tcp://mosquitto:1883"
time="2022-05-06T10:57:20.16459562Z" level=info msg="api: starting network-server api server" bind="0.0.0.0:8000" ca-cert= tls-cert= tls-key=
time="2022-05-06T10:57:20.164829214Z" level=info msg="starting downlink device-queue scheduler"
time="2022-05-06T10:57:20.164846376Z" level=info msg="starting multicast scheduler"
time="2022-05-06T10:57:20.16916317Z" level=info msg="backend/gateway: connected to mqtt server"
time="2022-05-06T10:57:20.171068114Z" level=info msg="gateway/mqtt: subscribing to gateway event topic" qos=0 topic=gateway/+/event/+
time="2022-05-06T10:57:46.910962741Z" level=info msg="finished unary call with code OK" ctx_id=a97c0c3c-eb8c-48e9-830f-189628d0072e grpc.code=OK grpc.method=GetGatewayProfile grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T10:57:46Z" grpc.time_ms=5.032 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T10:57:55.634779455Z" level=info msg="finished unary call with code OK" ctx_id=c4392ad7-d18a-463b-b950-1b1f122b617e grpc.code=OK grpc.method=GetGateway grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T10:57:55Z" grpc.time_ms=6.272 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T10:57:58.452940993Z" level=info msg="finished unary call with code OK" ctx_id=34e4bffb-1629-49cd-8b27-2a4780902134 grpc.code=OK grpc.method=GetGatewayProfile grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T10:57:58Z" grpc.time_ms=1.383 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T10:57:58.472481087Z" level=info msg="finished unary call with code OK" ctx_id=8ab8846b-28c1-4e54-a0f9-4c6a0b6694fe grpc.code=OK grpc.method=GetServiceProfile grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T10:57:58Z" grpc.time_ms=2.663 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T10:58:03.770056614Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=e45f01fffe14ccbf stats_id=8a5d3a35-d7ce-4fd7-8daa-c3cdbdf8d527
time="2022-05-06T10:58:03.771701283Z" level=error msg="gateway: handle gateway stats error" ctx_id=8a5d3a35-d7ce-4fd7-8daa-c3cdbdf8d527 error="update gateway state error: object does not exist"
time="2022-05-06T10:58:05.177095977Z" level=info msg="finished streaming call with code OK" grpc.code=OK grpc.method=StreamFrameLogsForGateway grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T10:58:01Z" grpc.time_ms=3465.271 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T10:58:06.625644469Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=e45f01fffe14ccfe stats_id=198dfc0c-5167-4d6f-bd6f-0367c4fa18d3
time="2022-05-06T10:58:06.629585586Z" level=info msg="storage: gateway state updated" ctx_id=198dfc0c-5167-4d6f-bd6f-0367c4fa18d3 gateway_id=e45f01fffe14ccfe
time="2022-05-06T10:58:06.632363666Z" level=warning msg="creating insecure application-server client" server="chirpstack-application-server:8001"
time="2022-05-06T10:58:06.642720914Z" level=info msg="finished client unary call" ctx_id=198dfc0c-5167-4d6f-bd6f-0367c4fa18d3 grpc.code=OK grpc.ctx_id=599ed36b-a238-4f68-8434-890ac75140c9 grpc.duration=8.401583ms grpc.method=HandleGatewayStats grpc.service=as.ApplicationServerService span.kind=client system=grpc
time="2022-05-06T10:58:33.77209287Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=e45f01fffe14ccbf stats_id=48cb2767-2b3c-4131-a32f-4fe47010a472
time="2022-05-06T10:58:33.773250731Z" level=error msg="gateway: handle gateway stats error" ctx_id=48cb2767-2b3c-4131-a32f-4fe47010a472 error="update gateway state error: object does not exist"
time="2022-05-06T10:58:36.632609925Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=e45f01fffe14ccfe stats_id=f01a777e-75f7-4810-97bc-6fb7139a6d68
time="2022-05-06T10:58:36.634864186Z" level=info msg="storage: gateway state updated" ctx_id=f01a777e-75f7-4810-97bc-6fb7139a6d68 gateway_id=e45f01fffe14ccfe
time="2022-05-06T10:58:36.64197737Z" level=info msg="finished client unary call" ctx_id=f01a777e-75f7-4810-97bc-6fb7139a6d68 grpc.code=OK grpc.ctx_id=ad91f17d-4f80-43c6-9cf7-d806fcbed532 grpc.duration=5.627705ms grpc.method=HandleGatewayStats grpc.service=as.ApplicationServerService span.kind=client system=grpc
time="2022-05-06T10:59:00.520923253Z" level=info msg="finished unary call with code OK" ctx_id=770ffec8-9e24-4846-abc9-dbafdbf997fb grpc.code=OK grpc.method=GetGateway grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T10:59:00Z" grpc.time_ms=1.807 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T10:59:03.529176286Z" level=info msg="finished unary call with code OK" ctx_id=124a6084-ec42-43e2-ae33-37a7f084c801 grpc.code=OK grpc.method=GetServiceProfile grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T10:59:03Z" grpc.time_ms=1.248 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T10:59:03.667266252Z" level=info msg="finished unary call with code OK" ctx_id=e93e1bd1-c34a-4e13-8944-de171d3b4935 grpc.code=OK grpc.method=GetGatewayProfile grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T10:59:03Z" grpc.time_ms=1.426 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T10:59:03.773893891Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=e45f01fffe14ccbf stats_id=bde69211-f028-4417-88c9-fdde210578fa
time="2022-05-06T10:59:03.775056162Z" level=error msg="gateway: handle gateway stats error" ctx_id=bde69211-f028-4417-88c9-fdde210578fa error="update gateway state error: object does not exist"
time="2022-05-06T10:59:06.631545456Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=e45f01fffe14ccfe stats_id=9f2fc61b-5184-4957-b6e6-cf49bc9a74ea
time="2022-05-06T10:59:06.633671238Z" level=info msg="storage: gateway state updated" ctx_id=9f2fc61b-5184-4957-b6e6-cf49bc9a74ea gateway_id=e45f01fffe14ccfe
time="2022-05-06T10:59:06.640293579Z" level=info msg="finished client unary call" ctx_id=9f2fc61b-5184-4957-b6e6-cf49bc9a74ea grpc.code=OK grpc.ctx_id=cd86c7bc-7901-4e17-befa-490234b73699 grpc.duration=5.341726ms grpc.method=HandleGatewayStats grpc.service=as.ApplicationServerService span.kind=client system=grpc
time="2022-05-06T10:59:08.853991855Z" level=info msg="finished streaming call with code OK" grpc.code=OK grpc.method=StreamFrameLogsForGateway grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T10:59:07Z" grpc.time_ms=1265.902 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T10:59:31.032261223Z" level=info msg="finished unary call with code OK" ctx_id=01c44d7c-9ca8-4808-b71e-6edf940299b7 grpc.code=OK grpc.method=GetVersion grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T10:59:31Z" grpc.time_ms=0.06 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T10:59:32.128675649Z" level=info msg="finished unary call with code OK" ctx_id=73e1bafc-a81b-4873-a1f5-09b927b708fc grpc.code=OK grpc.method=GetServiceProfile grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T10:59:32Z" grpc.time_ms=0.967 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T10:59:33.305539574Z" level=info msg="finished unary call with code OK" ctx_id=1770baf9-f854-4df0-95ba-2f90fce6b2b3 grpc.code=OK grpc.method=GetGatewayProfile grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T10:59:33Z" grpc.time_ms=1.4 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T10:59:33.773356113Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=e45f01fffe14ccbf stats_id=ba9fbf02-dcf9-41b1-85b2-2333486319db
time="2022-05-06T10:59:33.775696995Z" level=error msg="gateway: handle gateway stats error" ctx_id=ba9fbf02-dcf9-41b1-85b2-2333486319db error="update gateway state error: object does not exist"
time="2022-05-06T10:59:36.635678994Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=e45f01fffe14ccfe stats_id=1a2f3f14-2566-4174-8ef8-078984595330
time="2022-05-06T10:59:36.637772161Z" level=info msg="storage: gateway state updated" ctx_id=1a2f3f14-2566-4174-8ef8-078984595330 gateway_id=e45f01fffe14ccfe
time="2022-05-06T10:59:36.644217771Z" level=info msg="finished client unary call" ctx_id=1a2f3f14-2566-4174-8ef8-078984595330 grpc.code=OK grpc.ctx_id=eabee916-ed37-4600-ac4a-1e3fadff4ab3 grpc.duration=5.233474ms grpc.method=HandleGatewayStats grpc.service=as.ApplicationServerService span.kind=client system=grpc
time="2022-05-06T10:59:57.872564563Z" level=info msg="finished unary call with code OK" ctx_id=b0227908-a48f-45b3-a2b4-057fb4c59edc grpc.code=OK grpc.method=GetGateway grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T10:59:57Z" grpc.time_ms=1.32 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T11:00:01.918865984Z" level=info msg="storage: gateway deleted" ctx_id=d70b34ea-f763-4221-8fee-de3edc5bd720 gateway_id=e45f01fffe14ccfe
time="2022-05-06T11:00:01.919580853Z" level=info msg="finished unary call with code OK" ctx_id=d70b34ea-f763-4221-8fee-de3edc5bd720 grpc.code=OK grpc.method=DeleteGateway grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T11:00:01Z" grpc.time_ms=3.302 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T11:00:03.774083289Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=e45f01fffe14ccbf stats_id=cfcd2736-da68-4310-a16e-98e69697a9db
time="2022-05-06T11:00:03.77476636Z" level=error msg="gateway: handle gateway stats error" ctx_id=cfcd2736-da68-4310-a16e-98e69697a9db error="update gateway state error: object does not exist"
time="2022-05-06T11:00:05.899627493Z" level=info msg="storage: gateway created" ctx_id=4203366c-8c20-4829-aff4-6f0a372e0afb gateway_id=e45f01fffe14ccfe
time="2022-05-06T11:00:05.902265679Z" level=info msg="finished unary call with code OK" ctx_id=4203366c-8c20-4829-aff4-6f0a372e0afb grpc.code=OK grpc.method=CreateGateway grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T11:00:05Z" grpc.time_ms=9.278 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T11:00:06.635982507Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=e45f01fffe14ccfe stats_id=82522a21-c8d0-4ba2-a1d6-075e112e2991
time="2022-05-06T11:00:06.640079737Z" level=info msg="storage: gateway state updated" ctx_id=82522a21-c8d0-4ba2-a1d6-075e112e2991 gateway_id=e45f01fffe14ccfe
time="2022-05-06T11:00:06.647874558Z" level=info msg="finished client unary call" ctx_id=82522a21-c8d0-4ba2-a1d6-075e112e2991 grpc.code=OK grpc.ctx_id=ffcc03a1-3a30-481d-bbfb-641c0ff7a74d grpc.duration=5.239293ms grpc.method=HandleGatewayStats grpc.service=as.ApplicationServerService span.kind=client system=grpc
time="2022-05-06T11:00:11.717350292Z" level=info msg="finished unary call with code OK" ctx_id=a75cd3b4-244d-4dca-9795-13d091681cdf grpc.code=OK grpc.method=GetGateway grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T11:00:11Z" grpc.time_ms=1.264 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T11:00:21.308988848Z" level=info msg="finished streaming call with code OK" grpc.code=OK grpc.method=StreamFrameLogsForGateway grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T11:00:17Z" grpc.time_ms=3783.655 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T11:00:23.94905556Z" level=info msg="finished unary call with code OK" ctx_id=72c181dd-f9f6-4b2e-9aee-dc9f5be08301 grpc.code=OK grpc.method=GetServiceProfile grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T11:00:23Z" grpc.time_ms=0.828 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T11:00:24.08725999Z" level=info msg="finished unary call with code OK" ctx_id=32ab79b4-2eeb-44d8-a8b5-efd35fb7b248 grpc.code=OK grpc.method=GetGatewayProfile grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T11:00:24Z" grpc.time_ms=1.66 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T11:00:27.74650359Z" level=info msg="finished streaming call with code OK" grpc.code=OK grpc.method=StreamFrameLogsForGateway grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T11:00:26Z" grpc.time_ms=1493.1 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T11:00:29.457035818Z" level=info msg="finished streaming call with code OK" grpc.code=OK grpc.method=StreamFrameLogsForGateway grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T11:00:28Z" grpc.time_ms=1128.697 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T11:00:33.779365311Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=e45f01fffe14ccbf stats_id=d66b790b-6e98-44bd-9029-f463bbb077a6
time="2022-05-06T11:00:33.780493411Z" level=error msg="gateway: handle gateway stats error" ctx_id=d66b790b-6e98-44bd-9029-f463bbb077a6 error="update gateway state error: object does not exist"
time="2022-05-06T11:00:36.633147192Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=e45f01fffe14ccfe stats_id=99441caf-72e5-4836-82ab-c577e7e40bce
time="2022-05-06T11:00:36.635000178Z" level=info msg="storage: gateway state updated" ctx_id=99441caf-72e5-4836-82ab-c577e7e40bce gateway_id=e45f01fffe14ccfe
time="2022-05-06T11:00:36.6419344Z" level=info msg="finished client unary call" ctx_id=99441caf-72e5-4836-82ab-c577e7e40bce grpc.code=OK grpc.ctx_id=18af9b26-7b8b-43e0-ad61-918ea5664f00 grpc.duration=5.595077ms grpc.method=HandleGatewayStats grpc.service=as.ApplicationServerService span.kind=client system=grpc
time="2022-05-06T11:01:03.780032275Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=e45f01fffe14ccbf stats_id=5dc0dee0-ce64-45aa-982b-9ebd09212f8f
time="2022-05-06T11:01:03.7815038Z" level=error msg="gateway: handle gateway stats error" ctx_id=5dc0dee0-ce64-45aa-982b-9ebd09212f8f error="update gateway state error: object does not exist"
time="2022-05-06T11:01:06.635165969Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=e45f01fffe14ccfe stats_id=705dc21a-58f7-4ccd-ac2a-7b4757cb398b
time="2022-05-06T11:01:06.637257711Z" level=info msg="storage: gateway state updated" ctx_id=705dc21a-58f7-4ccd-ac2a-7b4757cb398b gateway_id=e45f01fffe14ccfe
time="2022-05-06T11:01:06.64437753Z" level=info msg="finished client unary call" ctx_id=705dc21a-58f7-4ccd-ac2a-7b4757cb398b grpc.code=OK grpc.ctx_id=016cc9df-73d2-4e83-9773-bf1f176458bf grpc.duration=6.138224ms grpc.method=HandleGatewayStats grpc.service=as.ApplicationServerService span.kind=client system=grpc
time="2022-05-06T11:01:17.991957982Z" level=info msg="finished unary call with code OK" ctx_id=3b5004f0-8ea9-4a68-964c-76bfbf237ed5 grpc.code=OK grpc.method=GetGatewayProfile grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T11:01:17Z" grpc.time_ms=1.699 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T11:01:17.995450716Z" level=info msg="finished unary call with code OK" ctx_id=28622d19-984e-481d-8213-03d8decf40fa grpc.code=OK grpc.method=GetServiceProfile grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T11:01:17Z" grpc.time_ms=0.773 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T11:01:26.440138254Z" level=info msg="finished unary call with code OK" ctx_id=0f34c16a-467c-4bd4-99a0-544796a6a704 grpc.code=OK grpc.method=GetGateway grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T11:01:26Z" grpc.time_ms=1.394 peer.address="172.19.0.7:54974" span.kind=server system=grpc
time="2022-05-06T11:01:33.779532138Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=e45f01fffe14ccbf stats_id=1a221018-95b9-4af9-bec9-4cd83e64a8b5
time="2022-05-06T11:01:33.781604674Z" level=error msg="gateway: handle gateway stats error" ctx_id=1a221018-95b9-4af9-bec9-4cd83e64a8b5 error="update gateway state error: object does not exist"
time="2022-05-06T11:01:36.636941355Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=e45f01fffe14ccfe stats_id=99b209bd-2fc6-403a-82b2-41af83a6b718
time="2022-05-06T11:01:36.638613716Z" level=info msg="storage: gateway state updated" ctx_id=99b209bd-2fc6-403a-82b2-41af83a6b718 gateway_id=e45f01fffe14ccfe
time="2022-05-06T11:01:36.645072653Z" level=info msg="finished client unary call" ctx_id=99b209bd-2fc6-403a-82b2-41af83a6b718 grpc.code=OK grpc.ctx_id=e2395aa6-e5c8-48b8-9a8a-fe42714b9496 grpc.duration=5.149953ms grpc.method=HandleGatewayStats grpc.service=as.ApplicationServerService span.kind=client system=grpc
time="2022-05-06T11:01:39.879388696Z" level=warning msg="[core] grpc: addrConn.createTransport failed to connect to {chirpstack-application-server:8001 chirpstack-application-server:8001 <nil> 0 <nil>}. Err: connection error: desc = \"transport: Error while dialing dial tcp 172.19.0.7:8001: connect: connection refused\". Reconnecting..."
time="2022-05-06T11:01:40.232488006Z" level=info msg="signal received" signal=terminated
time="2022-05-06T11:01:40.232527609Z" level=warning msg="stopping chirpstack-network-server"
time="2022-05-06T11:01:40.23255544Z" level=info msg="gateway/mqtt: closing backend"
time="2022-05-06T11:01:40.232562924Z" level=info msg="gateway/mqtt: unsubscribing from event topic" topic=gateway/+/event/+
time="2022-05-06T11:01:40.232830349Z" level=info msg="backend/gateway: handling last messages"
time="2022-05-06T11:01:40.232845549Z" level=info msg="uplink: waiting for pending actions to complete"
time="2022-05-06T11:02:33.865924777Z" level=info msg="starting ChirpStack Network Server" band=EU868 docs="https://www.chirpstack.io/" net_id=000000 version=
time="2022-05-06T11:02:33.8664491Z" level=info msg="storage: setting up storage module"
time="2022-05-06T11:02:33.866465721Z" level=info msg="storage: setting up Redis client"
time="2022-05-06T11:02:33.866485507Z" level=info msg="storage: connecting to PostgreSQL"
time="2022-05-06T11:02:33.999585578Z" level=info msg="storage: applying PostgreSQL data migrations"
time="2022-05-06T11:02:34.028964467Z" level=info msg="gateway/mqtt: connecting to mqtt broker" server="tcp://mosquitto:1883"
time="2022-05-06T11:02:34.031231246Z" level=info msg="api: starting network-server api server" bind="0.0.0.0:8000" ca-cert= tls-cert= tls-key=
time="2022-05-06T11:02:34.032330587Z" level=debug msg="api/roaming: roaming is disabled"
time="2022-05-06T11:02:34.033482729Z" level=info msg="starting downlink device-queue scheduler"
time="2022-05-06T11:02:34.033503498Z" level=info msg="starting multicast scheduler"
time="2022-05-06T11:02:34.033670129Z" level=info msg="backend/gateway: connected to mqtt server"
time="2022-05-06T11:02:34.034164007Z" level=info msg="gateway/mqtt: subscribing to gateway event topic" qos=0 topic=gateway/+/event/+
time="2022-05-06T11:02:34.034503989Z" level=debug msg="running class-b / class-c scheduler batch" ctx_id=731be5cd-b667-42cb-a528-363daebf8539
time="2022-05-06T11:02:34.034693722Z" level=debug msg="running multicast scheduler batch" ctx_id=8500208a-4430-4f2b-9375-adc761e30c19
time="2022-05-06T11:02:34.072631872Z" level=debug msg="sql query executed" args="[100 2022-05-06 11:02:34.04512879 +0000 UTC m=+0.429555878]" duration=27.487702ms query="\n\t\tselect\n\t\t\t*\n\t\tfrom\n\t\t\tmulticast_queue\n\t\twhere\n\t\t\tschedule_at <= $2\n\t\torder by\n\t\t\tid\n\t\tlimit $1\n\t\tfor update skip locked\n\t"
time="2022-05-06T11:02:34.08460174Z" level=debug msg="sql query executed" args="[100 371075h2m54.045673786s 2022-05-06 11:02:34.045676374 +0000 UTC m=+0.430103396]" duration=38.915953ms query="\n        select\n            d.*\n        from\n            device d\n        where\n\t\t\td.mode in ('B', 'C')\n            -- we want devices with queue items\n            and exists (\n                select\n                    1\n                from\n                    device_queue dq\n                where\n                    dq.dev_eui = d.dev_eui\n                    and (\n\t\t\t\t\t\td.mode = 'C'\n                    \tor (\n\t\t\t\t\t\t\td.mode = 'B'\n                    \t\tand dq.emit_at_time_since_gps_epoch <= $2\n                    \t)\n                    )\n            )\n\t\t\t-- exclude device which have one of the following below\n            and not exists (\n                select\n                    1\n                from\n                    device_queue dq\n                where\n                    dq.dev_eui = d.dev_eui\n\t\t\t\t\tand (\n\t\t\t\t\t\t-- pending queue-item with timeout_after in the future\n\t\t\t\t\t\t(dq.is_pending = true and dq.timeout_after > $3)\n\n\t\t\t\t\t\t-- or retry_after set to a timestamp in the future\n\t\t\t\t\t\tor (dq.retry_after is not null and dq.retry_after > $3)\n\t\t\t\t\t)\n            )\n        order by\n            d.dev_eui\n        limit $1\n        for update of d skip locked"
time="2022-05-06T11:02:35.073930643Z" level=debug msg="running multicast scheduler batch" ctx_id=b2129658-2824-44ae-96ef-29b6c6c18273
time="2022-05-06T11:02:35.075483986Z" level=debug msg="sql query executed" args="[100 2022-05-06 11:02:35.074850114 +0000 UTC m=+1.459277196]" duration="622.244µs" query="\n\t\tselect\n\t\t\t*\n\t\tfrom\n\t\t\tmulticast_queue\n\t\twhere\n\t\t\tschedule_at <= $2\n\t\torder by\n\t\t\tid\n\t\tlimit $1\n\t\tfor update skip locked\n\t"
time="2022-05-06T11:02:35.085525301Z" level=debug msg="running class-b / class-c scheduler batch" ctx_id=7d306c6d-a566-405a-ac2d-11fe686e59ba
time="2022-05-06T11:02:35.087709104Z" level=debug msg="sql query executed" args="[100 371075h2m55.086316323s 2022-05-06 11:02:35.086319231 +0000 UTC m=+1.470746251]" duration=1.379808ms query="\n        select\n            d.*\n        from\n            device d\n        where\n\t\t\td.mode in ('B', 'C')\n            -- we want devices with queue items\n            and exists (\n                select\n                    1\n                from\n                    device_queue dq\n                where\n                    dq.dev_eui = d.dev_eui\n                    and (\n\t\t\t\t\t\td.mode = 'C'\n                    \tor (\n\t\t\t\t\t\t\td.mode = 'B'\n                    \t\tand dq.emit_at_time_since_gps_epoch <= $2\n                    \t)\n                    )\n            )\n\t\t\t-- exclude device which have one of the following below\n            and not exists (\n                select\n                    1\n                from\n                    device_queue dq\n                where\n                    dq.dev_eui = d.dev_eui\n\t\t\t\t\tand (\n\t\t\t\t\t\t-- pending queue-item with timeout_after in the future\n\t\t\t\t\t\t(dq.is_pending = true and dq.timeout_after > $3)\n\n\t\t\t\t\t\t-- or retry_after set to a timestamp in the future\n\t\t\t\t\t\tor (dq.retry_after is not null and dq.retry_after > $3)\n\t\t\t\t\t)\n            )\n        order by\n            d.dev_eui\n        limit $1\n        for update of d skip locked"
time="2022-05-06T11:02:36.076413836Z" level=debug msg="running multicast scheduler batch" ctx_id=96709718-8367-48d0-804e-e9dacb00dd0a
time="2022-05-06T11:02:36.077562777Z" level=debug msg="sql query executed" args="[100 2022-05-06 11:02:36.076682658 +0000 UTC m=+2.461109694]" duration="869.617µs" query="\n\t\tselect\n\t\t\t*\n\t\tfrom\n\t\t\tmulticast_queue\n\t\twhere\n\t\t\tschedule_at <= $2\n\t\torder by\n\t\t\tid\n\t\tlimit $1\n\t\tfor update skip locked\n\t"
time="2022-05-06T11:02:36.089261153Z" level=debug msg="running class-b / class-c scheduler batch" ctx_id=acd5ecc2-cbcd-473e-acb2-e91050717fa9
time="2022-05-06T11:02:36.09091492Z" level=debug msg="sql query executed" args="[100 371075h2m56.089597078s 2022-05-06 11:02:36.089600142 +0000 UTC m=+2.474027161]" duration=1.303374ms query="\n        select\n            d.*\n        from\n            device d\n        where\n\t\t\td.mode in ('B', 'C')\n            -- we want devices with queue items\n            and exists (\n                select\n                    1\n                from\n                    device_queue dq\n                where\n                    dq.dev_eui = d.dev_eui\n                    and (\n\t\t\t\t\t\td.mode = 'C'\n                    \tor (\n\t\t\t\t\t\t\td.mode = 'B'\n                    \t\tand dq.emit_at_time_since_gps_epoch <= $2\n                    \t)\n                    )\n            )\n\t\t\t-- exclude device which have one of the following below\n            and not exists (\n                select\n                    1\n                from\n                    device_queue dq\n                where\n                    dq.dev_eui = d.dev_eui\n\t\t\t\t\tand (\n\t\t\t\t\t\t-- pending queue-item with timeout_after in the future\n\t\t\t\t\t\t(dq.is_pending = true and dq.timeout_after > $3)\n\n\t\t\t\t\t\t-- or retry_after set to a timestamp in the future\n\t\t\t\t\t\tor (dq.retry_after is not null and dq.retry_after > $3)\n\t\t\t\t\t)\n            )\n        order by\n            d.dev_eui\n        limit $1\n        for update of d skip locked"
time="2022-05-06T11:02:36.757449603Z" level=debug msg="sql query executed" args="[[228 95 1 255 254 20 204 254]]" duration=2.491186ms query="select * from gateway where gateway_id = $1"
time="2022-05-06T11:02:36.762787786Z" level=debug msg="sql query executed" args="[e45f01fffe14ccfe]" duration=1.033187ms query="\n\t\tselect\n\t\t\tfpga_id,\n\t\t\tfine_timestamp_key\n\t\tfrom\n\t\t\tgateway_board\n\t\twhere\n\t\t\tgateway_id = $1\n\t\torder by\n\t\t\tid\n\t\t"
time="2022-05-06T11:02:36.763327419Z" level=info msg="finished unary call with code OK" ctx_id=d8b2271e-2a75-430c-bd46-276ecc4e0089 grpc.code=OK grpc.method=GetGateway grpc.service=ns.NetworkServerService grpc.start_time="2022-05-06T11:02:36Z" grpc.time_ms=8.391 peer.address="172.19.0.7:52108" span.kind=server system=grpc
time="2022-05-06T11:02:37.078743649Z" level=debug msg="running multicast scheduler batch" ctx_id=af6e95cc-1305-46fb-b854-58d1cd14273a
time="2022-05-06T11:02:37.080212972Z" level=debug msg="sql query executed" args="[100 2022-05-06 11:02:37.079562016 +0000 UTC m=+3.463989121]" duration="640.139µs" query="\n\t\tselect\n\t\t\t*\n\t\tfrom\n\t\t\tmulticast_queue\n\t\twhere\n\t\t\tschedule_at <= $2\n\t\torder by\n\t\t\tid\n\t\tlimit $1\n\t\tfor update skip locked\n\t"
time="2022-05-06T11:02:37.093096242Z" level=debug msg="running class-b / class-c scheduler batch" ctx_id=cbc6ac22-2c7d-40a4-8a04-f96e37a77feb
time="2022-05-06T11:02:37.095078756Z" level=debug msg="sql query executed" args="[100 371075h2m57.093800663s 2022-05-06 11:02:37.093803517 +0000 UTC m=+3.478230532]" duration=1.264837ms query="\n        select\n            d.*\n        from\n            device d\n        where\n\t\t\td.mode in ('B', 'C')\n            -- we want devices with queue items\n            and exists (\n                select\n                    1\n                from\n                    device_queue dq\n                where\n                    dq.dev_eui = d.dev_eui\n                    and (\n\t\t\t\t\t\td.mode = 'C'\n                    \tor (\n\t\t\t\t\t\t\td.mode = 'B'\n                    \t\tand dq.emit_at_time_since_gps_epoch <= $2\n                    \t)\n                    )\n            )\n\t\t\t-- exclude device which have one of the following below\n            and not exists (\n                select\n                    1\n                from\n                    device_queue dq\n                where\n                    dq.dev_eui = d.dev_eui\n\t\t\t\t\tand (\n\t\t\t\t\t\t-- pending queue-item with timeout_after in the future\n\t\t\t\t\t\t(dq.is_pending = true and dq.timeout_after > $3)\n\n\t\t\t\t\t\t-- or retry_after set to a timestamp in the future\n\t\t\t\t\t\tor (dq.retry_after is not null and dq.retry_after > $3)\n\t\t\t\t\t)\n            )\n        order by\n            d.dev_eui\n        limit $1\n        for update of d skip locked"
time="2022-05-06T11:02:38.081924985Z" level=debug msg="running multicast scheduler batch" ctx_id=0f0f746d-43c9-4d63-bfe5-f84232aa6782
time="2022-05-06T11:02:38.083032579Z" level=debug msg="sql query executed" args="[100 2022-05-06 11:02:38.082188915 +0000 UTC m=+4.466616009]" duration="832.966µs" query="\n\t\tselect\n\t\t\t*\n\t\tfrom\n\t\t\tmulticast_queue\n\t\twhere\n\t\t\tschedule_at <= $2\n\t\torder by\n\t\t\tid\n\t\tlimit $1\n\t\tfor update skip locked\n\t"
time="2022-05-06T11:02:38.096584439Z" level=debug msg="running class-b / class-c scheduler batch" ctx_id=bd2b3420-feb7-486b-a42f-e1059dae2f06
time="2022-05-06T11:02:38.098591235Z" level=debug msg="sql query executed" args="[100 371075h2m58.096787259s 2022-05-06 11:02:38.096790311 +0000 UTC m=+4.481217323]" duration=1.790273ms query="\n        select\n            d.*\n        from\n            device d\n        where\n\t\t\td.mode in ('B', 'C')\n            -- we want devices with queue items\n   

Your Environment

Component Version
Application Server v?.?.?
Network Server
Gateway Bridge
Chirpstack API
Geolocation
Concentratord

The device OTAA not activated.

Hello!

I tried to connect a device on my loraserver (after creating a network server, service profile, device profile, gateway, etc...) and I can't get the created device to activate.

The only component I couldn't build was geolocation. The certificates are placed, and it doesn't seem that in the log there is any error related to this.

LoraServer log:

time="2018-10-16T07:22:18Z" level=info msg="starting LoRa Server" band=EU_863_870 docs="https://docs.loraserver.io/" net_id=123456 version=2.3.0
time="2018-10-16T07:22:18Z" level=info msg="setup redis connection pool" url="redis://redis:6379"
time="2018-10-16T07:22:18Z" level=info msg="connecting to postgresql"
time="2018-10-16T07:22:19Z" level=error msg="ping database error, will retry in 2s: pq: the database system is starting up"
time="2018-10-16T07:22:21Z" level=info msg="gateway/mqtt: connecting to mqtt broker" server="tcp://mosquitto:1883"
time="2018-10-16T07:22:21Z" level=error msg="gateway/mqtt: connecting to mqtt broker failed, will retry in 2s: Network Error : dial tcp 172.19.0.4:1883: connect: connection refused"
time="2018-10-16T07:22:23Z" level=info msg="no geolocation-server configured"
time="2018-10-16T07:22:23Z" level=info msg="backend/gateway: connected to mqtt server"
time="2018-10-16T07:22:23Z" level=info msg="gateway/mqtt: subscribing to rx topic" qos=0 topic=gateway/+/rx
time="2018-10-16T07:22:23Z" level=info msg="configuring join-server client" ca_cert= server="http://appserver:8003" tls_cert= tls_key=
time="2018-10-16T07:22:23Z" level=info msg="no network-controller configured"
time="2018-10-16T07:22:23Z" level=info msg="applying database migrations"
time="2018-10-16T07:22:23Z" level=info msg="gateway/mqtt: subscribing to stats topic" qos=0 topic=gateway/+/stats
time="2018-10-16T07:22:23Z" level=info msg="backend/gateway: subscribing to ack topic" qos=0 topic=gateway/+/ack
time="2018-10-16T07:22:23Z" level=info msg="migrations applied" count=0
time="2018-10-16T07:22:23Z" level=info msg="starting api server" bind="0.0.0.0:8000" ca-cert=/certs/ca/ca.pem tls-cert=/certs/loraserver/api/server/loraserver-api-server.pem tls-key=/certs/loraserver/api/server/loraserver-api-server-key.pem
time="2018-10-16T07:22:23Z" level=info msg="starting downlink device-queue scheduler"
time="2018-10-16T07:22:23Z" level=info msg="starting multicast scheduler"
time="2018-10-16T07:22:48Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=88c255fffe6c8bf3
time="2018-10-16T07:22:48Z" level=info msg="gateway updated" gateway_id=88c255fffe6c8bf3
time="2018-10-16T07:23:18Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=88c255fffe6c8bf3
time="2018-10-16T07:23:18Z" level=info msg="gateway updated" gateway_id=88c255fffe6c8bf3
time="2018-10-16T07:23:48Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=88c255fffe6c8bf3
time="2018-10-16T07:23:48Z" level=info msg="gateway updated" gateway_id=88c255fffe6c8bf3
time="2018-10-16T07:23:59Z" level=info msg="gateway/mqtt: uplink frame received"
time="2018-10-16T07:23:59Z" level=error msg="processing uplink frame error" data_base64="QPQqASaAEQABNPZdGTumEx9aV8g=" error="get device-session error: device-session does not exist or invalid fcnt or mic"
time="2018-10-16T07:24:18Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=88c255fffe6c8bf3
time="2018-10-16T07:24:18Z" level=info msg="gateway updated" gateway_id=88c255fffe6c8bf3
time="2018-10-16T07:24:48Z" level=info msg="gateway/mqtt: gateway stats packet received" gateway_id=88c255fffe6c8bf3
time="2018-10-16T07:24:48Z" level=info msg="gateway updated" gateway_id=88c255fffe6c8bf3

LoraAppServer log:

time="2018-10-16T07:22:20Z" level=info msg="starting LoRa App Server" docs="https://www.loraserver.io/" version=2.3.0
time="2018-10-16T07:22:20Z" level=info msg="connecting to postgresql"
time="2018-10-16T07:22:20Z" level=info msg="setup redis connection pool"
time="2018-10-16T07:22:20Z" level=info msg="handler/mqtt: TLS config is empty"
time="2018-10-16T07:22:20Z" level=info msg="handler/mqtt: connecting to mqtt broker" server="tcp://mosquitto:1883"
time="2018-10-16T07:22:21Z" level=info msg="applying database migrations"
time="2018-10-16T07:22:21Z" level=info msg="handler/mqtt: connected to mqtt broker"
time="2018-10-16T07:22:21Z" level=info msg="handler/mqtt: subscribing to tx topic" qos=0 topic=application/+/device/+/tx
time="2018-10-16T07:22:21Z" level=info msg="migrations applied" count=0
time="2018-10-16T07:22:21Z" level=info msg="starting application-server api" bind="0.0.0.0:8001" ca-cert=/certs/ca/ca.pem tls-cert=/certs/lora-app-server/api/server/lora-app-server-api-server.pem tls-key=/certs/lora-app-server/api/server/lora-app-server-api-server-key.pem
time="2018-10-16T07:22:21Z" level=info msg="starting join-server api" bind="0.0.0.0:8003" ca_cert= tls_cert= tls_key=
time="2018-10-16T07:22:21Z" level=info msg="starting client api server" bind="0.0.0.0:8080" tls-cert=/etc/lora-app-server/certs/http.pem tls-key=/etc/lora-app-server/certs/http-key.pem
time="2018-10-16T07:22:21Z" level=info msg="registering rest api handler and documentation endpoint" path=/api

LoraGatewayBridge log:

time="2018-10-16T07:22:20Z" level=info msg="starting LoRa Gateway Bridge" docs="https://www.loraserver.io/lora-gateway-bridge/" version=2.6.0
time="2018-10-16T07:22:20Z" level=info msg="backend: set max reconnect interval: 10m0s"
time="2018-10-16T07:22:20Z" level=info msg="backend: TLS config is empty"
time="2018-10-16T07:22:20Z" level=info msg="backend: connecting to mqtt broker" server="tcp://mosquitto:1883"
time="2018-10-16T07:22:21Z" level=info msg="gateway: starting gateway udp listener" addr="0.0.0.0:1700"
time="2018-10-16T07:22:21Z" level=info msg="backend: connected to mqtt broker"
time="2018-10-16T07:22:21Z" level=info msg="backend: subscribing to topic" qos=0 topic=gateway/88c255fffe6c8bf3/tx
time="2018-10-16T07:22:21Z" level=info msg="backend: subscribing to topic" qos=0 topic=gateway/88c255fffe6c8bf3/config
time="2018-10-16T07:22:48Z" level=info msg="gateway: stat packet received" addr="172.19.0.1:48442" mac=88c255fffe6c8bf3
time="2018-10-16T07:22:48Z" level=info msg="backend: publishing packet" qos=0 topic=gateway/88c255fffe6c8bf3/stats

docker-compose up created Postgres Account I can connect to without password

When trying to debug a different issue I came across something which looks like an issue to me (Correct me if I'm wrong and just have some big misunderstanding how authentication with psql works):

  1. Create a Loraserver Setup with docker-compose up.
    Things I changed in the docker file:
  • Remove the Mosquitto Container as I don't need that
  • Give each container a fixed IP Address
    Things I changed in the Config Folder:
  • postgresql: Nothing
  • network-server: MQTT Connction Parameters
  1. Expected Behavior: The docker-compose up command should create a psql database and user with the default credentials from the 001-init-chirpstack_ns.sh file:
    create role chirpstack_ns with login password 'chirpstack_ns';
    create database chirpstack_ns with owner chirpstack_ns;
  1. Testing: I tried to connect to the Database from command line:
    psql -h 172.23.0.24 -p 5432 -U chirpstack_ns -W

  2. Actual Behavior: It asks me for a password, but even when I give the password "asdf" or anything else it connects successfully. Even when connected to psql I can connect to the database by giving a wrong password:

[...]$ psql -h 172.23.0.24 -p 5432 -U chirpstack_ns -W 
Password for user chirpstack_ns: 
psql (9.2.24, server 9.6.16)
WARNING: psql version 9.2, server version 9.6.
         Some psql features might not work.
Type "help" for help.

chirpstack_ns=> \connect chirpstack_ns
Password for user chirpstack_ns: 
psql (9.2.24, server 9.6.16)
WARNING: psql version 9.2, server version 9.6.
         Some psql features might not work.
You are now connected to database "chirpstack_ns" as user "chirpstack_ns".

Somewhere in the back of my head I remember that Postgres authenticates by the unix user you use to login but I'm not 100% sure how it actually works to be honest. So is this one a bug or am I misunderstanding authentication in psql completely? It doesn't matter whether I try to authenticate directly from the host system or from within the Network Server Docker container, both work fine. Also if I change the Password in the network-server configuration file and do a docker-compose down and then a docker-compose up the Network Server can still connect to the Database.

Could not start postgres after docker-compose up

Used current docker-compose-env.yaml
After pull and during build with docker-compose up I get:
ERROR: for postgresql Cannot start service postgresql: Bind mount failed: '/volume1/docker/yml/lorawan/configuration/postgresql/initdb' does not exists
ERROR: Encountered errors while bringing up the project.

Any news to support ARM?

I've seen the "Support docker installation on RaspberryPi" #19 thread, but there has been no reply for a couple of years. Is this repo still active, and if so are there any plans of supporting ARM (or providing a tutorial)?

`docker-compose up` fails with docker-ce

Installed docker per the Debian instructions, the following two components were installed:

$ sudo apt-get install docker-ce docker-ce-cli containerd.io
<usual apt-get noise>
Setting up docker-ce-cli (5:19.03.3~3-0~debian-stretch) ...
Setting up docker-ce (5:19.03.3~3-0~debian-stretch) ...
...
$ docker-compose --version
docker-compose version 1.9.0, build 2585387
$ docker --version
Docker version 19.03.3, build a872fc2f86
$

Ran docker-compose up command, received the following error:

$ docker-compose up
ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
$

I'm pretty new to Docker, so I don't know what I should be looking at to resolve this.

gRPC Stream - Stream Device Event Hanging

Hi,

I am using an almost direct clone of this repo to test some LoRa nodes. The only configuration I have made is to use au915_0 in the gateway-bridge configuration.

Most is working fine, I have a gateway and 2 devices configured (1 ABP, 1 OTAA). Except, the sockets on the events and LoRaWAN Frames tabs are continually buffering. These buffer indefinitely unless the connection to the server is lost, when that connection is lost the events appear as expected. When connection is regained the socket returns to buffering indefinitely.

When inspecting the logs and databases it appears that all the data is there and that it is only the socket that is failing.

I am using nginx as a reverse proxy, however the same issue is produced when not used with the proxy

UI does not change from this state in normal operation

image

UI after connection loss and reconnect

image

Inspect Console (~3 mins between start and error)

image

Stack Trace

2023-01-10T05:22:13.354544Z TRACE chirpstack::downlink::scheduler: class_b_c_scheduler_loop completed successfully
2023-01-10T05:22:14.036390Z DEBUG http{method="GET" uri=/ version=HTTP/1.0}: chirpstack::api: Started processing request
2023-01-10T05:22:14.036418Z  INFO http{method="GET" uri=/ version=HTTP/1.0}: chirpstack::api: Finished processing request status="200" latency=38.95µs
2023-01-10T05:22:14.045064Z TRACE chirpstack::api::internal: DropReceiver drop method called
2023-01-10T05:22:14.045081Z DEBUG chirpstack::api::internal: Client disconnected
2023-01-10T05:22:14.057941Z DEBUG http{method="GET" uri=/static/js/main.c173e3dd.js version=HTTP/1.0}: chirpstack::api: Started processing request
2023-01-10T05:22:14.057965Z  INFO http{method="GET" uri=/static/js/main.c173e3dd.js version=HTTP/1.0}: chirpstack::api: Finished processing request status="200" latency=32.348µs
2023-01-10T05:22:14.332342Z TRACE chirpstack::downlink::scheduler: Starting multicast-group queue scheduler loop run
2023-01-10T05:22:14.332354Z TRACE chirpstack::downlink::scheduler: Getting schedulable multicast-group queue items
2023-01-10T05:22:14.333336Z TRACE chirpstack::downlink::scheduler: Got this number of multicast-group queue items count=0
2023-01-10T05:22:14.333347Z TRACE chirpstack::downlink::scheduler: Multicast-group queue scheduler run completed successfully
2023-01-10T05:22:14.355539Z TRACE chirpstack::downlink::scheduler: Starting class_b_c_scheduler_loop run
2023-01-10T05:22:14.355548Z TRACE chirpstack::downlink::scheduler: Getting devices that have schedulable queue-items
2023-01-10T05:22:14.356632Z TRACE chirpstack::downlink::scheduler: Got this number of devices with schedulable queue-items device_count=0
2023-01-10T05:22:14.356642Z TRACE chirpstack::downlink::scheduler: class_b_c_scheduler_loop completed successfully
2023-01-10T05:22:14.827903Z DEBUG http{method="GET" uri=/static/css/main.d189f327.css version=HTTP/1.0}: chirpstack::api: Started processing request
2023-01-10T05:22:14.827932Z  INFO http{method="GET" uri=/static/css/main.d189f327.css version=HTTP/1.0}: chirpstack::api: Finished processing request status="200" latency=39.365µs
2023-01-10T05:22:15.015556Z DEBUG chirpstack::eventlog: Channel has been closed, returning
2023-01-10T05:22:15.031874Z DEBUG http{method="GET" uri=/static/js/main.c173e3dd.js.map version=HTTP/1.0}: chirpstack::api: Started processing request
2023-01-10T05:22:15.031902Z  INFO http{method="GET" uri=/static/js/main.c173e3dd.js.map version=HTTP/1.0}: chirpstack::api: Finished processing request status="200" latency=36.85µs
2023-01-10T05:22:15.072129Z DEBUG gRPC{uri=/api.InternalService/Profile}: chirpstack::api: Started processing request
2023-01-10T05:22:15.073232Z  INFO gRPC{uri=/api.InternalService/Profile}: chirpstack::api: Finished processing request status="200" latency=1.110249ms
2023-01-10T05:22:15.170309Z DEBUG http{method="GET" uri=/static/css/main.d189f327.css.map version=HTTP/1.0}: chirpstack::api: Started processing request
2023-01-10T05:22:15.170335Z  INFO http{method="GET" uri=/static/css/main.d189f327.css.map version=HTTP/1.0}: chirpstack::api: Finished processing request status="200" latency=38.082µs
2023-01-10T05:22:15.203923Z DEBUG gRPC{uri=/api.InternalService/Settings}: chirpstack::api: Started processing request
2023-01-10T05:22:15.203978Z  INFO gRPC{uri=/api.InternalService/Settings}: chirpstack::api: Finished processing request status="200" latency=62.116µs
2023-01-10T05:22:15.222153Z DEBUG gRPC{uri=/api.TenantService/Get}: chirpstack::api: Started processing request
2023-01-10T05:22:15.223206Z  INFO gRPC{uri=/api.TenantService/Get}: chirpstack::api: Finished processing request status="200" latency=1.057478ms
2023-01-10T05:22:15.243003Z DEBUG gRPC{uri=/api.TenantService/Get}: chirpstack::api: Started processing request
2023-01-10T05:22:15.244127Z  INFO gRPC{uri=/api.TenantService/Get}: chirpstack::api: Finished processing request status="200" latency=1.129669ms
2023-01-10T05:22:15.266493Z DEBUG http{method="GET" uri=/icon.png version=HTTP/1.0}: chirpstack::api: Started processing request
2023-01-10T05:22:15.266520Z  INFO http{method="GET" uri=/icon.png version=HTTP/1.0}: chirpstack::api: Finished processing request status="200" latency=36.067µs
2023-01-10T05:22:15.301306Z DEBUG gRPC{uri=/api.ApplicationService/Get}: chirpstack::api: Started processing request
2023-01-10T05:22:15.303169Z  INFO gRPC{uri=/api.ApplicationService/Get}: chirpstack::api: Finished processing request status="200" latency=1.869528ms
2023-01-10T05:22:15.321412Z DEBUG http{method="GET" uri=/logo.png version=HTTP/1.0}: chirpstack::api: Started processing request
2023-01-10T05:22:15.321439Z  INFO http{method="GET" uri=/logo.png version=HTTP/1.0}: chirpstack::api: Finished processing request status="200" latency=36.468µs
2023-01-10T05:22:15.336175Z TRACE chirpstack::downlink::scheduler: Starting multicast-group queue scheduler loop run
2023-01-10T05:22:15.336183Z TRACE chirpstack::downlink::scheduler: Getting schedulable multicast-group queue items
2023-01-10T05:22:15.336212Z DEBUG gRPC{uri=/api.DeviceService/Get}: chirpstack::api: Started processing request
2023-01-10T05:22:15.337139Z TRACE chirpstack::downlink::scheduler: Got this number of multicast-group queue items count=0
2023-01-10T05:22:15.337150Z TRACE chirpstack::downlink::scheduler: Multicast-group queue scheduler run completed successfully
2023-01-10T05:22:15.339681Z  INFO gRPC{uri=/api.DeviceService/Get}: chirpstack::api: Finished processing request status="200" latency=3.471485ms
2023-01-10T05:22:15.357016Z TRACE chirpstack::downlink::scheduler: Starting class_b_c_scheduler_loop run
2023-01-10T05:22:15.357025Z TRACE chirpstack::downlink::scheduler: Getting devices that have schedulable queue-items
2023-01-10T05:22:15.358173Z TRACE chirpstack::downlink::scheduler: Got this number of devices with schedulable queue-items device_count=0
2023-01-10T05:22:15.358183Z TRACE chirpstack::downlink::scheduler: class_b_c_scheduler_loop completed successfully
2023-01-10T05:22:15.372525Z DEBUG gRPC{uri=/api.DeviceProfileService/Get}: chirpstack::api: Started processing request
2023-01-10T05:22:15.375163Z  INFO gRPC{uri=/api.DeviceProfileService/Get}: chirpstack::api: Finished processing request status="200" latency=2.642662ms
2023-01-10T05:22:15.432077Z DEBUG gRPC{uri=/api.InternalService/StreamDeviceEvents}: chirpstack::api: Started processing request
2023-01-10T05:22:15.433064Z  INFO gRPC{uri=/api.InternalService/StreamDeviceEvents}: chirpstack::api: Finished processing request status="200" latency=992.707µs
2023-01-10T05:22:15.433395Z TRACE chirpstack::eventlog: Event-log received from stream key=up id=1673318457975-0
2023-01-10T05:22:15.433476Z TRACE chirpstack::api::internal: Message received from Redis Stream channel
2023-01-10T05:22:16.338168Z TRACE chirpstack::downlink::scheduler: Starting multicast-group queue scheduler loop run

chirpstack-gateway-brigde.toml

[integration.mqtt.auth.generic]
servers=["tcp://mosquitto:1883"]
username=""
password=""

[integration.mqtt]
event_topic_template="au915_0/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
state_topic_template="au915_0/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
command_topic_template="au915_0/gateway/{{ .GatewayID }}/command/#"

chirpstack.toml

[logging]

  level="info"


[postgresql]

  dsn="postgres://chirpstack:chirpstack@$POSTGRESQL_HOST/chirpstack?sslmode=disable"

  max_open_connections=10

  min_idle_connections=0

[redis]

  servers=[
    "redis://$REDIS_HOST/",
  ]

  tls_enabled=false

  cluster=false

[network]

  net_id="000000"

  # regions commented out to make help debugging
  enabled_regions=[
    # "as923",
    # "as923_2",
    # "as923_3",
    # "as923_4",
    "au915_0",
    # "cn470_10",
    # "cn779",
    # "eu433",
    # "eu868",
    # "in865",
    # "ism2400",
    # "kr920",
    # "ru864",
    # "us915_0",
    # "us915_1",
  ]


# API interface configuration.
[api]

  bind="0.0.0.0:8080"

  secret="REDACTED"


[integration]
  enabled=["mqtt"]

  [integration.mqtt]
    server="tcp://mosquitto:1883/"
    json=true

MQTT 2.0 has broken docker compose

I tried to deploy the docker-compose configuration, and ran into an issue where MQTT was refusing to connection from all servers. Due the the below breaking change:

eclipse/mosquitto#2040

I was able fix this by fixing the MQTT docker container to 1.6 via:

 mosquitto:
    image: eclipse-mosquitto:1.6
    ports:
      - 1883:1883

LoRaServer docker ports

In docker-compose.yml you should configure port of loraserver like:

loraserver:
    image: loraserver/loraserver:2
    ports:
     - 8000:8000
    volumes:
      - ./configuration/loraserver:/etc/loraserver

Otherwise, lora_app_server cannot connect to it.

tag : 3 ,Which version is it ?

chirpstack-docker

image: chirpstack/chirpstack-network-server:3

3 is V3.0.0 ???

NS v3.10, AS v3.15, Bridge v3.10 ????

Does anyone know ?

thanks!!!

Container deployment needs to be ordered

Containers that depend on other containers must wait for them.
This can be easily achieved by using the depends_on configuration of Docker Compose.

A pull request will follow.. :)

Can't see network server after start

I have start a stack with docker-compose up -d
Login to app server
Create a new network server loraserver:8000
When I creating a gateway, i cant choose my created network server from list, because it's empty.
What I need to check ?
Screenshot 2019-08-17 at 4 56 28 PM
Screenshot 2019-08-17 at 4 56 44 PM
Screenshot 2019-08-17 at 4 56 52 PM

Mosquitto with auth Plugin

Feature request:. It would be really nice if a preconfigured Mosquitto with auth plugin would be included :)

Add examples

Add some example showing combinations of single/multiple postgreqsl and redis servers.
Can NS and AS have their own set?
How to do multi-region? Can it be done on 1 forwarder UDP port?
I have no clue what can or needs to be separated.
I'm trying to add a network server in a new set of databases, NS and AS in my currently docker-compose file, but I get an error that the object already exists...

Runing chirpstack on K8s, always crash

Hi,

I am trying to run chirpstack on K8s. So far I have got every other components successfully running, but only chirpstack/chirpstack:4.0.0 always crashes.

My yaml file is attached, really appreciate it if you could help!

chirpstack.zip

Problems connecting chirpstack-gateway-bridge with DRAGINO LG308 Gateway

Hi,
I have recently changed to ChirpStack Private Server and installed this docker version. Seems to work pretty good. But my gateway isn't connecting, or at least in the Application Server it still says
Last seen: Never
When looking for the logs, docker-compose logs will show:
chirpstack-gateway-bridge_1 | time="2020-06-11T07:55:32Z" level=error msg="integration/mqtt: connection error" error="Network Error : dial tcp 172.20.0.4:1883: connect: connection refused"

I followed this guide to install in the gateway: https://www.chirpstack.io/gateway-bridge/gateway/dragino/ to install

This is the configuration file on docker:
chirpstack-gateway-bridge.toml.txt
(I recently changed 127.0.0.1 to chirpstack-network-server as shown in the file)

And this the file on the gateway:
GTWFILE_chirpstack-gateway-bridge.toml.txt

(Maybe I'm missing sth?)
Any help is really useful.
Nicolas

Support docker installation on RaspberryPi

some of the images don't support the arm architecture. I will look into how to add support for this.

Would you accept a PR for that?

The reason why I can't use the official RPI OS is that I need to run some other tools in docker containers and the official Rpi OS doesn't run raspbian so it would probably be quite hard to install docker on it.

Makefile import-lorawan-devices use old command

As the command has changed due to the TTN LoRaWAN device repository, the command in the Makefile needs to be updated from:

import-lorawan-devices:
	docker-compose run --rm --entrypoint bash --user root chirpstack -c '\
		apt-get update && \
		apt-get install -y make git && \
		git clone https://github.com/brocaar/lorawan-devices /tmp/lorawan-devices && \
		chirpstack -c /etc/chirpstack import-ttn-lorawan-devices -d /tmp/lorawan-devices'

to

import-lorawan-devices:
	docker-compose run --rm --entrypoint bash --user root chirpstack -c '\
		apt-get update && \
		apt-get install -y make git && \
		git clone https://github.com/brocaar/lorawan-devices /tmp/lorawan-devices && \
		chirpstack -c /etc/chirpstack import-legacy-lorawan-devices-repository -d /tmp/lorawan-devices'

InfluxDB integration in docker-compose

Hi! I used your docker-compose.yml file to create a loraserver which works well.

I added two docker images to the docker-compose file, Grafana and InfluxDB. I tried to use the InfluxDB integration from the Loraserver webinterface.

My docker-compose.yml file, looks like this:

version: "3"

services:
  loraserver:
    image: loraserver/loraserver:2
    volumes:
      - ./configuration/loraserver:/etc/loraserver

  appserver:
    image: loraserver/lora-app-server:2
    ports:
      - 8080:8080
    volumes:
      - ./configuration/lora-app-server:/etc/lora-app-server

  gatewaybridge:
    image: loraserver/lora-gateway-bridge:2
    ports:
      - 1700:1700/udp
    volumes:
      - ./configuration/lora-gateway-bridge:/etc/lora-gateway-bridge
  
  geoserver:
    image: loraserver/lora-geo-server:2
    volumes:
      - ./configuration/lora-geo-server:/etc/lora-geo-server
  
  postgresql:
    image: postgres:9.6-alpine
    volumes:
      - ./configuration/postgresql/initdb:/docker-entrypoint-initdb.d
      - postgresqldata:/var/lib/postgresql/data

  redis:
    image: redis:4-alpine
    volumes:
      - redisdata:/data

  mosquitto:
    image: eclipse-mosquitto
    ports:
      - 1883:1883

  influxdb:
    image: influxdb
    restart: always
    environment:
      - INFLUXDB_DB="database_test"
      - INFLUXDB_ADMIN_ENABLED="true"
      - INFLUXDB_ADMIN_USER="admin"
      - INFLUXDB_ADMIN_PASSWORD="admin"
      - INFLUXDB_USER="user"
      - INFLUXDB_USER_PASSWORD="user"
    ports:
      - 8086:8086
    volumes:
      - influxdb:/var/lib/influxdb

  grafana:
    image: grafana/grafana
    ports:
      - 3000:3000
    volumes:
      - grafana:/var/lib/grafana/data



volumes:
  postgresqldata:
  redisdata:
  influxdb:
  grafana:

I set up some configuration for the InfluxDB image. A new user is added and a database.
When I log into Grafana at localhost:3000 I can set up a connection to my database_test which was created during running the docker-compose up command. In Grafana iÍ get immediately feedback if the connection to http//:influxdb:8086 (I am using dockers address space here)is successful.
I also get the following message from the InfluxDB log which confirms the connection:

ts=2019-04-15T12:31:40.459969Z lvl=info msg="Executing query" log_id=0EpFAvvG000 service=query query="SHOW RETENTION POLICIES ON database_test"
[httpd] 172.19.0.1, 172.19.0.1,172.19.0.5 - user [15/Apr/2019:12:31:40 +0000] "GET /query?db=database_test&epoch=ms&q=SHOW+RETENTION+POLICIES+on+%22database_test%22 HTTP/1.1" 200 149 "-" "Grafana/6.1.3" 6b6ec1cb-5f7a-11e9-8001-0242ac130004 4230

After I configured the Loraserver with gateway and lora nodes I received data but Loraserver couldn't connect to the InfluxDB database_test and write the data

I got following log entry from the lora appserver:

time="2019-04-15T13:04:39Z" level=error msg="integration/multi: integration *influxdb.Integration error" error="sending measurements error: expected 2xx response, got: 404 (404 page not found\n)"

What could be the reason why the Loraserver can't connect to the InfluxDB container?

I tested similar setup in ubuntu successfully before.

ssl certificate for chirpstack v4 ui

Hello,
I'm new to chirpstack and just updated to V4, Everything looks goods so far except for the fact that i didn't succeed to secure everything with ssl certificate, in fact i'm stuck on passing the UI (8080) in https, is there a simple way to do it in the chirpstack.toml ? Something that corresponds to what was in the server-application before ?
I saw a chirpstack-certificates project that looked interesting but that is still on the V3 template. (https://github.com/brocaar/chirpstack-certificates) Is there an update schedule soon ?

Network Servers / Add Error context deadline exceeded (code: 2)

I've tried these server names :

  • 127.0.0.1:8000
  • localhost:8000

None of them worked

Here is the logs
chirpstack-application-server_1 | time="2020-08-31T02:34:51Z" level=warning msg="creating insecure network-server client" server="127.0.0.1:8000"

chirpstack-application-server_1 | time="2020-08-31T02:34:51Z" level=warning msg="grpc: addrConn.createTransport failed to connect to {127.0.0.1:8000 0 }. Err: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:8000: connect: connection refused". Reconnecting..."

chirpstack-application-server_1 | time="2020-08-31T02:34:51Z" level=error msg="finished unary call with code Unknown" ctx_id=542b4d5d-d018-4128-b5cb-ac055ef027e2 error="rpc error: code = Unknown desc = context deadline exceeded" grpc.code=Unknown grpc.method=Create grpc.service=api.NetworkServerService grpc.start_time="2020-08-31T02:34:51Z" grpc.time_ms=505.946 peer.address="127.0.0.1:52982" span.kind=server system=grpc

FATAL Postgress

Getting the following postgres error which prevents docker-compose from bringing up all the containers:
postgresql_1 | FATAL: role "loraserver_ns" does not exist
postgresql_1 | FATAL: role "loraserver_as" does not exist

Chirpstack network server configuration examples for US915 are incorrect (missing channels 64,65)

As commented in the title:

The example in chirpstack-network-server.us915.0.toml contains the following:

[network_server.network_settings] enabled_uplink_channels=[0, 1, 2, 3, 4, 5, 6, 7]

For sub-band 1, this should be instead:

[network_server.network_settings] enabled_uplink_channels=[0, 1, 2, 3, 4, 5, 6, 7, 64]

The file chirpstack-network-server.us915.1.toml has a similar misconfiguration - it is missing channel 65 for a proper sub-band 2 configuration.

sudo not available

Hi,
first - thanks again for this great piece of software.
Second, i tried to add the TTN device repo into the docker container but cant sudo any command, neither i have found the root password for the containers? Did i miss something or what will be the best way to import the TTN device repo into an dockerized environment?

Thanks in advance.

chirpstack-gateway-bridge doesn't seem to be up

Hi,

I have used the docker-compose.yml to setup my docker environment through docker-compose. Although everything seems to be up and running, the chirpstack-gateway-bridge is not up. The docker yes, but not the service inside the docker.

For simplicity I have run only bridge and mosquito, i.e.

docker-compose up chirpstack-gateway-bridge

With docker ps I have:

CONTAINER ID   IMAGE                                         COMMAND                  CREATED          STATUS          PORTS                                       NAMES
0246623d4ae2   docker-chirpstack_chirpstack-gateway-bridge   "/usr/bin/chirpstack…"   44 minutes ago   Up 20 minutes   0.0.0.0:1700->1700/udp, :::1700->1700/udp   docker-chirpstack_chirpstack-gateway-bridge_1
a2663bda40d9   eclipse-mosquitto:2                           "/docker-entrypoint.…"   44 minutes ago   Up 21 minutes   0.0.0.0:1883->1883/tcp, :::1883->1883/tcp   docker-chirpstack_mosquitto_1
symeon@debian:/media/extra_partition/MyProjects/MbedPrograms/Prototypes/server-prototype-environment$ 

I login to mosquito container with nmap installed:
docker exec -u 0 -it a2663bda40d9 /bin/sh

Starting Nmap 7.80 ( https://nmap.org ) at 2021-07-11 17:25 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0000090s latency).
Other addresses for localhost (not scanned): ::1
Not shown: 65499 closed ports
PORT     STATE SERVICE
1883/tcp open  mqtt

And then I login to bridge:
docker exec -u 0 -it 0246623d4ae2 /bin/sh

 nmap localhost -p 1-65535
Starting Nmap 7.91 ( https://nmap.org ) at 2021-07-11 17:26 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0000080s latency).
Other addresses for localhost (not scanned): ::1
All 65535 scanned ports on localhost (127.0.0.1) are closed

Nmap done: 1 IP address (1 host up) scanned in 1.27 second

The bridge doesn't seem to be up...Is it a bug or should I do anything else?

In https://github.com/brocaar/chirpstack-docker/blob/master/configuration/chirpstack-gateway-bridge/chirpstack-gateway-bridge.toml

I have tried also to use the ip of the mosquito container which in my case was

[integration.mqtt.auth.generic]
servers=["tcp://172.20.0.8:1883"]     | instead of tcp://mosquitto:1883
username=""
password=""

But again nothing is up

How to access the PostgreSql?

I found that when I finished it, I can't access the PostgreSql like I used to.So,could you tell me how to acess the datebase?Thx!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.