Dear all,
I am using Chirpstack Gateway OS full and everything is working well except the MQTT integration for the Application server that is why I am asking your help in this category.
I want to use the MQTT integration backend of the Chirpstack Application Server but I have some issues when I want to receive frames.
Indeed I can see with mosquitto_sub the data in the topic gateway/# but nothing in application/#
When I look at the log, the connection to the broker seems OK but nothing happens in related MQTT topics application/#.
Below my configuration:
- Raspberrypi3 b+ with IMST IC880A
- Chirpstack Gateway OS full, version 3.3.2 (so chirpstack application
server v3.12.1) - chirpstack-application-server.toml
[general]
log_level=4
password_hash_iterations=1000
log_to_syslog=true
[postgresql]
dsn="postgres://chirpstack_as:chirpstack_as@localhost/chirpstack_as?sslmode=disable"
[application_server]
id="3861fa79-148d-4652-ba25-e5b09e72815a"
# Integration configures the data integration.
#
# This is the data integration which is available for all applications,
# besides the extra integrations that can be added on a per-application
# basis.
[application_server.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')
# * json_v3: v3 JSON (will be removed in the next major release)
marshaler="json_v3"
# Enabled integrations.
#
# Enabled integrations are enabled for all applications. Multiple
# integrations can be configured.
# Do not forget to configure the related configuration section below for
# the enabled integrations. Integrations that can be enabled are:
# * mqtt - MQTT broker
# * amqp - AMQP / RabbitMQ
# * aws_sns - AWS Simple Notification Service (SNS)
# * azure_service_bus - Azure Service-Bus
# * gcp_pub_sub - Google Cloud Pub/Sub
# * kafka - Kafka distributed streaming platform
# * postgresql - PostgreSQL database
enabled=["mqtt"]
# MQTT integration backend.
[application_server.integration.mqtt]
# Event topic template.
event_topic_template="application/{{ .ApplicationID }}/device/{{ .DevEUI }}/event/{{ .EventType }}"
# Command topic template.
command_topic_template="application/{{ .ApplicationID }}/device/{{ .DevEUI }}/command/{{ .CommandType }}"
# Retain events.
#
# The MQTT broker will store the last publised message, when retain events is set
# to true. When a MQTT client connects and subscribes, it will always receive the
# last published message.
retain_events=false
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
#server="tcp://localhost:1883"
server="tcp://127.0.0.1:1883"
#server="tcp://192.168.0.1:1883"
#server="tcp://0.0.0.0:1883"
# Connect with the given username (optional)
username=""
# Connect with the given password (optional)
password=""
# Maximum interval that will be waited between reconnection attempts when connection is lost.
# Valid units are 'ms', 's', 'm', 'h'. Note that these values can be combined, e.g. '24h30m15s'.
max_reconnect_interval="1m0s"
# Quality of service level
#
# 0: at most once
# 1: at least once
# 2: exactly once
#
# Note: an increase of this value will decrease the performance.
# For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels
qos=0
# Clean session
#
# Set the "clean session" flag in the connect message when this client
# connects to an MQTT broker. By setting this flag you are indicating
# that no messages saved by the broker for this client should be delivered.
clean_session=true
# Client ID
#
# Set the client id to be used by this client when connecting to the MQTT
# broker. A client id must be no longer than 23 characters. When left blank,
# a random id will be generated. This requires clean_session=true.
client_id=""
# CA certificate file (optional)
#
# Use this when setting up a secure connection (when server uses ssl://...)
# but the certificate used by the server is not trusted by any CA certificate
# on the server (e.g. when self generated).
ca_cert=""
# TLS certificate file (optional)
tls_cert=""
# TLS key file (optional)
tls_key=""
[application_server.external_api]
jwt_secret="verysecret"
To debug I look at my log with
raspberrypi3:~$ sudo monit restart chirpstack-application-server
raspberrypi3:~$ tail -f /var/log/messages
Sep 10 16:38:11 raspberrypi3 user.info chirpstack-application-server[928]: time="2020-09-10T16:38:11Z" level=info msg="integration: configuring global integrations"
Sep 10 16:38:11 raspberrypi3 user.info chirpstack-application-server[928]: time="2020-09-10T16:38:11Z" level=info msg="integration/mqtt: TLS config is empty"
Sep 10 16:38:11 raspberrypi3 user.info chirpstack-application-server[928]: time="2020-09-10T16:38:11Z" level=info msg="integration/mqtt: connecting to mqtt broker" server="tcp://127.0.0.1:1883"
Sep 10 16:38:11 raspberrypi3 user.info chirpstack-application-server[928]: time="2020-09-10T16:38:11Z" level=info msg="api/as: starting application-server api" bind="0.0.0.0:8001" ca_cert= tls_cert= tls_key=
Sep 10 16:38:11 raspberrypi3 user.info chirpstack-application-server[928]: time="2020-09-10T16:38:11Z" level=info msg="integration/mqtt: connected to mqtt broker"
Sep 10 16:38:11 raspberrypi3 user.info chirpstack-application-server[928]: time="2020-09-10T16:38:11Z" level=info msg="integration/mqtt: subscribing to tx topic" qos=0 topic=application/+/device/+/command/down
Sep 10 16:38:11 raspberrypi3 user.info chirpstack-application-server[928]: time="2020-09-10T16:38:11Z" level=info msg="api/external: starting api server" bind="0.0.0.0:8080" tls-cert= tls-key=
Sep 10 16:38:11 raspberrypi3 user.info chirpstack-application-server[928]: time="2020-09-10T16:38:11Z" level=info msg="api/external: registering rest api handler and documentation endpoint" path=/api
Sep 10 16:38:11 raspberrypi3 user.info chirpstack-application-server[928]: time="2020-09-10T16:38:11Z" level=info msg="api/js: starting join-server api" bind="0.0.0.0:8003" ca_cert= tls_cert= tls_key=
Sep 10 16:38:11 raspberrypi3 authpriv.notice sudo: admin : TTY=pts/0 ; PWD=/home/admin ; USER=root ; COMMAND=/usr/bin/tail -f /var/log/messages
Sep 10 16:38:11 raspberrypi3 user.err chirpstack-network-server[365]: time="2020-09-10T16:38:11Z" level=error msg="gateway: handle gateway stats error" ctx_id=efaf74e6-f7ca-45c7-b60d-a26ec8cd03ab error="get application-server client error: get application-server client err
Sep 10 16:38:16 raspberrypi3 user.info chirpstack-concentratord-sx1301[505]: Frame received, uplink_id: d7762e5c-5252-4fdd-b711-8e8343128e17, count_us: 2292467156, freq: 868100000, bw: 125000, mod: LoRa, dr: SF12
Sep 10 16:38:16 raspberrypi3 user.info chirpstack-gateway-bridge[613]: time="2020-09-10T16:38:16Z" level=info msg="backend/concentratord: uplink event received" uplink_id=d7762e5c-5252-4fdd-b711-8e8343128e17
Sep 10 16:38:16 raspberrypi3 user.info chirpstack-gateway-bridge[613]: time="2020-09-10T16:38:16Z" level=info msg="integration/mqtt: publishing event" event=up qos=0 topic=gateway/b827ebfffed5b60e/event/up uplink_id=d7762e5c-5252-4fdd-b711-8e8343128e17
Sep 10 16:38:16 raspberrypi3 user.info chirpstack-network-server[365]: time="2020-09-10T16:38:16Z" level=info msg="gateway/mqtt: uplink frame received" gateway_id=b827ebfffed5b60e uplink_id=d7762e5c-5252-4fdd-b711-8e8343128e17
Sep 10 16:38:16 raspberrypi3 user.info chirpstack-network-server[365]: time="2020-09-10T16:38:16Z" level=info msg="uplink: frame(s) collected" ctx_id=bb6210f3-bec6-4b02-af79-970f4956a9ff mtype=UnconfirmedDataUp uplink_ids="[d7762e5c-5252-4fdd-b711-8e8343128e17]"
Sep 10 16:38:16 raspberrypi3 user.warn chirpstack-network-server[365]: time="2020-09-10T16:38:16Z" level=warning msg="creating insecure application-server client" server="localhost:8001"
If you have some ideas or had the same problems I would appreciate some hints.
BR,
PiLiP