# Mqtt node issue

**URL:** <https://discourse.nodered.org/t/mqtt-node-issue/89733>\
**Category:** General\
**Created:** [24 July 2024 18:21 UTC](https://discourse.nodered.org/t/mqtt-node-issue/89733 "2024-07-24T18:21:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gazala](https://avatars.discourse-cdn.com/v4/letter/g/c57346/32.png) [@Gazala](https://discourse.nodered.org/u/Gazala)\
**Post date:** [24 July 2024 18:21 UTC](https://discourse.nodered.org/t/mqtt-node-issue/89733/1 "2024-07-24T18:21:36Z")

</div>

Mqtt node gets connected intermittently ie its status fluctuates from “disconnected” to “connecting” & then “connected” & then back to “disconnected”. Kindly help to get it connected consistently

 ![1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/3/a32b18362a32cace881daeb4b6c634db92919d01.png)  
 ![2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/b/5bcd2c54f028fa3d83b966eb91f26a7ee672f630.jpeg)  
 ![3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/0/f0c82afcbe6b92fff2ea9264690833998568a0f2.jpeg)  
 ![4](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b2600f92c4697ce2d4e1c72c8cf13db618668a55.jpeg)

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [24 July 2024 18:39 UTC](https://discourse.nodered.org/t/mqtt-node-issue/89733/2 "2024-07-24T18:39:05Z")

</div>

Same question has been posted to OPTO 22

And they have responded.

> **[MQTT client from Groov EPIC node red keep getting disconnected to azure...](https://forums.opto22.com/t/mqtt-client-from-groov-epic-node-red-keep-getting-disconnected-to-azure-eventgrid-mqtt-broker/5717)**
>
> Hi, I am running MQTT broker in microsoft azure eventgrid and I have generated certificates and keys to connect the Grooc EPIC nodered MQTT out client to eventgrid mqtt broker. When I deploy i could see it is connected for 10 seconds. After that...

Maybe its a network problem with your device or maybe event grid itself?

Doesn't seem related to Node RED IMO - but then I don't do much MQTT (but when I do its fine) - I don't use any 3rd Party appliance.

---

<div class="post-metadata">

**Author:** ![greengolfer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/greengolfer/32/28276_2.png) [@greengolfer](https://discourse.nodered.org/u/greengolfer)\
**Post date:** [25 July 2024 08:40 UTC](https://discourse.nodered.org/t/mqtt-node-issue/89733/3 "2024-07-25T08:40:27Z")

</div>

MQTT connection in Node Red is rock solid.  
If the network or the other device is flaky, then you might see this. I’d look there.

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [25 July 2024 10:16 UTC](https://discourse.nodered.org/t/mqtt-node-issue/89733/4 "2024-07-25T10:16:57Z")

</div>

The usual reason for MQTT clients cycling back and forth from connected/disconnected is that there is more than one client connecting with the same client id.

MQTT client ids must be unique, the spec says that when a second client connects with the same client id, the broker MUST disconnect the first. This usually results in the first client trying to connect again, which kicks off the other and this then repeats until the problem is fixed.

---

<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 October 2024 10:17 UTC](https://discourse.nodered.org/t/mqtt-node-issue/89733/5 "2024-10-23T10:17:51Z")

</div>

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