Chirpstack MQTT service in integration how decode payload content



Use golang language to subsribe mqtt service, but playload message is like picture that. no json format. how to decode payload content body?
Thinks!

By default, integrations are in protobuf format, and use the definitions located in the ‘/api’ directory of the ChirpStack repo. Since you’re working in Go, I would recommend sticking with protobuff for performance and strong typing, over flipping it to JSON.

2 Likes

Please note that this configuration is for the application/..... topics. The data you are looking at is for the gateway topics. You might want to subscribe to application/# to make sure you are reading the correct data.

1 Like

Thank you for response!When I try to parse the payload data, I encounter an error, ‘cannot parse invalid wire-format data.’ How can I handle this issue? Thanks again.
image

image

Not every payload that comes off the application topic (top-level) will be an uplink event. You haven’t posted the code that you used to subscribe to a topic, so we don’t know. See also:

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

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

1 Like

Topic:application/d2db7767-56a4-4790-a275-61a992b95cdf/device/d896e0ff00000240/event/up


I apologize for the interruption again. After obtaining the payload through MQTT on my end, I attempted to decode it directly using Protocol Buffers (proto). However, I encountered an error as shown in the screenshot. Thank you!

This topic was automatically closed after 90 days. New replies are no longer allowed.