failing when sending a command via MQTT

Hi, I have been stuck trying to send commands via mosquitto_pub.
I have a notebook/server with Ubuntu server where I install chirpstack and chirpstack gateway bridge, for the gateway, I am using the Dragino DLOS8, and for a node, a Dragino LT-22222-L which has a relay output.

I can send commands to the LT-22222-L from the WebUI without a problem, but nothing happens when I try to send commands via mosquitto_sub.

I get into the server via SSH and I use mosquitto_sub -d -h localhost -p 1883 -t '#' to “see” what is going on with the commands when I send a command from the WebUI, it shows messages from the topic au915_2/gateway/a84041ffff252c08/command/down

to send a command via mosquitto_sub, first, I get into the notebook/server via SSH from another terminal and then I use mosquitto_pub -d -h localhost -p 1883 -t "application/861cbd58-9d39-4046-a074-b6d47e40dec7/device/a8404152d185b432/command/down" -m "{ "devEui": "a8404152d185b432", "confirmed": true, "fPort": 10, "data": "AwEA" }", with this action i get this output from the other terminal Client (null) received PUBLISH (d0, q0, r0, m0, 'application/861cbd58-9d39-4046-a074-b6d47e40dec7/device/a8404152d185b432/command/down', ... (68 bytes)) { devEui: a8404152d185b432, confirmed: true, fPort: 10, data: AwEA } but no action is made from the node.

the only modification that I made to the chirpstack-gateway-bridge.toml file is that the marshaler is set to “json” so the output of the MQTT messages is readable

any comment is welcome.

After triggering:

mosquitto_pub -d -h localhost -p 1883 -t "application/861cbd58-9d39-4046-a074-b6d47e40dec7/device/a8404152d185b432/command/down" -m "{ "devEui": "a8404152d185b432", "confirmed": true, "fPort": 10, "data": "AwEA" }"

And monitoring your MQTT broker is there post to au915_2/gateway/a84041ffff252c08/command/down like when using the UI?

There was no post like when WebUI just the message, but I kept trying with the mosquitto_pub command, and it turned out it was a problem formatting the message.

mosquitto_pub -h localhost -p 1883 -t 'application/861cbd58-9d39-4046-a074-b6d47e40dec7/device/a8404152d185b432/command/down' -m '{"devEui":"a8404152d185b432","confirmed":true,"fPort":5,"data":"AwAA"}'

This command works without a problem. Both the topic and the message need to be in single quotation marks(’ '), but inside the JSON, they need to be in double quotation marks(" ").

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