Announcement

Collapse
No announcement yet.

mcsMQTT not responding

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

    mcsMQTT not responding

    Hi Guys,

    I was attempting to add an Athom Smart Plug Tasmota device and now my mcsMQTT (Version=5.26.5.4) has become unresponsive.

    I left it go for a while and eventually after about 2.5 hours it is now populating the mcsMQTT Debug.txt in the background with topics, but the MQTT/Associations setup page is blank. From HomeSeer I can't change any of the mcsMQTT settings, the mcsMQTT web pages won't respond.

    Is there a way to get mcsMQTT to load in a safe-mode or a way to change the settings in the background without using HomeSeer HS4?
    If so, what should I turn off to so that I can get it to be responsive again.

    I see that there is a mcsMQTT.ini but there is not much in it, is there another file with settings?

    I have these warnings in the HS4 log :

    Warning: Plugin mcsMQTT is not responding but it is still running, not restarting yet.
    Warning: I/O interface mcsMQTT is down, executable is not running, restarting ...


    Any ideas?


    Thanks,
    Bruce

    #2
    If CPU utilization for mcsMQTT is very high and you are using the internal broker, then the likely cause is the internal broker. I have an update for this problem will be released very soon.

    If your issue is related to receiving mcsMQTT messages then mcsMQTT.ini with setting in [General] group of Disconnect=1 will disable connection to the broker. If you are using BLE beacons then BeaconEnable=0. There are others but these three are usually the big hitters.

    I can also assess what may be happening if you zip up \config\mcsMQTT.ini, \data\mcsMQTT\mcsMQTT.db, and \data\mcsMQTT\mcsMQTT Debug.txt and post, PM or email to mcsSolutions at CenturyTel dot net.

    Use Task Manager (Windows) Top/HTop (Linux) to assess CPU utilization. Use HS UI to disable the plugin and then reenable it.



    Comment


      #3
      Hi Michael,

      Thank you so much for offering to assist with this issue.
      I have zipped & emailed you the MQTT files as requested.
      There is also an extra debug file that is a copy I saved last night after I realized it was running after waiting 2-3 hours for startup.


      I tested your suggestion by adding the following settings to the mcsMQTT.ini
      [General]
      Disconnect=1
      BeaconEnable=0


      These INI changes did not seem to change anything. When I try to access the MQTT setup page in HomeSeer I only see a blank white page with the mcsMQTT headings at the top (Associations | Edit/Add | Publist/Sign | General | ... etc).

      This is also affecting HomeSeer performance, currently the only way I have found to get out of it is to restart HomeSeer service, then as soon as HS4 loads again go to HS4 plugins and turn off the mcsMQTT plugin.

      I only have the one PC that runs everything:
      • HomeSeer HS4
      • mcsMQTT broker
      • BlueIris Cameras
      It is a fast PC Intel 12Gen CPU 32GB RAM Windows 11. CPU usage is around 3 to 7%.

      Some background, I don't have many MQTT devices set up yet.
      1. M5Stack Atom-U reading fridge/freezer temps - this was working well for a couple of months.
      2. Shelly Plus 1PM WiFi relay switch - I was bench testing this last week, this was working well, but it is currently disconnected.
      3. Athom Smart Plug Tasmota device - I was attempting to add this new device but now I fear I have broken something in the mcsMQTT setup.
      What happens if configured MQTT devices are powered off? Does this impact performance?

      Thanks again.

      Cheers,
      Bruce​

      Comment


        #4
        I received your email. One debug is very short where initialization does not complete. The other confirms you are using internal broker. For a test edit mcsMQTT.ini to put in something like MQTTBroker="192.168.0.16". This will make mcsMQTT try to connect to a MQTT Broker at 192.168.0.16 which should fail, but it will prevent the internal broker from starting.

        Comment


          #5
          I also see you have topics from ESP32 such as home/OMG-ESP32-1/BTtoMQTT/... I know of ESP32 devices that flood MQTT communications with Bluetooth messages. Unplug the ESP32 that is generating these as a test. Note that when MQTTBroker setting in the prior post is used then the ESP32 no longer has the ability to connect to mcsMQTT so this test is independent of the prior one. Actually the Disconnect=1 should also prevent receiving these messages so the test may not help much.

          Comment


            #6
            I tried the suggestion from Post 4 with MQTTBroker="192.168.0.16" however this does not seem to have improved anything.
            If I try to access the mcsMQTT setup from HS4 plugins page my browser hangs/spinning, then eventually after approx 10 mins displays a blank white page with the mcsMQTT headings at the top.

            I then tried suggestion from Post #5 with ESP32 unplugged however this also unfortunately does not seem to have improved anything with same outcome.

            Comment


              #7
              When a mcsMQTT browser page is accessed, it marks it in the debug with the following at the start and the end. It is trying to show how long it takes to return the page to HS for return to the browser. In my case below is was (12313 - 12198 = 115) milliseconds.

              [code]
              10/14/2022 3:12:49 PM 12197 | Added Browser Page IMQTT031249399
              10/14/2022 3:12:49 PM 12198 | Page Timing Start
              10/14/2022 3:12:49 PM 12232 | Sort > 0
              10/14/2022 3:12:49 PM 12313 | Page Timing End​
              /code]

              In your longer debug there was only one browser access. It started during the plugin's initialization and only completed after initialization finished which was 17 seconds later. 12 of those seconds was from a request to "http://localhost:80/interfaces" which is a HS legacy page used to get the list of plugins. HS did not return a response and timed out.

              Do you require login credentials with browser access on the local LAN? If you do it is entered on the General tab at the bottom of the screenshot below. It is encrypted in mcsMQTT.ini so you cannot do it by editing mcsMQTT.ini. Hopefully you will be able to after following the instructions for the test shown at the bottom of this post.

              Click image for larger version

Name:	0x.png
Views:	197
Size:	30.1 KB
ID:	1570827

              Code:
              14/10/2022 7:21:48 PM    9339397    | Added Browser Page IMQTT072148537  
              14/10/2022 7:21:48 PM    9339397    | Page Timing Start  ​
              :
              :
              14/10/2022 7:21:49 PM    9340853    | ActOnMessageForTrigger QueueSize=1 ,Topic home/OMG-ESP32-1/SYStoMQTT,Payload
              14/10/2022 7:21:53 PM    9344150    | SubmitGet http://localhost:80/interfaces    at System.Net.HttpWebRequest.GetResponse()
                 at MCSMQTTHS4_2020.PluginAction.SubmitGet(String sURL) in C:\Users\Public\Documents\TFVC\HS\MQTT\MCSMQTTHS4_2020\CPU.vb:line 996
               Line 0 The operation has timed out 0 The operation has timed out
              
              14/10/2022 7:21:53 PM    9344150    | mcsMQTT Debug Background Init Done
              14/10/2022 7:22:05 PM    9356042    | Sort > 0  
              14/10/2022 7:22:05 PM    9356107    | Page Timing End  ​
              There were also many MQTT messages received from the ESP32 during this initialization time. The pattern of the messages in the debug shows that the message rate was higher than the rate that mcsMQTT is able to support with many of them resulting in HS devices being updated based upon the content of the ESP32 messages.

              The bottom line is the bigger debug shows and ESP32 message rate higher than HS/mcsMQTT is able to handle and things just get backed with no recovery since the rate never subsides.

              The first step is to get mcsMQTT running and not listening to the ESP32. This should allow us to peel the onion and see what is happening at the next layer. Can you provide the debug for the case where mcsMQTT.ini has
              MQTTBroker="192.168.0.16" and
              Disconnect=1
              After mcsMQTT has been enabled. Wait about a minute then try to use browser to access MQTT page. wait for the response and then provide mcsMQTT Debug.txt.

              Comment


                #8
                Hi Michael,

                I have followed the test suggested and have zipped & emailed you the MQTT files as requested.

                I do need to enter a username & password for MQTT however currently all the mcsMQTT setup pages are not displaying anymore they all show as a blank page with only the top banner, and so I don't seem to have any ability to change the settings apart from via the INI file in the background.
                This was working last week. I am not sure what has upset it.

                It seems that all the new Shelly devices are now using the ESP32 CPU chip, and I currently just have one Shelly ESP32 device for testing but what happens when one has a whole house of many Shelly ESP32 devices? I presume that there is a way to control the message rate.

                Thank you.

                Regards,
                Bruce​

                Comment


                  #9

                  I am having some difficulty locating the appropriate options to control the rate and amount of traffic identified that is bogging down my MQTT setup.

                  I believe that the device causing the issue is an M5Stack Atom-U ESP32 located near the fridge which receives Bluetooth info from various devices and relays by MQTT over the Wi-Fi to my HomeSeer server. I had set up this device flashed with Open MQTT Gateway firmware and was using it to relay Bluetooth to MQTT from:

                  Two Xiaomi LYWSD03MMC temperature sensors that are located in my fridge & freezer.
                  Data from a couple of Blue Charm Beacons (BC011)

                  I went to investigate config options with the Open MQTT Gateway but found that the only way to change the options was to reflash the device over USB connection and so have decided to switch to use Tasmota firmware on the M5Stack Atom-U as the Tasmota firmware options can be changed easier OTA using Wi-Fi which is easier for devices in hard to access locations. The Tasmota firmware I am using is "Tasmota32-Bluetooth.bin" for ESP32.

                  Do you know which commands/options I will need to fine tune to get this application stable and functioning?

                  Are the tuning options located in Tasmota, mcsMQTT plugin, the LYWSD03MMC's or a combination?

                  Thanks so much.

                  Regards,
                  Bruce​

                  Comment


                    #10
                    I am not familiar with the Bluetooth options available on the applications your referenced, but what is typically done in mcsMQTT is to subscribe to only the topics that have been associated with HS devices. These are the topics that you have interest. The other 95% you do not need to manage within mcsMQTT.

                    When you introduce a new device, you want mcsMQTT to see it so you can pick and choose those items of interest. The specific setting in mcsMQTT that controls this is on the General tab of the MQTT page. You can change this setting back and forth as the need exists.



                    When you are in the setup mode looking for new device the setting will be as shown above. After you have associated those items from the Association tab that you want to map into HS devices then change the Topic Discovery radio setting to the middle position. As a good measure you many want to restart mcsMQTT, but it may not be necessary.

                    What this does is tell the MQTT Broker to only send specific messages to mcsMQTT rather than everything that was sent to the Broker. This greatly reduces the CPU burden in cases such as you are experiencing.

                    While you have the ability to access the mcsMQTT pages you should also provice the LAN login credentials so there will not be a long wait during initialization when mcsMQTT asks HS for list of plugins.

                    Comment


                      #11
                      Just wanted to update and let you know that this is all working great now. Thank you so much for your help it was much appreciated.

                      Comment

                      Working...
                      X