Basic Station Gateway Bridge makes unreadable MQTT messages

Hey Everyone,

I am trying to add a gateway bridge to my server so I can send basic station from my gateway to it. I’ve only ever used a gateway bridge on the gateway using UDP packet forwarder → GW Bridge → MQTT Broker and am used to being able to subscribe to the MQTT Broker to view the messages for debugging.

In this setup using basic station, when I try to subscribe to the MQTT Broker the messages are unreadable:

$ mosquitto_sub -v -h 192.168.0.7 -p 1883 -t '#'

us915_1/gateway/00800000a000e250/state/conn 00800000a000e250
us915_1/gateway/00800000a000e250/event/up 
@{?_:U?4?ʣ?`^???~P~?2??
??(*Y
00800000a000e250????
                   򅻰د??"
                       ???د??0?????????=`?j?J?

us915_1/gateway/00800000a000e250/event/up 
@b ??]U??)?F-?J?  ʚ|q?w?۾?
?(*Y
00800000a000e250????
                   ???????"
                          ??????0?????????=??j??]P?

Yet it seems Chirpstack can still handle these messages as occasionally it seems to decode a message from the gateway bridge:

us915_1/gateway/00800000a000e250/event/up 
@_H??Bk??3?D\?L???ׯ
??(*Y
00800000a000e250???
                  􅻰????"
                       ???????0?????????=Aj?h?.?
application/44e81855-d8ba-46c2-9e79-751913962e0f/device/7894e80000027a0a/event/up 
{"deduplicationId":"a4cb0214-0927-43bf-b453-12df0ef6f7e1","time":"2024-04-04T15:10:44.963786+00:00","deviceInfo":
{"tenantId":"52f14cd4-c6f1-4fbd-8f87-4025e1d49242","tenantName":"ChirpStack","applicationId":"44e81855-d8ba-46c2-9e79-751913962e0f","applicationName":"Kanata Monitoring","deviceProfileId":"6c94d1f8-6bbb-42af-b877-253ecc501987","deviceProfileName":"rbs305-ath","deviceName":"ATH 1","devEui":"7894e80000027a0a","deviceClassEnabled":"CLASS_A","tags":{}},
"devAddr":"01d5485f","adr":true,"dr":3,"fCnt":3,"fPort":2,"confirmed":false,"data":"FA0AFJATgA==",
"object":{"Protocol":1.0,"ATH":{"Event":"Periodic Report","Temperature":20.9,"Humidity":19.8},"Type":"ATH","Counter":4.0},"rxInfo":
[{"gatewayId":"00800000a000e250","uplinkId":1102833320,"gwTime":"2024-04-04T15:10:44.963786+00:00","nsTime":"2024-04-04T15:10:45.407236919+00:00","timeSinceGpsEpoch":"1396278662.963786s","rssi":-66,"snr":9.25,"location":
{"latitude":45.34017,"longitude":-75.8989},"context":"AAAAAAAAAAAA5wAAAmiaLg==","metadata":
{"region_config_id":"us915_1","region_common_name":"US915"},"crcStatus":"CRC_OK"}],"txInfo":{"frequency":905300000,"modulation":{"lora":
{"bandwidth":125000,"spreadingFactor":7,"codeRate":"CR_4_5"}}}}

Is this expected behaviour? Are the MQTT messages still in basic station when they reach the MQTT Broker?

It seems like things are working normally through the UI so I was just wondering if this is something I should be worried about or not.

It looks like you’re trying to print a protobuf, which is the default gateway format used for bandwidth savings. You can switch it to JSON if you want to double the size.

The integration’s application topic that you’ve pasted looks already configured for JSON.

I prefer to use protobuf everywhere and handle the messages in code.

2 Likes

Thank you @bconway, just the answer I needed. I thought I had enabled JSON in the gateway-bridge.toml but it was still set to protobuf :man_facepalming: