Announcement

Collapse
No announcement yet.

mcsMQTT frequently dies/restarts

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    mcsMQTT frequently dies/restarts

    On HS4 4.2.2.0 / Linux, mcsMQTT 5.19.1.0 restarts often.
    There is not an error in the logs and they do not coincide with anything being done (e.g. one disconnect was this morning at 3am). Sometimes they are minutes apart, sometimes hours.

    The last line logged during startup is: "GetMQTTSend Key= at MCSMQTTHS4_2020.Database.GetMQTTSend (System.Boolean bValidateRef) [0x005d7] in :0 Line 0 Object reference not set to an instance of an object " but it does not occur when the plugin dies.

    Thanks!

    Click image for larger version

Name:	HS4-mcsMQTT-FrequentlyDies.png
Views:	115
Size:	76.6 KB
ID:	1499160

    Click image for larger version

Name:	HS4-mcsMQTT-FrequentlyDies-long.png
Views:	74
Size:	744.0 KB
ID:	1499161

    #2
    The problem is happening when the HS devices are being discovered. I expected a line number to be disclosed at the end of the error message as part of the call stack information. The log screenshot has the right side cut off. Is the full line available?

    The Updater has 5.20.1.3. I do not recall any changes in this section of code, but still best to use the current version so I know if matches my source.

    If the above two do not meet with success then I can add additional debug to pinpoint what source line is causing the issue.

    To change the behavior of discovery of HS devices there is a setting at the bottom of the General tab, MQTT page. Change the radio for a test. It is not a solution, but may help with understanding. Rather than from the browser, it can be changed from \Config\mcsMQTT.ini with a key in the [General] section of NoEnumeration="1" or NoEnumeration="0"

    Click image for larger version

Name:	Capture.PNG
Views:	101
Size:	23.1 KB
ID:	1499225

    Comment


      #3
      Originally posted by Michael McSharry View Post
      The problem is happening when the HS devices are being discovered. I expected a line number to be disclosed at the end of the error message as part of the call stack information. The log screenshot has the right side cut off. Is the full line available?

      The Updater has 5.20.1.3. I do not recall any changes in this section of code, but still best to use the current version so I know if matches my source.

      If the above two do not meet with success then I can add additional debug to pinpoint what source line is causing the issue.

      To change the behavior of discovery of HS devices there is a setting at the bottom of the General tab, MQTT page. Change the radio for a test. It is not a solution, but may help with understanding. Rather than from the browser, it can be changed from \Config\mcsMQTT.ini with a key in the [General] section of NoEnumeration="1" or NoEnumeration="0"

      Click image for larger version

Name:	Capture.PNG
Views:	101
Size:	23.1 KB
ID:	1499225
      I had checked for updates to make sure I was on the latest, and nothing came up. However, I just check again and I see the 5.20.1.3.

      I apologize regarding the log lines, I can see how that's confusing. I cropped the image to the end of the text, there is nothing further displayed:

      Time
      From
      Type
      Message

      9/28/2021 18:16:12
      mcsMQTT
      Info
      GetMQTTSend Key= at MCSMQTTHS4_2020.Database.GetMQTTSend (System.Boolean bValidateRef) [0x005d7] in :0 Line 0 Object reference not set to an instance of an object

      9/28/2021 18:14:40
      mcsMQTT
      Info
      GetMQTTSend Key= at MCSMQTTHS4_2020.Database.GetMQTTSend (System.Boolean bValidateRef) [0x005d7] in :0 Line 0 Object reference not set to an instance of an object


      I have toggled the HS Device enumeration feature you indicated, but as you pointed out it's not a good long-term fix.

      Comment


        #4
        Did the problem disappear after toggling. What state does not provide error?

        Comment


          #5
          Originally posted by Michael McSharry View Post
          Did the problem disappear after toggling. What state does not provide error?
          I was giving the logs some runtime to test.

          It does not appear to have changed anything.


          Time
          From
          Type
          Message


          9/28/2021 19:21:49
          mcsMQTT
          Info
          GetMQTTSend Key= at MCSMQTTHS4_2020.Database.GetMQTTSend (System.Boolean bValidateRef) [0x005d7] in :0 Line 0 Object reference not set to an instance of an object

          9/28/2021 19:21:44
          HomeSeer
          Starting Plug-In
          Plugin mcsMQTT started successfully in 224 milliseconds

          9/28/2021 19:21:43
          HomeSeer
          Starting Plug-In
          Initializing plugin mcsMQTT ...

          9/28/2021 19:21:43
          HomeSeer
          Starting Plug-In
          mcsMQTT loaded in 15023 milliseconds

          9/28/2021 19:21:28
          HomeSeer
          Info
          Plugin mcsMQTT with instance mcsMQTT has connected. IP:127.0.0.1:57732

          9/28/2021 19:21:28
          HomeSeer
          Warning
          I/O interface mcsMQTT is down, executable is not running, restarting ...

          9/28/2021 19:21:10
          HomeSeer
          Info
          Plugin mcsMQTT with ID: mcsMQTT and Instance: has disconnected

          9/28/2021 19:20:34
          mcsMQTT
          Info
          GetMQTTSend Key= at MCSMQTTHS4_2020.Database.GetMQTTSend (System.Boolean bValidateRef) [0x005d7] in :0 Line 0 Object reference not set to an instance of an object

          9/28/2021 19:20:28
          HomeSeer
          Starting Plug-In
          Plugin mcsMQTT started successfully in 197 milliseconds

          9/28/2021 19:20:28
          HomeSeer
          Starting Plug-In
          Initializing plugin mcsMQTT ...

          9/28/2021 19:20:28
          HomeSeer
          Starting Plug-In
          mcsMQTT loaded in 15028 milliseconds

          9/28/2021 19:20:13
          HomeSeer
          Info
          Plugin mcsMQTT with instance mcsMQTT has connected. IP:127.0.0.1:57648

          9/28/2021 19:20:13
          HomeSeer
          Warning
          I/O interface mcsMQTT is down, executable is not running, restarting ...

          9/28/2021 19:19:45
          HomeSeer
          Info
          Plugin mcsMQTT with ID: mcsMQTT and Instance: has disconnected

          9/28/2021 19:13:18
          mcsMQTT
          Info
          GetMQTTSend Key= at MCSMQTTHS4_2020.Database.GetMQTTSend (System.Boolean bValidateRef) [0x005d7] in :0 Line 0 Object reference not set to an instance of an object

          9/28/2021 19:13:12
          HomeSeer
          Starting Plug-In
          Plugin mcsMQTT started successfully in 196 milliseconds

          9/28/2021 19:13:12
          HomeSeer
          Starting Plug-In
          Initializing plugin mcsMQTT ...

          9/28/2021 19:13:12
          HomeSeer
          Starting Plug-In
          mcsMQTT loaded in 15019 milliseconds

          9/28/2021 19:12:57
          HomeSeer
          Info
          Plugin mcsMQTT with instance mcsMQTT has connected. IP:127.0.0.1:57276

          9/28/2021 19:12:57
          HomeSeer
          Warning
          I/O interface mcsMQTT is down, executable is not running, restarting ...

          9/28/2021 19:12:44
          HomeSeer
          Info
          Plugin mcsMQTT with ID: mcsMQTT and Instance: has disconnected

          9/28/2021 19:11:02
          mcsMQTT
          Info
          GetMQTTSend Key= at MCSMQTTHS4_2020.Database.GetMQTTSend (System.Boolean bValidateRef) [0x005d7] in :0 Line 0 Object reference not set to an instance of an object

          9/28/2021 19:10:57
          HomeSeer
          Starting Plug-In
          Plugin mcsMQTT started successfully in 210 milliseconds

          9/28/2021 19:10:57
          HomeSeer
          Starting Plug-In
          Initializing plugin mcsMQTT ...

          9/28/2021 19:10:56
          HomeSeer
          Starting Plug-In
          mcsMQTT loaded in 15031 milliseconds

          9/28/2021 19:10:42
          HomeSeer
          Info
          Plugin mcsMQTT with instance mcsMQTT has connected. IP:127.0.0.1:57164


          Comment


            #6
            The attached has line markers sprinkled throughout the GetMQTTSend module. Unzip into HS4 subfolder \bin\mcsMQTT.

            It may also be helpful to have your setup zipped and posted that contains \Congi\mcsMQTT.ini and \Data\mcsMQTT\mcsMQTT.db.
            Attached Files

            Comment


              #7
              Originally posted by Michael McSharry View Post
              The attached has line markers sprinkled throughout the GetMQTTSend module. Unzip into HS4 subfolder \bin\mcsMQTT.

              It may also be helpful to have your setup zipped and posted that contains \Congi\mcsMQTT.ini and \Data\mcsMQTT\mcsMQTT.db.
              I have replaced the files and just re-enabled the PI. Will monitor and post. Attached are the requested files, will PM password.
              Attached Files

              Comment


                #8
                No data yet; However I noticed when it initializes the first time, it throws the same error, still no data in it, a later error does contain a line/ref:


                GetMQTTSend line=12 Ref=480 at MCSMQTTHS4_2020.Database.GetMQTTSend (System.Boolean bValidateRef) [0x0062d] in :0 Line 0 Object reference not set to an instance of an object



                9/28/2021 22:41:18
                mcsMQTT
                Info
                GetMQTTSend Key= at MCSMQTTHS4_2020.Database.GetMQTTSend (System.Boolean bValidateRef) [0x005d7] in :0 Line 0 Object reference not set to an instance of an object


                9/28/2021 22:41:13
                HomeSeer
                Starting Plug-In
                Plugin mcsMQTT started successfully in 196 milliseconds


                9/28/2021 22:41:13
                HomeSeer
                Starting Plug-In
                Initializing plugin mcsMQTT ...

                Comment


                  #9
                  I have not seen the PI restart yet. The only other change of note is while inserting the new files, it appeared I had an HS3 2020 DLL still in the directory from April. I renamed it.

                  Comment


                    #10
                    Logs:

                    Click image for larger version

Name:	hs4_mcsmqtt_after.png
Views:	65
Size:	268.2 KB
ID:	1499401

                    Comment


                      #11
                      Looks like HS3 plugin code to get the properties of the HS device. Don't know why the compiler did not flag a syntax error. The attached should fix it. It is a chore keeping both plugin versions up to date.
                      Attached Files

                      Comment


                        #12
                        Originally posted by Michael McSharry View Post
                        Looks like HS3 plugin code to get the properties of the HS device. Don't know why the compiler did not flag a syntax error. The attached should fix it. It is a chore keeping both plugin versions up to date.
                        I can only imagine. Thank you, as always, for your hard work!

                        Comment


                          #13
                          I did a global search for same coding construct and found one other supporting the same log function. I fixed it to in http://mcsSprinklers.com/MCSMQTTHS4_52020.zip. The included html file was excluded in the Updater update. If you want Sense support then you will want it too in the \html\mcsMQTT folder.

                          Comment


                            #14
                            Originally posted by Michael McSharry View Post
                            I did a global search for same coding construct and found one other supporting the same log function. I fixed it to in http://mcsSprinklers.com/MCSMQTTHS4_52020.zip. The included html file was excluded in the Updater update. If you want Sense support then you will want it too in the \html\mcsMQTT folder.
                            No crashes since this morning. Thanks again!

                            Comment

                            Working...
                            X