Mosquitto_pub help, please

I have an MQTT broker running on a Raspberry Pi (192.168.1.124). Been there for a couple of years.
I am trying to send an MQTT message to that broker from another computer using:

mosquitto_pub -h 192.168.1.124 -t cmnd/desklight/power/ -m "on" -d

This is using the same topic and the same message as in my Node Red flow.
The -d gives me:

Sending CONNECT
Receiving CONNACK (0)
Sending PUBLISH (d0, q0, r0, m1, 'cmnd/desklight/power', ... (3 bytes)
Sending DISCONNECT

But the command never gets to the light, and I see nothing on my MQTT box that is connected to the broker at 192.168.1.124 and subscribed to the cmnd/desklight/power topic.

Does anyone see what my problem may be?

For starters,

mqtt_sub -h 192.168.1.124 -t cmnd/desklight/#

Enter the command from another terminal (same or different machine) and see what you get.

You should not have a trailing / on the topic, though I don't know whether that is the problem.

Use a tool like Mqtt-explorer to see what's really on the "wire"

" For starters,
mqtt_sub -h 192.168.1.124 -t cmnd/desklight/#
Enter the command from another terminal (same or different machine) and see what you get."
This works

" You should not have a trailing / on the topic, though I don't know whether that is the problem."
That was it. I hoped it would be something subtle like that.

" Use a tool like Mqtt-explorer to see what's really on the "wire""
Thanks for the reminder. I hadn't used that tool in quite a while, and forgot that I had it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.