Announcement

Collapse
No announcement yet.

Any possibilty to detect this state to trigger event?

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

    Any possibilty to detect this state to trigger event?

    Click image for larger version

Name:	hometrollers ( 192.168.1.76 ) - service mode.jpg
Views:	150
Size:	17.9 KB
ID:	1550399
    I have this from time to time.
    I would like to detect this state (HS3) to trigger an event to restart the plugin.
    Still trying to find root cause, but in the mean time this would already minimize the symptoms.

    Thanks in advance. ​​​
    Attached Files

    #2
    When the user selects the internal MQTT broker, then mcsMQTT sends a heartbeat message and expects it to be returned from the broker. If it does not receive it, then something is wrong with the broker so mcsMQTT tries to restart the internal broker with a graceful stop and restart. Apparently, this stop/restart is not accomplishing its objective otherwise you would not be posting the question.

    I know there are issues with the library I am using for the internal broker and that is one of the reasons I included the heartbeat monitoring. It is unfortunate that mcsMQTT was able to detect the failure mode, but not able to restart the internal broker with success. Since I have never experienced a failure of the internal broker it is hard to debug.

    There currently is no additional notification provided that could easily be used as a trigger. The message you see on the console also goes to the mcsMQTT deubg log so if you want to ready the file and look for the message then you could use that for a trigger.

    At the same time, if the graceful restart of the broker is not working then either of two approaches are available. One is to change the graceful recovery to a more dramatic one of restarting the plugin. In essence this is your objective. The other is to try to diagnose why the graceful recovery is not successful.

    We already know there is an issue with the library being used for the internal broker that shows up for some but not all users. It has not had any updates for multiple years so is in essence an unsupported library. Mosquitto is an actively supported MQTT Broker and works quite well with a small resource footprint. Installing it rather than using the internal broker is the path that I would recommend.

    Comment


      #3
      When I have time, i will invest it in rollout of Mosquiitto. Beginners question: is it possible to install it on the same machine as HomeSeer? Because I don't plan to have another device running 24/7.

      As for the error message: not happening anymore. I think it started when installing the latest update (which disables the hartbeat showing in the plugin window). At the same time I added some devices, so i was not sure which of both might have been the problem. When searching on the forum, i found that with the new update, the heartbeat display was enabled with the debugging. I did that to be able to see when it stopped easely, and since then no issues.

      Difficult to tell if there is a link, but so for so good.

      Comment


        #4
        Mosquitto can be installed on the same computer as Homeseer. When you install Mosquitto, the mcsMQTT configuration for Broker IP is the IP of this computer such as 192.168.1.100 and no longer be 127.0.0.1 which is for the internal broker.

        Comment


          #5
          Things were getting more and more unstable, so I finally forced myself to install Mosquitto. For the moment I installed an older version, since in version 2 I was only able to get the localhost (127.0.0.1) working, not the ip adress of the interface which was necessary for the config of mcsMQTT to bypass the intenal broke. Played around with listeners and bindings, but nothing was working. But the older version is working perfectly, so far so good.

          Comment


            #6
            My mosquitto.conf file for the version 2 Mosquitto is
            Code:
            # Place your local configuration in /etc/mosquitto/conf.d/
            #
            # A full description of the configuration file is at
            # /usr/share/doc/mosquitto/examples/mosquitto.conf.example
            
            pid_file /run/mosquitto/mosquitto.pid
            
            persistence true
            persistence_location /var/lib/mosquitto/
            
            log_dest file /var/log/mosquitto/mosquitto.log
            
            listener 1883
            allow_anonymous true
            
            include_dir /etc/mosquitto/conf.d
            The listener and allow_anonymous lines are needed to make it work like the Mosquitto 1 with general network access.

            Comment


              #7
              Tried all of that, and variations (I have windows, this looks like linux, but should be similar) . But somehow it would never work, only had access on localhost. That will be for next sesson.

              Comment

              Working...
              X