# MQTT node output ghost topics

**URL:** <https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448>\
**Category:** General\
**Created:** [9 February 2020 11:23 UTC](https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448 "2020-02-09T11:23:03Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [9 February 2020 11:23 UTC](https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448/1 "2020-02-09T11:23:03Z")

</div>

I have 11 flows in my node red with a number of MQTT outputs. Looking at the outputs in MQTT explorer I have four topics, labeled Random1, Random2, Random3, Random4 that always output a 0. My problem is that I don't have any MQTT nodes outputting that information now. At one time I did set these up but decided to go a different direction but these outputs remain. I have gone through every flow, every node, looked at every item on the side bar but cannot find where this information is coming from. I have rebooted the pi several times thinking it was something transient but the outputs survive the reboot and when the pi comes back up the information is there. I can work around this problem but curious to know what it could be. I don't think posting flows would help since I can't find this in any flow.  
Thoughts anyone?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 February 2020 11:39 UTC](https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448/2 "2020-02-09T11:39:06Z")

</div>

Do they ever change value when you watch or is it that they appear once when you subscribe to them? If the latter then it means that you published them as Retained topics which means that the MQTT server remembers the value even if you never publish to it again. If you use mosquitto then you can clear these out using the command  
`mosquitto_pub -t <topic> -r -n`  
or in your particular case  
`mosquitto_pub -t Random1 -r -n`

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [9 February 2020 11:42 UTC](https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448/3 "2020-02-09T11:42:29Z")

</div>

They never change value, ran the commands you suggested to no effect. The values do seem to be refreshing as the values flash every second or so.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 February 2020 11:47 UTC](https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448/4 "2020-02-09T11:47:10Z")

</div>

If you use the command line to get them you can confirm whether they are being published to  
`mosqitto_sub -t Random1`  
You will get a new line each time a value is published. If you do see new values then what happens if you stop node-red whilst leaving the mosquitto\_sub command running? If they stop then start node red again and disable tabs in the editor till it stops, then you know where to look.

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [9 February 2020 12:02 UTC](https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448/5 "2020-02-09T12:02:01Z")

</div>

I disabled every tab in node red and the topics are still there. Interestingly there are two others that are still there also although they don't give me any trouble.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 February 2020 12:11 UTC](https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448/6 "2020-02-09T12:11:25Z")

</div>

Was that using mosquitto\_sub?  
What if you stop node-red? Do you still see additional lines of output in mosquitto\_sub?

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [9 February 2020 12:17 UTC](https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448/7 "2020-02-09T12:17:12Z")

</div>

I stopped node red using 'node-red stop' I continued to see the output in mosquitto. I disabled every tab and rebooted and still see the topics in MQTT explorer.

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [9 February 2020 12:18 UTC](https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448/8 "2020-02-09T12:18:07Z")

</div>

Am I to the point of uninstalling then reinstall mosquitto?

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [9 February 2020 12:31 UTC](https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448/9 "2020-02-09T12:31:56Z")

</div>

So I uninstalled using 'sudo apt-get purge --remove mosquitto\*' then reinstalled. When I reinstalled the topics came back. Didn't remove any directories when I did it though. Late here , time for some shut eye. I will tackle this again later, thanks for your help Colin

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [9 February 2020 13:08 UTC](https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448/10 "2020-02-09T13:08:40Z")

</div>

have you tried restarting MQTT explorer and disconnecting/reconnecting with a fresh client id? They might be leftovers from that time that you were experimenting with them, and as long as the explorer is open they will stay in view.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [9 February 2020 13:47 UTC](https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448/11 "2020-02-09T13:47:18Z")

</div>

> [@gerry](#):
>
> I stopped node red using 'node-red stop' I continued to see the output in mosquitto. I disabled every tab and rebooted and still see the topics in MQTT explorer.

Have you confirmed that node-red is definitely stopped? Check you can't connect from the browser. If you still see repeated messages appearing in mosquitto\_sub when node-red is stopped then obviously it is not node-red publishing the data. Could it be another device publishing it? The next thing to look at is the mosquitto log, there you should be able to see which device is connected. On a linux system that will probably be in /var/log/mosquitto/mosquitto.log.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [9 February 2020 14:46 UTC](https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448/12 "2020-02-09T14:46:07Z")

</div>

Do you have anyother devices (Wemos etc) that are on your network that might be publishing?

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [9 February 2020 21:16 UTC](https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448/13 "2020-02-09T21:16:55Z")

</div>

To answer zenofmud there was absolutely no chance it was another device on the network. So, of course that is what it turned out to be. My development pi had the flow on it that I thought I had deleted. But there were so many tabs it turns out there was another one way in the back that I missed. Deleted that flow and everything works normally.  
Thanks all for the help

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [9 February 2020 21:53 UTC](https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448/14 "2020-02-09T21:53:14Z")

</div>

I took this as a good time to clean up my development pi.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [23 February 2020 21:53 UTC](https://discourse.nodered.org/t/mqtt-node-output-ghost-topics/21448/15 "2020-02-23T21:53:16Z")

</div>

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