chirpstack / chirpstack-gateway-bridge

ChirpStack Gateway Bridge abstracts Packet Forwarder protocols into Protobuf or JSON over MQTT.
https://www.chirpstack.io
MIT License
415 stars 269 forks source link

Commands not sent to basic station #155

Closed istina-iot closed 4 years ago

istina-iot commented 4 years ago

Is this a bug or a feature request?

Bug

What did you expect?

command to basic station is sent

What happened?

command to basic station is not sent

What version are your using?

3.6

How can your issue be reproduced?

Send MQTT message to topic gateway/xxxxx/command/raw with payload

{
  "msgtype"  : "runcmd",
  "command"  : "/sbin/reboot"
}

arguments field optional

Could you share your log output?

Bridge report: gateway ID is zero, payload is empty.

INFO[8256] integration/mqtt: raw packet-forwarder command received  gateway_id=0000000000000000 raw_id=00000000-0000-0000-0000-000000000000
ERRO[8256] raw packet-forwarder command error            error="raw packet-forwarder command payload is empty"
brocaar commented 4 years ago
{
  "msgtype"  : "runcmd",
  "command"  : "/sbin/reboot"
}

That is not the payload you should send as MQTT payload, see: https://www.chirpstack.io/gateway-bridge/payloads/commands/#raw---raw-packet-forwarder-command.

The [BASE64 ENCODED BLOB] must be the payload you are sending, in your case the base64 encoded JSON. Or if you are using the Protobuf marshaler, use:

https://github.com/brocaar/chirpstack-api/blob/master/protobuf/gw/gw.proto#L407