# MQTT broker error?

**URL:** <https://discourse.nodered.org/t/mqtt-broker-error/28794>\
**Category:** General\
**Created:** [23 June 2020 10:26 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794 "2020-06-23T10:26:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Martin10](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Martin10](https://discourse.nodered.org/u/Martin10)\
**Post date:** [23 June 2020 10:26 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/1 "2020-06-23T10:26:31Z")

</div>

Hi.  
I create some flow, that contain mqtt out node, in order to connect to mqtt thingspeak broker, but after i create it the RPI just block. And now every time i start node-red it attempts to connect to he broker (although i delete this flow), and rpi blocks completely. Any help?

 ![2020-06-23-125911_800x480_scrot](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/e/1e5d01d008b8000638c962c49148795d60ce21ba.png)

---

<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:** [23 June 2020 10:44 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/2 "2020-06-23T10:44:53Z")

</div>

If you are able to get into the editor make a change and deploy you may see a message saying you have unused configuration nodes (the mqtt server node is a configuration node). Click on the hamburger menu and select Configuration nodes and it will show you the unused ones, that you can select and delete. If you can't get into the editor then stop node red and start it using  
`node-red --safe`  
That will start the editor but not the flows, so you can remove the config node and deploy (it will start the flows when you deploy).  
However you should not get a node-red hang just because it is connecting to an mqtt server. The common cause of that is that you have created an mqtt loop so you are continuously receiving and sending messages, but you said you had deleted the mqtt nodes in the flow so that cannot be the case here.

---

<div class="post-metadata">

**Author:** ![Martin10](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Martin10](https://discourse.nodered.org/u/Martin10)\
**Post date:** [23 June 2020 11:12 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/3 "2020-06-23T11:12:05Z")

</div>

I delete the whole flow, but the problem remains (i restarted) .

---

<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:** [23 June 2020 12:34 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/4 "2020-06-23T12:34:09Z")

</div>

What do you mean by deleted the flow? If you mean the nodes you see in the editor then that does not remove config nodes, as I explained.

---

<div class="post-metadata">

**Author:** ![Martin10](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Martin10](https://discourse.nodered.org/u/Martin10)\
**Post date:** [23 June 2020 13:26 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/5 "2020-06-23T13:26:53Z")

</div>

I do this  
 ![FLOWS](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/1/715fcc4f8f7055b24bcf8b0e7891c0cc3d20d7a7.jpeg)

---

<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:** [23 June 2020 14:16 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/6 "2020-06-23T14:16:07Z")

</div>

And what do you see in Configuration nodes in that menu?

If nothing there then tell us what the problem you are seeing is.

---

<div class="post-metadata">

**Author:** ![Martin10](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Martin10](https://discourse.nodered.org/u/Martin10)\
**Post date:** [23 June 2020 15:00 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/7 "2020-06-23T15:00:23Z")

</div>

when i start the node-red i've got only a few seconds before the rpi to block, so i was able to do only this pic.

 ![2020-06-23-175741_800x480_scrot](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/f/bf414223b45f02652624e5043a1cbd47a20edf53.png)

---

<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:** [23 June 2020 15:11 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/8 "2020-06-23T15:11:13Z")

</div>

@Colin told you earlier to use `node-red --safe` to start NR. Are you doing that and is it still locking up when you do that?

---

<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:** [23 June 2020 15:20 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/9 "2020-06-23T15:20:59Z")

</div>

Also I thought you said you had deleted all the flows.

---

<div class="post-metadata">

**Author:** ![Martin10](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Martin10](https://discourse.nodered.org/u/Martin10)\
**Post date:** [23 June 2020 15:57 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/10 "2020-06-23T15:57:03Z")

</div>

when i delete all flows and star the NR, the cmd says Starting as a system service (rather then locally i suppose) and for now i don't have problems. Really i don't know what happened.

---

<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:** [23 June 2020 16:04 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/11 "2020-06-23T16:04:13Z")

</div>

If you installed using the Pi install script then the command `node-red-start` starts it as a service. Instead of that you can use the command `node-red` to run it directly (after stopping it with node-red-stop.  
As I think I mentioned before you may have created an mqtt loop (so you have an mqtt subscribe which ends up, when received, publishing back to the same topic (possibly going through a number of nodes on the way. So when you publish a value it gets received by the subscribe node, which causes it to get published again etc etc. One way that can happen if using the dashboard is if you have pass through specified on a ui-switch node for example.  
If you get into the situation again then stop node-red and start it again using `node-red --safe` then you can disable all the tabs individually and deploy, then enable them again one at a time till it locks up.

---

<div class="post-metadata">

**Author:** ![Martin10](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Martin10](https://discourse.nodered.org/u/Martin10)\
**Post date:** [23 June 2020 16:38 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/12 "2020-06-23T16:38:28Z")

</div>

I thing i understand. Thank you!

---

<div class="post-metadata">

**Author:** ![Martin10](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Martin10](https://discourse.nodered.org/u/Martin10)\
**Post date:** [23 June 2020 16:48 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/13 "2020-06-23T16:48:32Z")

</div>

I try to do this project, but with DHT sensors, and i've got this error. Any help?

[https://flows.nodered.org/flow/00e8c4223c3a4e6539b75a7541abfef2](https://flows.nodered.org/flow/00e8c4223c3a4e6539b75a7541abfef2)  
 ![Function](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/7/5777e4198b5b437e258f8d0cc6c1a3339f91f0cf.jpeg)

 ![2020-06-23-193626_800x480_scrot](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/7/a707e067001d03d1fcb2247ef0cf6e2f2b6f43d5.png)

---

<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:** [23 June 2020 17:11 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/14 "2020-06-23T17:11:21Z")

</div>

Add a debug node showing what is going into the function node. You will find that the payload does not contain what the function expects.

---

<div class="post-metadata">

**Author:** ![Martin10](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Martin10](https://discourse.nodered.org/u/Martin10)\
**Post date:** [23 June 2020 17:33 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/15 "2020-06-23T17:33:41Z")

</div>

The error is the same

---

<div class="post-metadata">

**Author:** ![Martin10](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Martin10](https://discourse.nodered.org/u/Martin10)\
**Post date:** [23 June 2020 17:59 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/16 "2020-06-23T17:59:03Z")

</div>

I use MQTT.fx broker (With thingspeak) and all settings (pub/sub) in the broker are ok.Now i want to use node-red, to obtain sensor data and send it to thingspeak via mqtt protocol, using MQTT.fx broker. What i have to add to my flow, in order to do the job?

---

<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:** [23 June 2020 20:02 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/17 "2020-06-23T20:02:06Z")

</div>

I thought that Thingspeak provide the MQTT broker, so why are you using one of your own too? I suspect you do not fully understand how MQTT works, so I suggest reading through the series of guides at [https://www.hivemq.com/blog/mqtt-essentials-part-1-introducing-mqtt/](https://www.hivemq.com/blog/mqtt-essentials-part-1-introducing-mqtt/)

---

<div class="post-metadata">

**Author:** ![Martin10](https://avatars.discourse-cdn.com/v4/letter/m/a587f6/32.png) [@Martin10](https://discourse.nodered.org/u/Martin10)\
**Post date:** [23 June 2020 20:20 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/18 "2020-06-23T20:20:37Z")

</div>

I found only this  
[https://www.mathworks.com/help/thingspeak/use-desktop-mqtt-client-to-publish-to-a-channel.html](https://www.mathworks.com/help/thingspeak/use-desktop-mqtt-client-to-publish-to-a-channel.html)

---

<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:** [23 June 2020 20:23 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/19 "2020-06-23T20:23:35Z")

</div>

Work through the guides I linked to.

---

<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:** [23 June 2020 20:48 UTC](https://discourse.nodered.org/t/mqtt-broker-error/28794/20 "2020-06-23T20:48:33Z")

</div>

Also I see you have started a new thread. Please use that one for any further questions on this matter.

[Next page](https://discourse.nodered.org/t/mqtt-broker-error/28794.md?page=2)
