Bit confused here, I have this config for my gateway on a raspberry pi (using v4 chirpstack os):
# This configuration provides a Semtech UDP packet-forwarder backend and
# integrates with a MQTT broker. Many options and defaults have been omitted
# for simplicity.
#
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
# configuration example and documentation.
[general]
# debug=5, info=4, warning=3, error=2, fatal=1, panic=0
log_level=4
# Log to syslog.
#
# When set to true, log messages are being written to syslog.
log_to_syslog=true
# Gateway backend configuration.
[backend]
# Backend type.
type="concentratord"
# ChirpStack Concentratord backend.
[backend.concentratord]
# Check for CRC OK.
crc_check=true
# Event API URL.
event_url="ipc:///tmp/concentratord_event"
# Command API URL.
command_url="ipc:///tmp/concentratord_command"
[integration]
marshaler="protobuf"
[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/#"
[integration.mqtt.auth]
type="generic"
[integration.mqtt.auth.generic]
# server="ssl://mqtt-alpha.joelhowse.com:8883"
servers=[
"tcp://mqtt-alpha.joelhowse.com:1883"
]
And then have another server where I’m running the mosquitto broker and chirpstack service, I did initially try set up TLS but decided I need to get it running first, and then add that after if I need.
On my server, the chirpstack service has the config:
Logging.
[logging]
# Log level.
#
# Options are: trace, debug, info, warn error.
level="info"
# PostgreSQL configuration.
[postgresql]
# PostgreSQL DSN.
#
# Format example: postgres://<USERNAME>:<PASSWORD>@<HOSTNAME>/<DATABASE>?sslmode=<SSLMODE>.
#
# SSL mode options:
# * disable - no SSL
# * require - Always SSL (skip verification)
# * verify-ca - Always SSL (verify that the certificate presented by the server was signed by a trusted CA)
# * verify-full - Always SSL (verify that the certification presented by the server was signed by a trusted CA and the server host name matches the one in the certificate)
dsn="postgres://chirpstack:chirpstack@localhost/chirpstack?sslmode=disable"
# Max open connections.
#
# This sets the max. number of open connections that are allowed in the
# PostgreSQL connection pool.
max_open_connections=10
# Min idle connections.
#
# This sets the min. number of idle connections in the PostgreSQL connection
# pool (0 = equal to max_open_connections).
min_idle_connections=0
# Redis configuration.
[redis]
# Server address or addresses.
#
# Set multiple addresses when connecting to a cluster.
servers=[
"redis://localhost/",
]
# TLS enabled.
tls_enabled=false
# Redis Cluster.
#
# Set this to true when the provided URLs are pointing to a Redis Cluster
# instance.
cluster=false
# Network related configuration.
[network]
# Network identifier (NetID, 3 bytes) encoded as HEX (e.g. 010203).
net_id="000000"
# Enabled regions.
#
# Multiple regions can be enabled simultaneously. Each region must match
# the 'name' parameter of the region configuration in '[[regions]]'.
enabled_regions=[
"au915_0",
]
# API interface configuration.
[api]
# interface:port to bind the API interface to.
bind="0.0.0.0:8080"
# Secret.
#
# This secret is used for generating login and API tokens, make sure this
# is never exposed. Changing this secret will invalidate all login and API
# tokens. The following command can be used to generate a random secret:
# openssl rand -base64 32
secret="__probably shouldn't show this__"
where everything there seems to be working well. I’ve removed all other configuration files except region_au915_0.toml
which looks like:
# This file contains an example AU915 example (channels 0-7 + 64).
[[regions]]
# Name is an use-defined identifier for this region.
name="au915_0"
# Common-name refers to the common-name of this region as defined by
# the LoRa Alliance.
common_name="AU915"
# Gateway configuration.
[regions.gateway]
# Force gateways as private.
#
# If enabled, gateways can only be used by devices under the same tenant.
force_gws_private=false
# Gateway backend configuration.
[regions.gateway.backend]
# The enabled backend type.
enabled="mqtt"
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="au915_0/gateway/+/event/+"
# Command topic template.
command_topic="au915_0/gateway/{{ gateway_id }}/command/{{ command }}"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
# server="tcp://localhost:1883"
server="tcp://mqtt-alpha.joelhowse.com:1883"
qos=0
(The mosquitto broker is running on the same machine so it should be able to connect locally but just using the same hostname for completeness).
My gateway currently doesn’t have any devices connected (that’s a problem for another day) but I can’t seem to get the chirpstack server to recognise the gateway.
In the mosquitto logs you can see the gateway is successfully communicating with the broker because I see:
au915_0/gateway/e45f01fffe571757/state/conn e45f01fffe571757
au915_0/gateway/e45f01fffe571757/event/stats
????Ǟ(R
modelrak_2245_au915R
config_versionR
hal_versionVersion: 5.0.1;R#
concentratord_version
4.0.0-rc.1?e45f01fffe571757
au915_0/gateway/e45f01fffe571757/event/stats
???ː?(R
modelrak_2245_au915R
config_versionR
hal_versionVersion: 5.0.1;R#
concentratord_version
4.0.0-rc.1?e45f01fffe571757
au915_0/gateway/e45f01fffe571757/event/stats
̩????(R
modelrak_2245_au915R
config_versionR
hal_versionVersion: 5.0.1;R#
concentratord_version
4.0.0-rc.1?e45f01fffe571757
au915_0/gateway/e45f01fffe571757/event/stats
So it’s clearly sending through the stats events. In the UI, when I add the gateway with the same ID I would expect to see the ‘Last Seen’ field set, but it just says never. I can’t for the life of me figure out where the communication is failing??
Any ideas?? What am I doing wrong?