I create the following GatewayCommandExecRequest protobuf message in python:
>>> import gw.gw_pb2 as gateway
>>> command = gateway.GatewayCommandExecRequest()
>>> command.gateway_id = bytes.fromhex("e45f01fffeb2c7f4")
>>> command.command = "reboot"
>>> command.ExecId = "rebootGateway.py".encode("UTF-8")
>>> command.gateway_id
b'\xe4_\x01\xff\xfe\xb2\xc7\xf4'
>>> len(command.gateway_id)
8
When sending payload command.SerializeToString() to topic us915_4/gateway/e45f01fffeb2c7f4/command/exec, the gateway-bridge log shows an error decoding my message:
level=error msg="integration/mqtt: decode gateway id error" error="lorawan: exactly 8 bytes are expected" topic=us915_4/gateway/e45f01fffeb2c7f4/command/exec
I checked that the protobuf is serialized correctly:
>>> data = command.SerializeToString()
>>> data
b'\n\x08\xe4_\x01\xff\xfe\xb2\xc7\xf4\x12\x06reboot\x1a\x10rebootGateway.py'
>>> d = gateway.GatewayCommandExecRequest()
>>> d.ParseFromString(data) 36
>>> d
gateway_id: "\344_\001\377\376\262\307\364"
command: "reboot"
ExecId: "rebootGateway.py"
What is wrong ?