I have two instances of broker running. One instance is for the application/network server of Chirpstack and the second is for Home Assistant. I am trying to get the second broker up and running but given I know very little about the details I seem to be struggling.
Based on reading I am under the assumption that I must post to a topic on the broker which leads me to believe I should be sending a Lora packet that contains both topic and a value. Is this correct? If not how do I proceed?
No, thats not how Chirpstack/LoRaWAN works. It is the job of the gateway bridge / MQTT forwarder to translate your LoRaWAN packet to an MQTT topic / value. If you want to forward your events to another broker after they have been processed by Chirpstack (so then the data is decrypted) look into the MQTT integration, and change the “server=” line in the [integration.mqtt] section of your chirpstack.toml to the address of the remote broker. If you need to translate the topics to a different format for home assistant, look into MQTT mirror or MQTT bridge, or create a middle man to do it yourself.
I (to the best of my knowledge ) am not running MQTT Forwarder.
I apologize as I am sure the confusion is on my side.
The gateways sole function is to receive lorawan encrypted packets and forward them to a network server. I don’t understand how the gateway has any vision into the data that it receives.
It is the job of the gateway bridge / MQTT forwarder to translate your LoRaWAN packet to an MQTT topic / value.
How is it possible that the gateway as you put it does any translation as I am under the assumption that the network server is NOT within the gateway but it’s own separate entity?
My understanding is that once the network server validates it will forward to the application server which will then decrypt the message. Furthermore I would expect the decrypted message to contain both a topic and key/value pairs. This in turn would go to a second broker which would be connected to HaSS. Can you please educate me on mistake as I am clearly missing a piece here?
The gateway has no knowledge of a large part of the packet it is sending, but it still sends metadata along with the packet (the gateway EUI, Frequency Subband, devEUI, etc…).
In your architecture the gateway sends this as a UDP packet to the Gateway Bridge - this is what translates the UDP packet to an MQTT topic / value. The gateway bridge creates the topic / value using the UDP packet metadata and the encrypted data: the topic will be something along the lines of “<region_prefix>/gateway/<gateway_id>/event/up” and the value will be all of the unencrypted metadata and a section including all of the encrypted data sent with the LoRaWAN packet.
Then Chirpstack will receive this MQTT event, decide whether it is meant for your network according to the metadata in the topic value and if it is, decrypt the encrypted section of the data using the application key. If you have the MQTT integration enabled in your chirpstack.toml (it is on by default) then Chirpstack posts the decrypted versions of the events back to the MQTT broker in topics such as:
These decrypted events are the ones that any other service such as Home Assistant would use, as the messages straight from the gateway bridge are still encrypted. You can send them to another MQTT broker by changing the “server=” line in the [integration.mqtt] section of you chirpstack.toml.
Respectfully, most of these questions are google-able or already solved on the forums / documentation. I would recommend reading up on the LoRaWAN specifications if you haven’t already, specifically the backend specifications are relevant to some of the questions here, as it outlines all the LoRaWAN packet unecnrypted metadata. And by looking through the Chirpstack documentation you can find all the data within the MQTT events being sent by the gateway bridge and forwarded back to the broker by Chirpstack: Event types - ChirpStack open-source LoRaWAN® Network Server documentation.
@Liam_Philipp …
Thank you for that response. That was EXTREMELY well written and cohesive. I have searched the internet over and over but not found the answer I was looking for. You worded that quite well and the light bulb went off.