Mastering the chaos – subscribe to all MQTT topics of your Mosqitto server with console and Node-RED

I wanted to know which topics are active on my MQTT server and if there were some skeletons in the closet I could get rid of. Many Iot devices, Node-RED flows and surely some unused topics or old retained topics lead to more or less MQTT being a chaotic museum of topics.

This is just about finding old thing – deleting the database with retained topics is described here.

pi@raspberrypi:~ $ mosquitto_sub -v -h localhost -t '#'

In Node-RED add a “mqtt in” node and write “#” in the topic (without the quotation marks of course). Then add a debug node and connect both. Hit the deploy button and select the debug window below the deploy button and select the debug node as debug source.

This shows you all retained topics and incoming not retained ones.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.