MQTT Connectors disconnect

Posted on
Sun Jan 29, 2023 4:25 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: MQTT Connectors disconnect

Cheers Joe. This has been impacting me too.


Sent from my iPhone using Tapatalk

Posted on
Thu Feb 02, 2023 11:27 pm
mundmc offline
User avatar
Posts: 1060
Joined: Sep 14, 2012

Re: MQTT Connectors disconnect

Not all heroes wear capes. Thanks, Joe, this fix the problem I was having too with the local broker.

Posted on
Fri Feb 03, 2023 3:21 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: MQTT Connectors disconnect

Hi Joe,

I have 3 connector devices running, and I got this error until I set the delay on all 3.

Started plugin "MQTT Connector 2022.1.0"
MQTT Connector MQTT local broker: Starting Device
MQTT Connector Shelly connector: Starting Device
MQTT Connector Shelly NG connector: Starting Device
MQTT Connector Shelly connector: Subscribing to: shellies/# (0)
MQTT Connector Shelly NG connector: Subscribing to: shellies-ng/# (0)
Trigger Shelly Broker
MQTT Connector Error Error in plugin execution GetUiDynamicList:

File "plugin.py", line 844, in getProtocolList
type: name 'err' is not defined

Simon

Posted on
Fri Feb 03, 2023 7:32 am
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Connectors disconnect

Huh. Interesting bug there. It's been there since the first release of the Python3 version. Why it started showing up now, and goes away when you add the delay, is the interesting part.

https://github.com/FlyingDiver/Indigo-M ... g/2022.1.1

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

Posted on
Tue Feb 07, 2023 2:19 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: MQTT Connectors disconnect

Thanks.

Got this error on install, but a reload seems to have cleared it.


Code: Select all
 Stopped plugin MQTT Connector
   Upgrading plugin MQTT Connector to newer version 2022.1.1 (previous version moved to trash)
   Loading plugin "MQTT Connector 2022.1.1" using API v3.0
   Starting plugin "MQTT Connector 2022.1.1" (pid 44258)
   Started plugin "MQTT Connector 2022.1.1"
   MQTT Connector                  MQTT local broker: Starting Device
   MQTT Connector                  Shelly connector: Starting Device
   MQTT Connector                  Shelly NG connector: Starting Device
   MQTT Connector                  Shelly connector: Subscribing to: shellies/# (0)
   MQTT Connector                  Shelly NG connector: Subscribing to: shellies-ng/# (0)
   MQTT Connector Warning          getPluginList: Unable to parse plist, skipping: /Library/Application Support/Perceptive Automation/Indigo 2022.1/Plugins/PingSensor.indigoPlugin/Contents/Info.plist, err = not well-formed (invalid token): line 21, column 61

7 Feb 2023 at 08:16:02
   Reloading plugin "MQTT Connector 2022.1.1" using API v3.0
   Stopping plugin "MQTT Connector 2022.1.1" (pid 44258)
   MQTT Connector                  MQTT local broker: Stopping Device
   MQTT Connector                  MQTT local broker: Disconnecting
   MQTT Connector                  Shelly connector: Stopping Device
   MQTT Connector                  Shelly connector: Disconnecting
   MQTT Connector                  Shelly NG connector: Stopping Device
   MQTT Connector                  Shelly NG connector: Disconnecting
   Stopped plugin "MQTT Connector 2022.1.1"
   Starting plugin "MQTT Connector 2022.1.1" (pid 44328)
   Started plugin "MQTT Connector 2022.1.1"
   MQTT Connector                  MQTT local broker: Starting Device
   MQTT Connector                  Shelly connector: Starting Device
   MQTT Connector                  Shelly NG connector: Starting Device
   MQTT Connector                  Shelly connector: Subscribing to: shellies/# (0)
   MQTT Connector                  Shelly NG connector: Subscribing to: shellies-ng/# (0)


Posted on
Tue Feb 07, 2023 6:21 am
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Connectors disconnect

That's not an error. It's a warning about some other plugin. Not sure why you would only get it sometimes though.

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

Posted on
Tue Feb 07, 2023 7:56 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: MQTT Connectors disconnect

True hadn't seen it was for the ping sensor, but it's listed against MQQT Connector Warning.
Not sure how it got muddled between the 2 plugins.


Sent from my iPhone using Tapatalk

Posted on
Tue Feb 07, 2023 8:00 am
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Connectors disconnect

The MQTT Connector plugin reads the plist files for all the other plugins, so it can build a list of devices that can be published. It reports a warning whenever it encounters a plist file that's mis-formatted.

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

Posted on
Tue Feb 07, 2023 1:12 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: MQTT Connectors disconnect

Thank you. That makes sense. Yes not sure why it was just the one time.

Posted on
Sat Feb 11, 2023 7:17 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: MQTT Connectors disconnect

Back to the original post in this thread: MQTT Connectors disconnect

Indigo 2022.1.2
MacOS 13.2
Apple Silicon
MQTT Connector v2022.1.1
MQTT Broker plugin v2022.10

I am seeing random Connector disconnects. I have also found the following message in the Log
MQTT Connector Error CM MQTT Connector: Disconnected with result code 1
However, restarting the Broker plugin also throws the same error in the log, but does not seem to actually leave the Connector in a disconnected state.

So far I have just been restarting the plugin to clear the problem. So, other than what I have reported here, I don't have a lot of information.

Ideas on the cause or troubleshooting?

UPDATE: I have added a trigger to catch any MQTT Connector disconnects and restart the plugin and send me a log snippet.

Posted on
Sat Feb 11, 2023 1:37 pm
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: MQTT Connectors disconnect

It's possible it's a problem with the Broker plugin. Unfortunately, due to the way that asyncio works, errors in the async code doesn't get reported via the Indigo log. If you think there's an issue there, you should run the plugin in an interactive shell. To do that, you need to check the "Enable debugging menus" in the Plugins panel of the Indigo preferences.

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

Posted on
Sat Mar 04, 2023 6:45 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: MQTT Connectors disconnect

berkinet wrote:
...UPDATE: I have added a trigger to catch any MQTT Connector disconnects and restart the plugin and send me a log snippet.


I have not yet tried running the plugin in debug mode. But, I did find an issue with the trigger I wrote to trap the plugin failure. I could not figure out a specific state to trigger on, so I just chose not equal to "Connected 0" (image below). But, that did not catch a failure. Unfortunately, I absent mindedly restarted the plugin before looking to see what status state it was in -- and it may well have still been "Connected 0" Any ideas on how to trap the problem? And, yes, next time it happens I will printout the device before doing a plugin restart.

Thanks
Attachments
Screenshot 2023-03-04 at 13.38.15.png
Screenshot 2023-03-04 at 13.38.15.png (47.83 KiB) Viewed 1741 times

Posted on
Wed Mar 08, 2023 3:49 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: MQTT Connectors disconnect

FlyingDiver wrote:
It's possible it's a problem with the Broker plugin. Unfortunately, due to the way that asyncio works, errors in the async code doesn't get reported via the Indigo log. If you think there's an issue there, you should run the plugin in an interactive shell. To do that, you need to check the "Enable debugging menus" in the Plugins panel of the Indigo preferences.
Ok. I have been running the Broker in an interactive shell...
Code: Select all
Starting shell for plugin MQTT Broker.indigoPlugin.
To access the plugin instance use the global named self.

Python 3.10.2 (v3.10.2:a58ebcc701, Jan 13 2022, 14:50:16) [Clang 13.0.0 (clang-1300.0.29.30)]
Connected to Indigo Server v2022.2.0, api v3.2 (localhost:1176)
Started Plugin MQTT Broker v2022.1.0
>>>
But, when the MQTT Connector failed...
Code: Select all
 MQTT Connector Error            CM MQTT Connector: Disconnected with result code 1
  Trigger                         Monitor MQTT Connector
  Reloading plugin "MQTT Connector 2022.1.1" using API v3.0
  Stopping plugin "MQTT Connector 2022.1.1" (pid 4355)
  Email+                          sending email 'MQTT Connector plugin' to 'foo@bar.com' using Google SMTP+
  MQTT Connector                  CM MQTT Connector: Stopping Device
  MQTT Connector                  CM MQTT Connector: Disconnecting
  Stopped plugin "MQTT Connector 2022.1.1"
  Starting plugin "MQTT Connector 2022.1.1" (pid 74487)
  Started plugin "MQTT Connector 2022.1.1"
  MQTT Connector                  CM MQTT Connector: Starting Device
  MQTT Connector                  CM MQTT Connector: Subscribing to: cm/LinkTap_reply/down (0)
  MQTT Connector                  CM MQTT Connector: Subscribing to: cm/LinkTap/up/# (0)
  MQTT Connector                  CM MQTT Connector: Subscribing to: # (0)
  Schedule                        trigger "Monitor MQTT Connector" (delayed action)
Nothing appeared in the interactive shell window.

At least I am now trapping the failure and restarting the plugin. Any other ideas on tracking down the cause of this problem?

Posted on
Sat Mar 18, 2023 4:04 am
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: MQTT Connectors disconnect

I am still seeing this problem on a regular, like every two days or so, but not on any exact schedule. Do you have any more ideas on how I can collect some useful information on what is causing the failure? The only thing I am seeing in the log is the execution of the trigger that is watching for a Connector failure
Code: Select all
MQTT Connector Error            CM MQTT Connector: Disconnected with result code 1
As noted before, running in the interactive shell shows nothing at all.

Posted on
Sat Mar 18, 2023 1:05 pm
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: MQTT Connectors disconnect

It’s certainly easy using the plug-in broker but I had similar issues and switching to mosquito installed on my server Mac was very simple and I have had none of these connection problems since.

Who is online

Users browsing this forum: No registered users and 2 guests

cron