Announcement

Collapse
No announcement yet.

MQTT crashes and restarts when topic received

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

  • MQTT crashes and restarts when topic received

    Just setup a package that would send temperature information via MQTT so I'm not able to actually try doing something useful with MQTT on HS3.

    Data is coming in but the MQTT plugin is crashing every time it receives a topic.

    Running the standard Mosquitto broker so nothing special there.

    The Broker is running on the same computer as HS3. The computer is an Intel NUC8i3 running a very lite load.

    Here is what's in the log. I'll supply any more information needed.
    Feb-03 4:12:31 PM Info Plugin mcsMQTT has connected. IP:127.0.0.1:33836
    Feb-03 4:12:31 PM Warning I/O interface mcsMQTT is down, executable is not running, restarting ...
    Feb-03 4:12:16 PM Info Plugin mcsMQTT with instance: has disconnected
    Feb-03 4:12:16 PM Device Control Device: Sensors Abode CPU Case Temp to 36 °C (36) by/from: CAPI Control Handler
    Feb-03 4:12:05 PM mcsMQTT MQTTClient is Connected
    Feb-03 4:12:01 PM Starting Plug-In Plugin mcsMQTT started successfully in 202 milliseconds
    Feb-03 4:12:01 PM mcsMQTT Version 3.4.18.2 Registered with Homeseer
    Feb-03 4:12:01 PM Starting Plug-In Initializing plugin mcsMQTT ...
    Feb-03 4:12:01 PM Starting Plug-In mcsMQTT loaded in 15002 milliseconds
    Feb-03 4:11:46 PM Info Plugin mcsMQTT has connected. IP:127.0.0.1:33818
    Feb-03 4:11:45 PM Warning I/O interface mcsMQTT is down, executable is not running, restarting ...
    HomeSeer Version: HS3 Standard Edition 3.0.0.500
    Linux version: Linux auto 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
    IP Address: 10.0.2.16 | Number of Devices: 417 | Number of Events: 667 | Available Threads: 399 | HSTouch Enabled: True

    Enabled Plug-Ins: AirplaySpeak: 3.0.0.13 | BLBackup: 2.0.61.0 | EasyTrigger: 3.0.0.65 | LiftMaster MyQ: 1.3.7006.42100
    mcsMQTT: 4.0.2.2 | PHLocation2: 3.0.0.53 | Pushover 3P: 0.0.0.45 | Z-Wave: 3.0.1.262

    Z-Net version: 1.0.23 using a HomeSeer SmartStick+: 6.04 (ZDK 6.81.3)

  • #2
    The file of interest is \Data\mcsMQTT\mcsMQTT Debug.txt. It will contain more information if the Debug checkbox is used from General tab or access to the browser is not possible then editing config\mcsMQTT.ini so the Debug line is
    DebugLog="1"

    Note also the 15 seconds it took HS to load the plugin once the plugin established connection with HS. This looks to be excessive to me.

    Comment


    • #3
      There is some old stuff that doesn't need to be there from my initial testing. What's the quickest way to start over?
      HomeSeer Version: HS3 Standard Edition 3.0.0.500
      Linux version: Linux auto 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
      IP Address: 10.0.2.16 | Number of Devices: 417 | Number of Events: 667 | Available Threads: 399 | HSTouch Enabled: True

      Enabled Plug-Ins: AirplaySpeak: 3.0.0.13 | BLBackup: 2.0.61.0 | EasyTrigger: 3.0.0.65 | LiftMaster MyQ: 1.3.7006.42100
      mcsMQTT: 4.0.2.2 | PHLocation2: 3.0.0.53 | Pushover 3P: 0.0.0.45 | Z-Wave: 3.0.1.262

      Z-Net version: 1.0.23 using a HomeSeer SmartStick+: 6.04 (ZDK 6.81.3)

      Comment


      • #4
        Remove contents of /data/mcsMQTT folder and delete /config/mcsMQTT.ini when plugin is not running

        Comment


        • #5
          Ok, that works so I can play.

          I have a program running that is publishing 3 topics which is the CPU case temp plus the temp of the two cores. I don't want mcsMQTT to publish and of these topics, just subscribe to them.

          I mcsMQTT can see them going by in the statistics Last Received Topic tab so they are being seen.

          I already have the three devices I for the three topics.

          I then went to the Add/Edit tab and pasted in one of the topics. "auto/NUC8i3/Package id 0", and when it came up I set the reference field at the bottom for the device I want to contain that topic.

          At that point the device does receive the published data but the plugin crashes.

          Not much shows up in the debug log.

          I'm tired and going to bed. Maybe I'll think more clearly in the morning.

          HTML Code:
          2/3/2019 11:17:32 PM    0    | mcsMQTT Version 3.4.18.2 running at /opt/HomeSeer, HS is at /opt/HomeSeer
          2/3/2019 11:17:32 PM    5    | mcsMQTT InitHW ComputerName= auto, IOEnabled=False
          2/3/2019 11:17:32 PM    71    | mcsMQTT Debug InitHW Database Ready
          2/3/2019 11:17:32 PM    78    | mcsMQTT Debug Receive Ready
          2/3/2019 11:17:32 PM    79    | mcsMQTT Debug Trigger Ready
          2/3/2019 11:17:32 PM    115    | HW Init Complete  
          2/3/2019 11:17:32 PM    115    | Background Init Started  
          2/3/2019 11:17:32 PM    128    | Background Init Received  
          2/3/2019 11:17:34 PM    1683    | Background Send  
          2/3/2019 11:17:37 PM    4384    | Background Init Filters - Background Complete  
          2/3/2019 11:17:37 PM    4385    | Spawning MQTT Threads  
          2/3/2019 11:17:37 PM    4385    | mcsMQTT Debug MQTT Ready
          2/3/2019 11:17:37 PM    4390    | MQTT Thread Not Connected Yet  
          2/3/2019 11:17:37 PM    4390    | Calling MQTTclient  
          2/3/2019 11:17:37 PM    4391    | MQTT Thread Client Created  
          2/3/2019 11:17:37 PM    4391    | MQTT Thread Client ID=mcsMQTT on auto  
          2/3/2019 11:17:37 PM    4391    | Calling MQTT Connect  
          2/3/2019 11:17:37 PM    4395    | MQTT Thread Broker auto.local Connect Response=0  
          2/3/2019 11:17:37 PM    4395    | MQTT Broker Connection Accepted, Connected=True  
          2/3/2019 11:17:37 PM    4398    | MQTT Subscription Start  
          2/3/2019 11:17:37 PM    4398    | MQTT Subscription Topics being selected  
          2/3/2019 11:17:37 PM    4398    | MQTT Subscription Topics selected  
          2/3/2019 11:17:37 PM    4398    | MQTTSubscribe List /  NoDiscovery=False to  
          2/3/2019 11:17:37 PM    4398    | #  
          HomeSeer Version: HS3 Standard Edition 3.0.0.500
          Linux version: Linux auto 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
          IP Address: 10.0.2.16 | Number of Devices: 417 | Number of Events: 667 | Available Threads: 399 | HSTouch Enabled: True

          Enabled Plug-Ins: AirplaySpeak: 3.0.0.13 | BLBackup: 2.0.61.0 | EasyTrigger: 3.0.0.65 | LiftMaster MyQ: 1.3.7006.42100
          mcsMQTT: 4.0.2.2 | PHLocation2: 3.0.0.53 | Pushover 3P: 0.0.0.45 | Z-Wave: 3.0.1.262

          Z-Net version: 1.0.23 using a HomeSeer SmartStick+: 6.04 (ZDK 6.81.3)

          Comment


          • #6
            Not sure if it would matter to use the loop back address (127.0.0.1) or the actual IP of the Mosquitto server; but you could give it a try maybe?

            Thinking here put the Mosquitto server on my HS3 Pro Linux box and internally using the Loopback and externally using the actual IP of the server. Noticed too that the docker stuff uses another IP internally...
            - Pete

            Auto mator
            Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel CPU - Mono 5.20
            Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e BeeLink 4Gb BT3 Pro - Mono 5.20

            X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

            Comment


            • #7
              Actually even when I used auto.local it still seems to pickup the loopback address. I think the reason is that I don't have a local DNS server so the IP address is picked up using bonjour. Bonjour will tend to do that when you reference yourself.

              The one thing I haven't tried is having mcsMQTT build a whole new device whenever it sees a new topic so I may give that a try.

              I may just remove mcsMQTT completely then reinstall just incase something else might have gotten damages if I don't find anything else.
              HomeSeer Version: HS3 Standard Edition 3.0.0.500
              Linux version: Linux auto 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
              IP Address: 10.0.2.16 | Number of Devices: 417 | Number of Events: 667 | Available Threads: 399 | HSTouch Enabled: True

              Enabled Plug-Ins: AirplaySpeak: 3.0.0.13 | BLBackup: 2.0.61.0 | EasyTrigger: 3.0.0.65 | LiftMaster MyQ: 1.3.7006.42100
              mcsMQTT: 4.0.2.2 | PHLocation2: 3.0.0.53 | Pushover 3P: 0.0.0.45 | Z-Wave: 3.0.1.262

              Z-Net version: 1.0.23 using a HomeSeer SmartStick+: 6.04 (ZDK 6.81.3)

              Comment


              • #8
                Check the user name / password stuff too.

                Well test it first without the user name and password enabled in the Mosquitto conf file and in the MQTT user name an password settings.

                The only issues I have had with the plugin is when I changed the location (IP) of the Mosquitto server. Test that too by changing the IP in the MQTT settings to something that doesn't exist.

                Testing it a bit here changing the IP of the broker and password stuff and the plugin just disconnected from the broker but the plugin did not abend.

                What does the debug.txt file show?

                When you reinstall it delete any files created from the first install beforehand.

                Currently utilizing version 3.4.18.2 but it's been fine with previous versions.

                Another thing to try is disabling all of your plugins then just enable the mcsMQTT plugin. (curiousity)
                - Pete

                Auto mator
                Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel CPU - Mono 5.20
                Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e BeeLink 4Gb BT3 Pro - Mono 5.20

                X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

                Comment


                • #9
                  Well, I got the crashing to stop. The only thing I did differently was to not set the reference to my pre made device and to go ahead and use the device it created. I don't understand why I can't set the device I want it to use but I can live with it this way although I hope this could be fixed.

                  One issue did show up that I can't see how to fix. I can attach a graphic icon to the device. The topic that was subscribed to is temperature and I'd like to have the temperature graphic associated with device. I also want to use the graphic that change for each 10 degrees the temp changes. What I end of getting on the graphics page is this error "Device settings prevent editing/adding value/graphics pairs" How can this be fixed?
                  HomeSeer Version: HS3 Standard Edition 3.0.0.500
                  Linux version: Linux auto 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
                  IP Address: 10.0.2.16 | Number of Devices: 417 | Number of Events: 667 | Available Threads: 399 | HSTouch Enabled: True

                  Enabled Plug-Ins: AirplaySpeak: 3.0.0.13 | BLBackup: 2.0.61.0 | EasyTrigger: 3.0.0.65 | LiftMaster MyQ: 1.3.7006.42100
                  mcsMQTT: 4.0.2.2 | PHLocation2: 3.0.0.53 | Pushover 3P: 0.0.0.45 | Z-Wave: 3.0.1.262

                  Z-Net version: 1.0.23 using a HomeSeer SmartStick+: 6.04 (ZDK 6.81.3)

                  Comment


                  • #10
                    The only thing I did differently was to not set the reference to my pre made device and to go ahead and use the device it created. I don't understand why I can't set the device I want it to use but I can live with it this way although I hope this could be fixed.

                    I do not know why this would make the plugin crash.

                    I am sort of dealing with this right now with the GDO / SonOff modded box and I cannot figure it out.

                    It is only a button that I have configured which you press once to open the GDO and once to close the GDO.

                    If I change the variable stuff then it doesn't work.

                    IE:

                    Currently the published command is this:

                    /GarageDoor1/cmnd/POWER

                    I have to send it an off for the button to work.

                    /GarageDoor1/cmnd/POWER Off

                    It doesn't do anything if I send:

                    /GarageDoor1/cmnd/POWER On

                    It is behaving the opposite way from intended.

                    I do not want the variable button to say off and everytime I change it it doesn't work anymore.

                    Note none of this debends the plugin.

                    I have deleted the variable now 4 times this morning and recreated it via the plugin and it is always the same.

                    Click image for larger version

Name:	TTasmotaGDO.jpg
Views:	8
Size:	42.0 KB
ID:	1282206

                    Click image for larger version  Name:	GDO OFF button.jpg Views:	1 Size:	29.5 KB ID:	1282203
                    Click image for larger version  Name:	GDO.jpg Views:	1 Size:	54.3 KB ID:	1282204

                    Click image for larger version  Name:	GDO OFF button1.jpg Views:	1 Size:	24.4 KB ID:	1282205

                    xxx
                    - Pete

                    Auto mator
                    Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel CPU - Mono 5.20
                    Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e BeeLink 4Gb BT3 Pro - Mono 5.20

                    X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

                    Comment


                    • #11
                      "Device settings prevent editing/adding value/graphics pairs" How can this be fixed?

                      I just put the graphics in and it saves it anyhow dynamically. Try it yourself.

                      For the 1-wire temperature stuff keep it simple here...(using the SonOff WiFi basic with up to 5 DS18B20s connected).

                      Use the console here to set these up:

                      sensor:
                      - name: Espurna_1WIREA_temperature
                      platform: mqtt
                      state_topic: Espurna-1WIREA/temperature/0
                      unit_of_measurement: °F


                      sensor:
                      - name: Espurna_1WIREA_temperature
                      platform: mqtt
                      state_topic: Espurna-1WIREA/temperature/1
                      unit_of_measurement: °F


                      sensor:
                      - name: Espurna_1WIREA_temperature
                      platform: mqtt
                      state_topic: Espurna-1WIREA/temperature/2
                      unit_of_measurement: °F


                      Click image for larger version  Name:	Espurna.jpg Views:	1 Size:	25.3 KB ID:	1282210



                      Click image for larger version  Name:	11wire.jpg Views:	1 Size:	21.7 KB ID:	1282209
                      Been goofing a bit now with Alexa per device TTS which works well now. IE: for the GDO I can ask alexa to open the garage door talking directly to the mcsTasmota SonOff wifi basic device and get TTS status from the same Alexa that I am talking to.

                      xxx
                      - Pete

                      Auto mator
                      Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel CPU - Mono 5.20
                      Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e BeeLink 4Gb BT3 Pro - Mono 5.20

                      X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

                      Comment


                      • #12
                        I don't have any control on the Status Graphics page. The entire section for graphics is missing. Just the section for Status Text is displayed. Can't add graphics if there isn't a way to do it.

                        Click image for larger version

Name:	Screen Shot 2019-02-04 at 7.53.09 AM.png
Views:	8
Size:	35.1 KB
ID:	1282224

                        Click image for larger version  Name:	Screen Shot 2019-02-04 at 7.46.47 AM.png Views:	1 Size:	187.2 KB ID:	1282220

                        If I go to the device inside of mcsMQTT I can uncheck the no graphics box but it resets back to no graphics. I guess I just don't understand why mcsMQTT won't let you add graphics on a device it creates or how to change it.

                        Click image for larger version  Name:	Screen Shot 2019-02-04 at 7.49.47 AM.png Views:	1 Size:	529.5 KB ID:	1282221

                        While I was working on this I noticed the cpu temp started rising. I found that three HSPI_MQTT tasks are running at well over 100%. There are 16 or more HSPI_MQTT tasks running but I only have, at least I think I only have, 3 devices being updated my mcsMQTT. Restarted mcsMQTT an the 100%+ went away but I still have many HSPI_MQTT tasks.
                        HomeSeer Version: HS3 Standard Edition 3.0.0.500
                        Linux version: Linux auto 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
                        IP Address: 10.0.2.16 | Number of Devices: 417 | Number of Events: 667 | Available Threads: 399 | HSTouch Enabled: True

                        Enabled Plug-Ins: AirplaySpeak: 3.0.0.13 | BLBackup: 2.0.61.0 | EasyTrigger: 3.0.0.65 | LiftMaster MyQ: 1.3.7006.42100
                        mcsMQTT: 4.0.2.2 | PHLocation2: 3.0.0.53 | Pushover 3P: 0.0.0.45 | Z-Wave: 3.0.1.262

                        Z-Net version: 1.0.23 using a HomeSeer SmartStick+: 6.04 (ZDK 6.81.3)

                        Comment


                        • #13
                          So here if I change and uncheck the box for HS Device MISC Properties for no graphics display I get the bottom section for graphics and the DONE bottom on the bottom.

                          Here is my HTOP stuff for mcsMQTT connecting now to 6 modded WiFi devices with a bunch of MQTT variables.

                          GDO (open,close, button and temp sensor), 2 Magic Home controllers (on and off and temp), 3 1-Wire Temperature hubs (plus have temperature sensors on my GDO, Magic Home Controllers)

                          My Omni and WeatherXML plugins utilize more CPU than the mcsMQTT plugin.

                          Base hardware is a Haswell i3 with 16Gb of RAM. Ubuntu 18.04 64 bit. Homeseer HS3 Pro Edition 3.0.0.449 (Linux).

                          Click image for larger version  Name:	mcsMQTT.jpg Views:	1 Size:	22.0 KB ID:	1282244

                          xxx
                          - Pete

                          Auto mator
                          Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel CPU - Mono 5.20
                          Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e BeeLink 4Gb BT3 Pro - Mono 5.20

                          X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

                          Comment


                          • #14
                            Restarted mcsMQTT, uncheck the box and not it sticks so it seems to be working. I'm was able to set the temperature graphics however they don't show up on the device page, just the values show up. I would think that should be a basic HS3 function not something that mcsMQTT does.

                            Something was out of kilter. I'm gong to do a complete system shutdown and restart so I know everything has been cleared out. Needed to do that anyway since there are system patches to install.

                            UPDATE:
                            Ah, that restart seems to have cleaned everything up. Now if there was only a way to copy graphics settings from one device to another rather than having to do it by hand.
                            Last edited by Timon; February 4th, 2019, 12:38 PM. Reason: Update:
                            HomeSeer Version: HS3 Standard Edition 3.0.0.500
                            Linux version: Linux auto 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
                            IP Address: 10.0.2.16 | Number of Devices: 417 | Number of Events: 667 | Available Threads: 399 | HSTouch Enabled: True

                            Enabled Plug-Ins: AirplaySpeak: 3.0.0.13 | BLBackup: 2.0.61.0 | EasyTrigger: 3.0.0.65 | LiftMaster MyQ: 1.3.7006.42100
                            mcsMQTT: 4.0.2.2 | PHLocation2: 3.0.0.53 | Pushover 3P: 0.0.0.45 | Z-Wave: 3.0.1.262

                            Z-Net version: 1.0.23 using a HomeSeer SmartStick+: 6.04 (ZDK 6.81.3)

                            Comment


                            • #15
                              I would think that should be a basic HS3 function not something that mcsMQTT does.

                              Thinking that mcsMQTT controls and configures the variables different via the MQTT reference number configuration page than what HS3 does sort of.

                              I know that if I change it the HS3 way then it doesn't work right displaying status or graphics such that I have to do it all via the MQTT reference ID page stuff.

                              You could also replicate (I think) the device over to WeatherXML and use Jeff's temperature graphics. This is less work than creating a per temperature graphic.

                              Click image for larger version

Name:	weatherxml.jpg
Views:	9
Size:	4.3 KB
ID:	1282277

                              - Pete

                              Auto mator
                              Homeseer 3 Pro - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e 64 bit Intel CPU - Mono 5.20
                              Homeseer Zee2 (Lite) - 3.0.0.534 (Linux) - Ubuntu 18.04/W7e BeeLink 4Gb BT3 Pro - Mono 5.20

                              X10, UPB, Zigbee, ZWave and Wifi MQTT automation.

                              Comment

                              Working...
                              X