gysmo38 / mitsubishi2MQTT

Mitsubishi to MQTT with ESP8266 module
GNU Lesser General Public License v2.1
396 stars 141 forks source link

Web Server is incredibly slow if MQTT connection fails #155

Closed zkniebel closed 1 year ago

zkniebel commented 2 years ago

I believe this may be due to the timeout/retry fix applied in the latest version. If the MQTT connection fails, the Web Server takes 2+ minutes per page to load. I realized this after I accidentally included the "https" protocol in with the host. The UI was nice and snappy after I fixed it though.

Posting this primarily so that others see it if they are facing a similar issue.

zkniebel commented 2 years ago

In this commit I removed the retry loop in favor of letting the main loop call for reconnect attempts to fix this issue.

On a semi-related note, I also changed the retry interval to 5 seconds in the subsequent commit to further limit the amount of time / cycles spent reconnecting

ostat commented 2 years ago

I was having this same issue. I was re-configuring my network which resulted in the Mitsubishi2MQTT devices not working, or working very slowly. I assumed there was an issue with the network config causing performance issues. I was not till I saw you post that I tried disabling the MQTT to realise that was the cause. @gysmo38, is this something you might consider adding?

tcgerhard commented 2 years ago

I'm having the same issue with a snapshot downloaded on 7-Feb-22. I had a failed MQTT server, so each connect attempt was waiting on a TCP timeout; this may be blocking at the TCP layer, in which case there's not a lot of options.

mcouture87 commented 2 years ago

I notice if I have MQTT configured that pings to the device times-out and response times are in excess of 150ms verses if I do not have MQTT configured on the device that I no longer have ping time-outs and response times are less than 50ms....

Is there anything that we can do ?

zkniebel commented 2 years ago

I opened this issue almost a year ago and haven’t heard back. I didn’t spend the time to make a PR because I noticed that there were already long-open PRs already that hadn’t been merged. I also haven’t seen gysmo38 reply to issues in a while. I think it’s safe to say that he’s not actively maintaining the code himself.

The code still works, but if you have issues I think you’re pretty much on your own to fix/work around the at this point. When I opened the ticket, I posted links to the commits I made to my fork of the code, and you’re welcome to fork off of mine, pull the changes or otherwise manually apply them yourself.

mcouture87 commented 2 years ago

I downloaded your updated file but noticed one of the includes is "HeatPumpEnhanced.h" Is this the HeatPump.h file just modded? or where do I find this ?

zkniebel commented 2 years ago

That’s just my enhanced version of the HeatPump library with other customizations. You can do a diff on the file(s) you want to pull changes in from and bring those in or just look at the commits I linked and they’ll show you what I changed so you can apply the same changes yourself manually.

mcouture87 commented 2 years ago

Ahh got it....following the bouncing ball now.... I'm a 35 year IT veteran but I am NOT a developer...

zkniebel commented 2 years ago

Ahh got it....following the bouncing ball now.... I'm a 35 year IT veteran but I am NOT a developer...

No worries ;) We all started somewhere

Tobidogger commented 2 years ago

@zkniebel maybe do a PR for all your cool changes and then those of us who want to can "manually" do them?

gysmo38 commented 1 year ago

Old issue. Try new version and open a new one if the issue is still there.

luuks123 commented 11 months ago

This issue i',m having also with the latest version, when the mqtt server is not reacable the module is not responding or very slow. Can you fix this ?

jman311 commented 9 months ago

I just put together a new ESP-01S with latest version and am having this same issue.