MQTT Connectors disconnect

Posted on
Wed Jan 18, 2023 9:51 am
boisy offline
User avatar
Posts: 273
Joined: Jun 25, 2013

MQTT Connectors disconnect

I'm seeing an issue with my MQTT connector devices. At times, they appear to disconnect from my localhost MQTT broker. Once disconnected, I have to check and recheck the "Comm Enabled" checkmark to kick the connector back to the connected state.

Why doesn't the connector attempt to reconnect to the broker?

Posted on
Wed Jan 18, 2023 10:14 am
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Connectors disconnect

What broker?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Jan 18, 2023 11:54 am
Colly offline
Posts: 535
Joined: Jan 16, 2016
Location: Ireland

Re: MQTT Connectors disconnect

I highlighted similar issues previously, see topic viewtopic.php?f=316&t=26487. I never followed up any further with Joe.
I have a trigger that restarts the connector once it disconnects. It can happen quite often, sometimes 2 - 3 times a day with no obvious link to other activity on the network. Looking back right now the last time was yesterday morning, nothing today as of yet.

Posted on
Wed Jan 18, 2023 12:05 pm
boisy offline
User avatar
Posts: 273
Joined: Jun 25, 2013

Re: MQTT Connectors disconnect

Joe,

I'm using your MQTT broker plugin, so it's all local.

Posted on
Wed Jan 18, 2023 12:10 pm
cuhouse offline
Posts: 144
Joined: Feb 21, 2007
Location: Virginia, USA

Re: MQTT Connectors disconnect

I had a similar issue back Sept 2019 but was resolved here
https://github.com/FlyingDiver/Indigo-MQTT/issues/4/

Indigo 2022.1.2, Big Sur v11.7.1, Dedicated late 2014 Mac Mini, PowerLinc 2413U.

Posted on
Wed Jan 18, 2023 12:58 pm
Colly offline
Posts: 535
Joined: Jan 16, 2016
Location: Ireland

Re: MQTT Connectors disconnect

cuhouse wrote:
I had a similar issue back Sept 2019 but was resolved here
https://github.com/FlyingDiver/Indigo-MQTT/issues/4/

I think this only happened in more recent versions of the plugin for me. I'm wondering did that resolution get lost in later versions - probably not as you don't appear to have any recent issues.

Posted on
Wed Jan 18, 2023 1:46 pm
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Connectors disconnect

boisy wrote:
Why doesn't the connector attempt to reconnect to the broker?


Honestly, because it's usually a broker problem, so just blindly attempting to reconnect isn't the solution.

I have not seen any issues with frequent disconnects with the Broker plugin. If this is happening often, please open a GitHub issue with logs from both the Broker and Connector plugins.

You might want to trigger on changes to the Connector status so you get an alert when this happens. You could also restart the Connector device when it happens.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Jan 18, 2023 2:43 pm
boisy offline
User avatar
Posts: 273
Joined: Jun 25, 2013

Re: MQTT Connectors disconnect

Thanks Joe. I've setup a trigger to notify me the next time this occurs. I'll try to establish rhyme and reason.

Posted on
Wed Jan 18, 2023 7:02 pm
boisy offline
User avatar
Posts: 273
Joined: Jun 25, 2013

Re: MQTT Connectors disconnect

Joe,

One thing I have noticed is that when I restart my iMac and Indigo launches, the connectors are in "Connection Failed" state. Looking at the log, it appears the MQTT Connector plug-in starts before the MQTT Broker. It would appear the order of the plug-in stating might affect this?
Attachments
Screen Shot 2023-01-18 at 7.01.38 PM.png
Screen Shot 2023-01-18 at 7.01.38 PM.png (324.66 KiB) Viewed 2495 times

Posted on
Wed Jan 18, 2023 7:34 pm
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Connectors disconnect

What version of Indigo you running? It shouldn't be doing that. There was a recent change to the plugin API to provide startup order hints.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Wed Jan 18, 2023 7:36 pm
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Connectors disconnect

Well darn, it's doing it on my dev system too. I need to check the hints and then report that to the guys.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Jan 19, 2023 8:16 am
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Connectors disconnect

OK, so I confirmed the plugins are starting in the correct order. The problem is that it takes longer to spin up the broker than it does a connector device. So the connector is trying to connect before the broker is actually accepting connections. I'll have to figure out a fix for this.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Jan 19, 2023 10:59 am
boisy offline
User avatar
Posts: 273
Joined: Jun 25, 2013

Re: MQTT Connectors disconnect

Thanks Joe. You're doing the Lord's work!

Posted on
Thu Jan 19, 2023 11:28 am
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Connectors disconnect

Version 2022.1.0 of the MQTT Connector plugin now on the plugin store. This version adds a delay field to the "Connection Info" tab of the device configuration dialog. Setting this to 3 or 4 seconds will give the Broker time to get running.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Jan 19, 2023 12:29 pm
boisy offline
User avatar
Posts: 273
Joined: Jun 25, 2013

Re: MQTT Connectors disconnect

I just set this to 5 seconds for my connectors, quit the server, restarted it, and now it comes up connected after the delay. Very good!

Who is online

Users browsing this forum: No registered users and 2 guests