Announcement

Collapse
No announcement yet.

Broker disconnect and reconnect via Node-Red

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

    Broker disconnect and reconnect via Node-Red

    Hi Michael,
    Not sure if you scan all the posts or not. I have an issue with MQTT server broker that connects and disconnects multiple times. The last page of the link bebole shows the issue with the broker. I'm not sure if is McsMQTT, node-red and etc, can you please guide me to the right direction?

    https://forums.homeseer.com/forum/homeseer-products-services/cloud-service-integrations/alexa-smart-home-skill/1320858-alexa-tts-that-works-better-imho-than-the-solution-for-home-assistant/page2

    Thanks,
    Aldo


    #2
    Not a Node-Red user so at a disadvantage from that perspective. Looks like you have a Node-Red MQTTClient widget that is subscribed to a MQTT broker for topic HomeSeer/Status/#. This connection with Broker apparently is not being maintained. When I have multiple clients connected to a Broker it is important that each ClientID is unique when making the broker connection. When there are two with the same ClientID then you will see behavior similar to what is being shown. How does Node-Red have unique ClientIDs setup for each broker connection it is making. mcsMQTT is another client. The ID for it is setup on the General tab. It also needs to be different than the client ID(s) used by Node-Red.

    Comment


      #3
      Thank you so much Michael, you have pointed me to the right direction here, I think I know what is happening.

      Aldo

      Comment


        #4
        Originally posted by alphatech View Post
        Thank you so much Michael, you have pointed me to the right direction here, I think I know what is happening.

        Aldo
        By the way, great plugin, nice done Michael.

        Sent from my SM-G935V using Tapatalk

        Comment


          #5
          After talking with you, the issue auto resolved itself. To be honest with you, I did not know what I did to fix the problem. Today I rebooted HS and it came back. I noticed in HS that there are two listening ports, I'm not a network guy, I'm wondering if HS is listening to something else as well. The node-red is on 52.
          Attached Files

          Comment


            #6
            I moved node-red onto the HS server and I'm still getting the same message, the message is as above, disconnect and connect every minute or so. I need to confess I read your manual and it is over my head. Do I need to change something in the configuration on your plugin?

            Comment


              #7
              My prior input is that my experience with a MQTT Broker connecting and reconnecting to a Client is that two Clients have the same Client ID. The Client ID is setup in mcsMQTT on the General Tab, MQTT Broker Operations section. The location on the network for each Client will not matter as the Broker is looking at Client ID and not Client IP. I do not know how to setup the Client ID on Node-Red or other clients.

              There may be other reasons for continual disconnect which I have not experienced. The MQTT broker should also have a log shown activity. That is the best place to look since the issue is with maintaining the broker connection.

              Comment


                #8
                I think I changed it to the right place. still issues. Do you see anything wrong?
                Attached Files

                Comment


                  #9
                  What you have setup in msMQTT is that mcsMQTT will be the MQTT broker at the IP of HS. Nothing wrong with this, but must who have have other MQTT infrastructure have a dedicated MQTT broker such as Mosquitto so the MQTT network does not go silent when HS is going up and down for updates etc.

                  You have given the mcsMQTT client an ID of "myClient; myClient1" which may work, but not at all intuitive since you have Node-Red using myClient. I suggest that mcsMQTT Client ID something like "mcsMQTT on 192.168.0.16". I am not familiar with what you are showing for Node Red setup screens. I see myClient1 being used twice. If these are each clients then this is likley you source of issue as each client needs an unique Client ID. Why not pick Client ID names that represent what the Client is? Perhaps something like "Alexa Client" and "Homeseer Client".

                  Comment


                    #10
                    Good idea, this is what I have changed.
                    Attached Files

                    Comment


                      #11
                      Tomorrow may brake again but right now I resolved the problem by removing the clientid in node-red, it looks like that if you leave it blank will auto generate. As server in the mqtt property, I have two names, one is MQTTServer and the other is mqttbroker. Under your plugin, MQTT Client ID = myClient.

                      Comment


                        #12
                        You are continuing to try to put your node red Client ID's in mcsMQTT. It is working because you put both names in the text box, but there is no relationship between the mcsMQTT Client ID and those used in node red. By using the ones from node red is just confusing. The mcsMQTT Client ID should be reflective of mcsMQTT and not something in node red.

                        Comment


                          #13
                          Michael, understood, thanks for all your help.

                          Sent from my SM-G935V using Tapatalk

                          Comment

                          Working...
                          X