Publish decoded data from app server bank to mqtt in json format

I have a functional setup and am decoding sensors, and pushing the decoded data to influx, and graphing with grafana.

Am looking for a way to also push the decoded data back into mqtt, in order to feed it to another system that can eat json from mqtt, but is not influxdb-aware.

How about the traditional/old school MQTT integration?

https://www.chirpstack.io/docs/chirpstack/integrations/mqtt.html

I think it may use JSON by default, I prefer protobuf for my stack.

1 Like

I must be missing something because that is exactly what I want.
Here is the topic path from the GW:
us918/gateway/gatewayID/event/up

Here is the path from CS:
us918/gateway/gatewayID/state
us918/gateway/gatewayID/ack
us918/gateway/gatewayID/command

I have followed the TLS guide in the documentation, generated certs and put them where the guide says, but there is no application topic being published. I have subscribed to application/# and nothing is there.
Where in the config do I set this?

[integration]

  # Enabled integrations (global).
  enabled = [
  ]

  # MQTT integration configuration.
  [integration.mqtt]

    # Event topic template.
    event_topic="us918/gateway/+/event/+"

    # Command topic.
    #
    # This is the topic on which the MQTT subscribes for receiving (enqueue) commands.
    command_topic="us918/gateway/{{ gateway_id }}/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://192.168.220.41:1883/"

Ubuntu 18.04.6 LTS
Chirpstack v4.9.0
Mosquitto v2.0.15
Multitech MTCAP-LNA3 v6.3.4

Just blew away the old config and configured from scratch and still no application topic:

# Global integration related configuration.
[integration]

  # Enabled integrations (global).
  enabled = [
  ]

  # MQTT integration configuration.
  [integration.mqtt]

    # Event topic template.
    event_topic="application/{{application_id}}/device/{{dev_eui}}/event/{{event}}"
#    event_topic="us918/gateway/+/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}}"
#   command_topic="us918/gateway/{{ gateway_id }}/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://192.168.220.41:1883/"

Influx/Grafana is still updating properly.

Have you configured your own region? Us918 is not a region. If you’re in north America you should use the topic prefix us915.

command_topic="us915/gateway/{{ gateway_id }}/command/{{ command }}"
command_topic="us915/gateway/{{ gateway_id }}/command/{{ command }}"

The TLS guide that you are talking about (all of the certificates) is not the MQTT integration (as confusing as the labeling is).

What you want to do is in your chirpstack.toml file on your Chirpstack server, set the “server=” line in the [integration.mqtt] section to the remote broker. If the file you shared was the Chirpstack.toml then you are only missing adding “mqtt” into the enabled integrations array.

1 Like

I’m a dolt, it needs t be enabled…

# Global integration related configuration.
[integration]

  # Enabled integrations (global).
  enabled = [
    "mqtt",
  ]

Working now!
mqttCSWorking

2 Likes

Will fix, that was a type when I configured.

It’s working now by adding “mqtt”, to the enabled integrations.