MQTT retaining unwanted messages

I have a simple flow, Ubuntu server, 2 Pi-4 Clients. Communication via MQTT between clients and server.
On the server I set the MQTT out node to "Retain Message", so when the client would start it would get the last message. It worked. I no longer need this, but even though I unclicked "Retain Messages", then clients are always pulling a message.

Is there some cache I need clear or what have I missed!!!

Thanks in advance.

To clear a retained message on a topic, you need to publish an empty payload with the retain flag set.

1 Like

Install the mosquitto-clients package. Then you can send the empty message to your server with the retain bit set from the command line:

mosquitto_pub -h your_server -t "yourTopic" -m "" -r

I find this easier and quicker than doing something with a flow.

Using MQTT explorer, you can select the retained item from the tree & simply click the delete button.

1 Like

Is MQTT explorer in Node-Red or is it an external app?

External application for browsing / viewing your MQTT broker (very professional & user friendly)

Wow, Very good program, handy to have, serious information in it. Thank you.

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