Announcement

Collapse
No announcement yet.

Two Clients Same Broker

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

    Two Clients Same Broker

    Click image for larger version

Name:	mqtt1.png
Views:	60
Size:	45.1 KB
ID:	1393585Click image for larger version

Name:	mqtt2.png
Views:	69
Size:	62.6 KB
ID:	1393586

    I need to get some information from a broker pertaining to a particular hardware device. I have two devices and hence two logons to the same broker with different usernames and passwords. Individually, they both work fine. But when I try to do two logons as depicted above I get a failure on connect. I have also tried with having a single value in the Broker ip and port that does not work either. Currently, I am running a nodemcu with two clients connecting to this same broker and then passing the information onto Homeseer with JSON URL's. Not a very elegant solution.
    Any help will be highly appreciated.
    PS this is the first time I am using this plugin.

    #2
    To clarify...
    A setup with a single broker also does not have success with mcsMQTT connection to the broker?

    For diagnosis, remove all the second broker setup, No semicolons should exists in the MQTT Broker Operations section after this is done.

    Is there anything in the HS log to indicate a broker connection issue?

    Comment


      #3
      Single connections with both logons work fine.
      With the double connections Homeseer kind of freezes. I cannot even get to the task manager to kill the instance of HS3. I have to manually (holding the button till it switches off) shut down the computer and restart. Very quickly at the start I disable the plugin - then life is good.
      To answer your second question - I cannot get to the log as the computer is kind of frozen.
      Thank you for responding - it looks like a great plugin. When I was playing around with the plugin with a single connection I was seriously considering of setting up a mqtt broker on one of my machines and connect to my various esp's (20+) doing various things around the house currently communicating with Homeseer using JSON URL's.
      The three choices you give relating to smoothing, rate and cumulative are excellent ideas and would prove to be most usefull, particulary, when one is monitoring energy in and out of solar systems.

      Comment


        #4
        the words low pass filter, diffrential and integral seem more appropriate than the words I used previously: smoothing, rate and cumulative.

        Comment


          #5
          I will take a look at the two broker scenario with both having the same IP. It is not one I previously tested.

          Comment


            #6
            thank you so very much ....

            Comment


              #7
              I had no issues setting up a dual broker on the same IP. My setup is similar to yours. I also had another client monitoring and could see the online and offline LWT messages as broker setup was changed or the plugin restarted.

              What I did discover is that there was some dependency on the sequence when the second broker settings were entered. I changed this in http://mcsSprinklers.com/mcsMQTT_5_2_9_5.zip so it no longer matters. I also recognized that the LWT message should be broker dependent so I allowed different ones for each broker.

              Unzip HSPI_MCSMQTT.exe into the HS folder. mcsMQTT_2020.dl goes in \bin\mcsMQTT folder. Hopefully you will have better luck, but I never really could replicate the behavior you observed. If you do have problems then there may be some info in the mcsMQTT debug file in \data\mcsMQTT that is created when you use the debug option from the top of the General tab. You may want to set it when you have only one broker setup so it will be collecting data as you setup the second.

              While multiple broker entries are needed for the setup the one that determines the actual number of brokers is the Broker IP. This means that you can leave the other settings for the second broker alone and only change the number of broker IPs to switch between one and two brokers.

              Click image for larger version

Name:	Capture.PNG
Views:	54
Size:	106.3 KB
ID:	1393717

              Click image for larger version

Name:	Capture2.PNG
Views:	39
Size:	42.9 KB
ID:	1393718

              Comment


                #8
                Before starting plugin:


                After starting plugin (with two clients dissconnected)



                Single Client Connected



                I did what you instructed (copied the relevant files in the relevant folders) - but the computer kind of freezes with two clients trying to connect.
                Thank you for spending so much time in resolving this problem. Will try and PM you with further details.

                Comment


                  #9
                  It appears I cannot PM you with the logon details. I get the message." Can not send message. User Michael McSharry has exceeded their private message quota.".
                  is there an alternate way I can do this?
                  regards

                  Comment


                    #10
                    email to mcsSolutions at Century Tel dot net. Including the debug file would be good.

                    My PM box is empty, but still not able to get PMs.

                    Note your images do not appear in post #8

                    Comment


                      #11
                      From the debug I see it is an authorization issue and this pointed me to recognizing that I encrypted the passwords together rather than individually when storing to mcsMQTT.ini. This means that decryption failed and the wrong passwords being used to connect.

                      What I do not understand is why CPU use went to 100% in this case as the debug only has the connection attempts every 10 seconds. I tried with two fake brokers which would not connect and my CPU use was very low for mcsMQTT.

                      I fixed the password encryption issue with http://mcsSprinklers.com/mcsMQTT_5_2_9_6.zip

                      Comment


                        #12
                        whatever a user does, a plugin should never freeze homeseer. Did you try the double logon to the mqtt server I mentioned?
                        Will try the updated version and report back in a couple of hours.

                        Comment


                          #13
                          Progress of sorts - at least one broker connects now. Homeseer still freezes. The relevant debug file is attached.

                          Click image for larger version

Name:	afterUpdate.PNG
Views:	25
Size:	69.9 KB
ID:	1394101

                          [ATTACH]n1394102[/ATTACH]

                          Comment


                            #14
                            I did not recognize any URL of a Broker to which I could connect in your email. It may be there, but I did not recognize it. Looking back I see you published a screenshot that included the public IP.

                            I agree that any addon should not disable the parent, but I do not have any visibility as to what is causing the high CPU use. I have connected to your Broker with your credentials for both logins and everything looks normal. I have not attempted to communicate via your broker by publishing, but I have received topics . Stats look like the following. Task manager put mcsMQTT near 0%.

                            Click image for larger version

Name:	Capture.PNG
Views:	30
Size:	13.3 KB
ID:	1394106

                            Comment


                              #15
                              Looking at your debug I see the second broker has not authorized connection. It is awkward to enter the password when the feedback is just as set of *. What I did was copy/paste your first one, inserted a semicolon, copy/pasted your second password.

                              I will continue to look with an invalid second broker password.

                              Comment

                              Working...
                              X