How to phrase protobuf command to gateway bridge

I’ve been trying to use mosquitt_pub to send a reboot command to a gateway. I had this figured when the marshaler in /etc/chirpstack-gateway-bridge/chirpstack-gateway-bridge.toml is set to json, not protobuf. However, I have a gateway deployed in the field where I forgot to change this configuration (all other aspects of the configuration are correct and working). I was wondering how to phrase the same message I had with a json message in protobuf. The original message is as such:

mosquitto_pub -t “gateway/{{ Gateway ID }}/command/exec” -f mqtt.json --debug

mqtt.json:

{
“gatewayID”:" “(( base64 encrypted gateway ID ))”,
“command”:“reboot”,
“token”: “EA==”
}

I’ve read that I should use the GatewayCommandExecRequest message from gw.proto but not sure exactly how to approach that.

Please see https://github.com/brocaar/chirpstack-api, which contains the Protobuf files + some language implementations. https://developers.google.com/protocol-buffers/docs/tutorials might also be helpful.

1 Like