User avatar
marine_hm
Posts: 108
Joined: Tue Mar 07, 2017 4:27 pm

How to delete INVALID MQTT Topics shown in "verbose"

Tue Jan 31, 2023 3:31 pm

@DougieLawson
I hope my topic made sense..
When I was testing out MQTT and how to use it. I used several Topics, Retained, not retained, "QOC" or whatever it was called.
Now I have it all sorted out. Kind of.

Now when I have the Control panel open in "Verbose"; displays Topic; Messages as the server receives them.
It starts out with all the bogus topics I used while in testing phase. Even after rebooting the RPi3b How do I delete, remove or whatever to get rid of those bogus topics?
LED, BLED, BLED01, led and TwoDogs were the ones on my machine. Not that the names matter. I just posted them for my own memory/reference.

johngholman
Posts: 23
Joined: Mon Jul 22, 2019 4:06 pm

Re: How to delete INVALID MQTT Topics shown in "verbose"

Tue Jan 31, 2023 3:48 pm

If these are retained messages you should be able to get rid of them by sending another retained message with the same topic and no payload

e.g. mosquitto_pub -r -t TwoDogs -m ""

MiscBits
Posts: 1406
Joined: Wed Jan 27, 2021 12:48 pm

Re: How to delete INVALID MQTT Topics shown in "verbose"

Tue Jan 31, 2023 4:39 pm

Though I agree with johngholman, can I chip in a few thoughts:
  1. Think about running a test broker (if you have a spare machine - even a zero is fine for this).
  2. If you do not have a test machine, precede test topics with "test" - you could even code this as standard in a little function and trigger this with the command line parameter.
  3. I use MQTT Explorer on my Macs and that has a delete function in it.

User avatar
DougieLawson
Posts: 42380
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK

Re: How to delete INVALID MQTT Topics shown in "verbose"

Tue Jan 31, 2023 5:20 pm

Languages using left-hand whitespace for syntax are ridiculous

DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.

The use of crystal balls and mind reading is prohibited.

User avatar
marine_hm
Posts: 108
Joined: Tue Mar 07, 2017 4:27 pm

Re: How to delete INVALID MQTT Topics shown in "verbose"

Wed Feb 01, 2023 4:43 pm

Yes. That worked. Thank you VERY much!

Return to “Beginners”