in the chirpstack configuration i want to point to an external mqtt broker:
[integration.mqtt]
server = “mqtt://localhost:1883”
Dynamically configuring credentials using tags
username_template = “{{ .Tags.mqtt_username }}”
password_template = “{{ .Tags.mqtt_password }}”
is this the correct configuration? why in the logs of badusername
Do you mean you want to use an external MQTT broker for the backhaul of Chirpstack (i.e the communication between the gateways and Chirpstack), if that is the case you would have to change the MQTT backend section in your regional .toml file, and the integration section in your gateway bridge / mqtt forwarder.
If you are only trying to get the integration going, to forward decrypted MQTT device events to an external broker. Then you just need to change the server= line you referenced there to the IP of the external broker. If you are looking to add credentials to that here is the full list of configuration options for the MQTT integration:
# MQTT integration configuration.
[integration.mqtt]
# Event topic template.
event_topic="application/{{application_id}}/device/{{dev_eui}}/event/{{event}}"
# Command topic.
#
# This is the topic on which the MQTT subscribes for receiving (enqueue) commands.
command_topic="application/{{application_id}}/device/{{dev_eui}}/command/{{command}}"
# Use JSON encoding instead of Protobuf (binary).
json=true
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://127.0.0.1:1883/"
# Connect with the given username (optional)
username=""
# Connect with the given password (optional)
password=""
# 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=false
# 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. If left blank,
# a random id will be generated by ChirpStack.
client_id=""
# Keep alive interval.
#
# This defines the maximum time that that should pass without communication
# between the client and server.
keep_alive_interval="30s"
# 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 (PKCS#8) (optional)
tls_key=""
Hi Philipp!
I managed to do the tests. Thank you.
To simplify my operation even more. I virtualized my chirpstack and use the Tago platform. And through HTTP integration, I send the information to Tago. I just need to register my gateways, then create the applications and add the Lora devices. In Tago, I only add the devices with the Everynet customization.
The payloads arrive perfectly without any major challenges.