# MQTT No Longer Works

**URL:** <https://discourse.nodered.org/t/mqtt-no-longer-works/87182>\
**Category:** General\
**Created:** [12 April 2024 08:07 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182 "2024-04-12T08:07:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)\
**Post date:** [12 April 2024 08:07 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/1 "2024-04-12T08:07:27Z")

</div>

Hi,  
I have been using the same system for years where i receive mqtt Topics to a raspberry pi for a set of gauges, it then has an mqtt out node which sends the Topic to a pc which displays the same gauges, but now all of a sudden the gauges on the pc do not work, the mqtt out node on the pi always says connecting, the ip addresses are static and still the same, any help would be appreciated.  
Thanks  
Stuart

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [12 April 2024 08:21 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/2 "2024-04-12T08:21:18Z")

</div>

Hey Stuart.

Ok, could you help with _who is what_ on your network.

The MQTT broker is...... IP address, machine (System), and the machines connected to it.  
ie: The one sending the messages and the one receiving them.  
So there could be 3 machines.

Things to check:  
On the sending machine:  
Double click on the `MQTT-OUT` node and check the configuration.  
I know this sounds silly if things are static, but it is really worth double checking them then you can move on with 100% certainty.

# P.S.

On the broker:  
If a ras-pi/ubuntu type machine.  
Check you can send/receive messages.

(You will/may need more stuff installed - basic though)

From the CLI/Terminal:

```auto
## How to send MQTT messages

-h HOST
-t TOPIC
-m MESSAGE
## comments above. Commands below.

mosquitto_sub -h 192.168.1.10 -t channel_name

mosquitto_pub -h 192.168.1.10 -t channel_name -m "Hi this is a message"

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [12 April 2024 08:23 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/3 "2024-04-12T08:23:36Z")

</div>

Also, double-check whether you have updated your broker. In the past, I've several times noted that Mosquitto has changed parameters which have broken my installations.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [12 April 2024 08:24 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/4 "2024-04-12T08:24:20Z")

</div>

Is the MQTT broker on the Pi or elsewhere?  
What broker software are you using?  
Did you make any changes / operating system updates?

Edit - oops there were no replies when I started typing!

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [12 April 2024 08:27 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/5 "2024-04-12T08:27:18Z")

</div>

(It's better two people - or more - say the same thing, than no one.)

😉

---

<div class="post-metadata">

**Author:** ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)\
**Post date:** [12 April 2024 08:43 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/6 "2024-04-12T08:43:31Z")

</div>

HI guys,

I have incoming mqtt node on a rasberry pi ip address 192.168.2.80 and the gauges work perfectly, I then have an mqtt out node which is setup to send to a pc at 192.168.2.66 , at the pc end i have an incoming mqtt node which receives the sent topic and again is sent to a gauge, it all worked for about 8 years but now it does not work, I suspect that updating may have broken it, also I do not use username and password on the mqtt.

node red version pi = 0.18.7  
node red version on pc =3.0.2

Thanks  
Stuart

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [12 April 2024 08:45 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/7 "2024-04-12T08:45:41Z")

</div>

Reading what you say:

> [@acestu](#):
>
> I have incoming mqtt node on a rasberry pi ip address 192.168.2.80 and the gauges work perfectly, I then have an mqtt out node which is setup to send to a pc at 192.168.2.66

Is worrying.

The only IP address you should enter is the BROKER's address.

All messages are sent to .... everyone.  
If the machine has an `MQTT IN` node, it _gets_ the message.

I fear there is a problem with things.

(Sorry)

Could you _show_ us:  
The IP address of the machine _sending_ the messages - from where the values come.

The IP address of the BROKER.

The IP addresses of any machines that _subscribe_ to the topics. (ie: That you want to show the values on their respective gauges.)

It may also be handy to post screen shots of the `MQTT configuration` on all the machines.

---

<div class="post-metadata">

**Author:** ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)\
**Post date:** [12 April 2024 08:57 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/8 "2024-04-12T08:57:19Z")

</div>

Hi,  
I have just tried updating node red on the pi with the script from the website and it says that node red ver 3 does no longer support node js 4, so do i have to update node js first ?

Thanks  
Stuart

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [12 April 2024 08:59 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/9 "2024-04-12T08:59:57Z")

</div>

> [@acestu](#):
>
> I have incoming mqtt node on a rasberry pi ip address 192.168.2.80 and the gauges work perfectly, I then have an mqtt out node which is setup to send to a pc at 192.168.2.66

No offence but this sounds like you have the wrong idea of how MQTT works.  
You do not "send" an MQTT message to a specific destination, instead you "publish" the message, and any client can "subscribe" to receive it.

> [@acestu](#):
>
> I have incoming mqtt node on a rasberry pi ip address 192.168.2.80

The data is arriving by MQTT? So what broker and topic does the mqtt-in node connect and subscribe to?  
Why do you need an mqtt-out node to republish the same data - can't your PC subscribe to the same broker and topic as the Pi and so get the same data?

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [12 April 2024 09:03 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/10 "2024-04-12T09:03:19Z")

</div>

> [@acestu](#):
>
> I have just tried updating node red on the pi with the script from the website and it says that node red ver 3 does no longer support node js 4, so do i have to update node js first ?

Good grief! On my Pi node.js is version 20.12.1.

If the Raspberry Pi install script won't work because of a very old node.js version, try overriding it by adding --node18 or --node20 to the command (outside the brackets).

```auto
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node20

```

This should update node.js as well as Node-red.

---

<div class="post-metadata">

**Author:** ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)\
**Post date:** [12 April 2024 09:08 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/11 "2024-04-12T09:08:07Z")

</div>

Hi,  
I am just trying to reinstall now, fingers crossed

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [12 April 2024 09:11 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/12 "2024-04-12T09:11:16Z")

</div>

Assuming it installs OK, start Node-red and use Manage Palette to apply any updates to your nodes. Then restart NR.

---

<div class="post-metadata">

**Author:** ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)\
**Post date:** [12 April 2024 09:13 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/13 "2024-04-12T09:13:58Z")

</div>

ok it got 3 green ticks and then said nodejs is not installed  
install node with a red x Bad install node.js is missing - exit

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [12 April 2024 09:15 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/14 "2024-04-12T09:15:02Z")

</div>

What install command did you use?

---

<div class="post-metadata">

**Author:** ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)\
**Post date:** [12 April 2024 09:16 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/15 "2024-04-12T09:16:17Z")

</div>

The one you just told me, the script off the website and then "space" --node20

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [12 April 2024 09:22 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/16 "2024-04-12T09:22:04Z")

</div>

Hmm.

If you do `sudo apt update && sudo apt list --upgradeable`, does node.js show up as a potential update?

It might be useful to update the OS before trying any further with the Node-red install script, or else try once more with --node18

---

<div class="post-metadata">

**Author:** ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)\
**Post date:** [12 April 2024 09:27 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/17 "2024-04-12T09:27:20Z")

</div>

ok Hit 4 has an ip address for [deb.nodesource.com/node\_20.x](http://deb.nodesource.com/node_20.x) nodistro InRelease

---

<div class="post-metadata">

**Author:** ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)\
**Post date:** [12 April 2024 09:33 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/18 "2024-04-12T09:33:48Z")

</div>

it also says raspbian stretch release does no longer have a release file

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [12 April 2024 09:40 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/19 "2024-04-12T09:40:33Z")

</div>

If you are running Stretch I suggest buying a new SD card and moving to Bookworm.

Install and update the OS, install Node-red.  
Then copy your flows file from the old SD card (it should be /home/pi/.node-red/ flows.json, some older NR versions used flows\_hostname.json). There is a credentials file flows\_cred.json too which holds for example MQTT broker details.

---

<div class="post-metadata">

**Author:** ![acestu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/acestu/32/90408_2.png) [@acestu](https://discourse.nodered.org/u/acestu)\
**Post date:** [12 April 2024 09:47 UTC](https://discourse.nodered.org/t/mqtt-no-longer-works/87182/20 "2024-04-12T09:47:29Z")

</div>

Hi, it sounds like the os is ancient and I need to start over, might buy a new pi and get it up and running first, I will copy my flows first and send it via email, thanks for all your help it was most appreciated

p.s. is there a preferred model of pi or will any work ?

Thanks  
Stuart

[Next page](https://discourse.nodered.org/t/mqtt-no-longer-works/87182.md?page=2)
