Regarding MQTT broker topics for uplink and downlink

Hi,

I was able to configure MQTT integration and receive uplinks on topic format “application/[ApplicationID]/device/[DevEUI]/event/up” and scedule downlink on “application/[ApplicationID]/device/[DevEUI]/command/down”.

Is there any way I can change the topics to something else like say get uplink on a topic called “AllMyUplinks” and send downlink to a device on “MyDownlink”.

The following article mentions “The default topic for scheduling downlink payloads is:”. So I was wondering is it possible to change topics which is deifferent from “Default”

Regards,
Harsha

Hi, in V3 you could originally use separete topic tepmplates for each message type, later changed to event style topics. So you could do this for example:

 # MQTT integration backend.
 [application_server.integration.mqtt]
  uplink_topic_template="application/{{ .ApplicationID }}/device/{{ .DevEUI }}/rx"
  downlink_topic_template="application/{{ .ApplicationID }}/device/{{ .DevEUI }}/tx"
  join_topic_template="application/{{ .ApplicationID }}/device/{{ .DevEUI }}/join"
  ack_topic_template="application/{{ .ApplicationID }}/device/{{ .DevEUI }}/ack"
  error_topic_template="application/{{ .ApplicationID }}/device/{{ .DevEUI }}/error"
  status_topic_template="application/{{ .ApplicationID }}/device/{{ .DevEUI }}/status"
  location_topic_template="application/{{ .ApplicationID }}/device/{{ .DevEUI }}/location"

I wouldn’t expect this to work in V4 tho.

Hi Martin,

Thank you.

So I am assuming the topics would still need the applicationID and Device EUI to route messages. My earlier question was if we gave a random topic name like “AllMyUplinks” to receive uplinks from devices and send downlink to a device on topic “MyDownlink” - without providing the application ID or device id anywhere in the topic.

I am using Chirpstack v4 deployed with docker compose.

chirpstack:
    image: chirpstack/chirpstack:4.0.4
  chirpstack-gateway-bridge-eu868:
    image: chirpstack/chirpstack-gateway-bridge:4.0.1
  chirpstack-rest-api:
    image: chirpstack/chirpstack-rest-api:4.0.4

Regards,
Harsha

Oh ok, I was thinking more like: uplink_topic_template="application/{{ .ApplicationID }}/device/{{ .DevEUI }}/allmyuplinks".

You could propbably do what you want with some mqtt magic, but usualy you just subscribe to application/+/device/+/event/up in your app and that will give you all the uplinks too.

So I am assuming the topics would still need the applicationID and Device EUI to route messages.

Well, there was originally note saying Note: the downlink_topic_template must contain both the application id and # DevEUI substitution!, so you could try, but personally I would rather use the default route.