# MQTT remains connecting while settings have been changed

**URL:** <https://discourse.nodered.org/t/mqtt-remains-connecting-while-settings-have-been-changed/84384>\
**Category:** General\
**Tags:** mqtt\
**Created:** [8 January 2024 09:45 UTC](https://discourse.nodered.org/t/mqtt-remains-connecting-while-settings-have-been-changed/84384 "2024-01-08T09:45:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [8 January 2024 09:45 UTC](https://discourse.nodered.org/t/mqtt-remains-connecting-while-settings-have-been-changed/84384/1 "2024-01-08T09:45:46Z")

</div>

I have a device (bambulab p1s) running its own custom broker, I am trying to connect, but the mqtt node keeps its label as "connecting" and whatever settings I change it remains connecting - I do not have a good indication if the node is properly disconnecting and trying to reconnect or that it the connection is hanging - how do i determine if it disconnected ? and/or is there a timeout that can be forced ?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 January 2024 10:21 UTC](https://discourse.nodered.org/t/mqtt-remains-connecting-while-settings-have-been-changed/84384/2 "2024-01-08T10:21:45Z")

</div>

> [@bakman2](#):
>
> I do not have a good indication if the node is properly disconnecting and trying to reconnect

when you deploy a change to a node, it is destroyed and re-created.

> [@bakman2](#):
>
> I am trying to connect, but the mqtt node keeps its label as "connecting" and whatever settings I change it remains connecting

Then you either dont have the settings correct or it is unreachable.

Are you using latest Node-RED?

You can also try dynamic connection and disconnect actions while testing. Demo here: [Dynamic MQTT node's "actions-\>connect" guidance needed - #2 by Steve-Mcl](https://discourse.nodered.org/t/dynamic-mqtt-nodes-actions-connect-guidance-needed/58878/2)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [8 January 2024 10:31 UTC](https://discourse.nodered.org/t/mqtt-remains-connecting-while-settings-have-been-changed/84384/3 "2024-01-08T10:31:51Z")

</div>

> when you deploy a change to a node, it is destroyed and re-created.

I don't see this happening. ~~Also when I use dynamic subscription - 0.0.0.0 the node remains in "connecting..."~~  
Note that i need to be able to set TLS without cert verification - dynamic subscription does not have this option (?) or does it take the nodes' settings in that case ?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [8 January 2024 11:19 UTC](https://discourse.nodered.org/t/mqtt-remains-connecting-while-settings-have-been-changed/84384/4 "2024-01-08T11:19:40Z")

</div>

> [@bakman2](#):
>
> Note that i need to be able to set TLS without cert verification - dynamic subscription does not have this option (?) or does it take the nodes' settings in that case ?

Keeps the TLS setup assigned to the config.

Are you using Protocol v3.1 or V5? Try both.

> [@bakman2](#):
>
> > when you deploy a change to a node, it is destroyed and re-created.
> 
> I don't see this happening.

Are you using FULL deploy mode? Because if you are, I can gurarentee that even if you dont "see" it, it _IS_ happening (the config and the connection will be destroyed and recreated)

Lastly, you did not state your Node-RED version (v2.x does have issues holding onto old connections)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [8 January 2024 13:39 UTC](https://discourse.nodered.org/t/mqtt-remains-connecting-while-settings-have-been-changed/84384/5 "2024-01-08T13:39:09Z")

</div>

I am using 3.1, it is most likely happening then. Can't connect, but that is another issue.  
Thanks

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [9 January 2024 06:06 UTC](https://discourse.nodered.org/t/mqtt-remains-connecting-while-settings-have-been-changed/84384/6 "2024-01-09T06:06:22Z")

</div>

I got it working - the reason why it behaved weirdly, was because I had to subscribe to a specific topic directly upon connection, else it would disconnect immediately.

---

<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 January 2024 06:06 UTC](https://discourse.nodered.org/t/mqtt-remains-connecting-while-settings-have-been-changed/84384/7 "2024-01-23T06:06:30Z")

</div>

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