# MQTT Disconnect/Connect frequently

**URL:** <https://forums.losant.com/t/mqtt-disconnect-connect-frequently/3487>\
**Category:** Help\
**Tags:** mqtt\
**Created:** [December 17, 2020, 2:42pm UTC](https://forums.losant.com/t/mqtt-disconnect-connect-frequently/3487 "2020-12-17T14:42:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CHAIMAA\_DRIOUECH](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@CHAIMAA\_DRIOUECH](https://forums.losant.com/u/CHAIMAA_DRIOUECH)\
**Post date:** [December 17, 2020, 2:42pm UTC](https://forums.losant.com/t/mqtt-disconnect-connect-frequently/3487/1 "2020-12-17T14:42:19Z")

</div>

Hello,

I am using Moxa gateways as a host of my Node-red program that is connected and communicating with smart sensors via MQTT Protocol but I have noticed that my gateways keep connecting and disconnecting every 20 minutes or so which is causing some gaps in the data.

See screenshot below:

 ![unnamed](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/5/54a42d9df7e936a54cdf4e33bf660bb6ed15d3e7.png)

If anyone has experience anything similar or have an idea of what is causing it, please let me know.

Thank you!

---

<div class="post-metadata">

**Author:** ![Heath](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/heath/32/3036_2.png) [@Heath](https://forums.losant.com/u/Heath)\
**Post date:** [December 17, 2020, 4:20pm UTC](https://forums.losant.com/t/mqtt-disconnect-connect-frequently/3487/3 "2020-12-17T16:20:34Z")

</div>

Hi @CHAIMAA_DRIOUECH,

There are a few reasons why this might happen. Would you be able to tell me the rate at which your MQTT sensors are reporting?

Thank you,  
Heath

---

<div class="post-metadata">

**Author:** ![CHAIMAA\_DRIOUECH](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@CHAIMAA\_DRIOUECH](https://forums.losant.com/u/CHAIMAA_DRIOUECH)\
**Post date:** [December 17, 2020, 4:59pm UTC](https://forums.losant.com/t/mqtt-disconnect-connect-frequently/3487/4 "2020-12-17T16:59:05Z")

</div>

Hi, They are reporting every minute to Losant.

---

<div class="post-metadata">

**Author:** ![Heath](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/heath/32/3036_2.png) [@Heath](https://forums.losant.com/u/Heath)\
**Post date:** [January 4, 2021, 2:56pm UTC](https://forums.losant.com/t/mqtt-disconnect-connect-frequently/3487/5 "2021-01-04T14:56:07Z")

</div>

Thanks so much for that information. Looks like you aren’t running into a rate limit issue.

Is there anything in your device log that would indicate why the connection is closing? I would also take a look at your gateway’s connection log to see if there is any more information there.

Thank you,  
Heath
