-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] HTTP down #299
Comments
Hmm, odd, we had this ages ago on older code with an app using the legacy URLs, but fixed long ago. Try just power cycling or sending Try web via IP not URL/domain in case an mDNS issue. |
Sorry I didn't specify that yes I do use direct ip address to connect to the device. |
Ok not sure, as I say, only seen with some very specific (and now fixed) legacy IP polling. See if its happens again. |
Sure, I'll keep an eye on this, and keep you updated, thanks sir you awesome! |
Hello there again, just a heads up, I got my second device to also "http fail", and I, again, fix it by mqtt restart, and now my 3rd device is in that state too. EDIT: Just wanted to share the status, if no one else is experience this, maybe it's something in my setup |
Are you using the legacy URLs / polling them? |
I just navigate to http://ipaddress in the browser, it usually just works. |
OK but no tools, HA plug-ins, or something, that may be accessing the legacy URLs for data? |
No that Iam aware of, just HA through MQTT, nothing going for the HTTP besides my browser that I rarely use. |
OK, as I know some HA plug-ins use the old URLs, but if using MQTT, that should be fine. Which leaves my rather puzzled at the issue, to be honest. |
It also looks timed, one failed, reboot, about 3/5 days passed by, and then the other one, and repeat. Now is the 3rd one (of 3) I can just reboot it via MQTT too and see if they start from the first one that failed. To give you more of hindsight, I do have a more-than-average network, the Faikins also are in a restricted network, with some cameras in the same segment, with only access to HA trough MQTT, the web access from my computer, and to your update server. I do have some plug-ins in HA, but that were for the "official" modules, and they were assigned different IP addresses, and I dissconect them from the units, so I don't think that could be an issue. |
I have more information to share, it happened again, this time to 2 of the 3 devices I have. It happened just after I changed the wifi band on my AP, does that ring any bell? Again after sending a MQTT reboot the website goes online. I must add I live in an appartment that is very noisy wifi wise. |
This has just happened to me. The device is online - responds to pings, nmap can see it but not analyse it, it works on mqtt, but the webserver times out. Addressed by ip address. Webserver is up again after an mqtt restart. Uptime was a few days. |
Just to check, are you using the legacy URLs? We think, somehow, there is a memory leak, possibly in the ESP IDF. |
I'm not sure what you mean by legacy URLs. I'm using the IP address (192.168.0.150) directly. |
I.e. a monitoring app that talks http to Faikin to get/set data. The way the old Daikin wifi modules used to work. |
I'm using Firefox to read from http://192.168.0.150 (the Faikin) on one computer. The page appears to be refreshed at intervals. I have not disconnected the original Daikin wifi module, but that has never been used, and the Daikin app is not available here. |
OK sounds like you are not using the legacy HTTP API then. The web page on the Faikin is not "refreshed" it uses a web socket. It should have no problem working indefinitely. I'm puzzled if you think it is being refreshed. When we have seen issues with web server stopping it has always been down to someone using some app (not the Daikin app, usually some home assistant plug in that is not using MQTT). That polls the HTTP legacy APIs constantly, and we think there is some memory leak issue from that, but not 100% sure. If you are not doing that, it is the first case of a problem like this. Can you check the settings / basic page occasionally and see if the memory figures on that page are going down over time? |
First off, thanks for the prompt replies - I'm very impressed! |
Have a good night. The fact this is not using legacy HTTP APIs is interesting, and so may give us clues. |
Here are some preliminary results from status/faikin - are these what you need to see?: |
Ah prefect yes mem and SPI, over time. |
No http hangs for several days! |
MQTT is working fine. BUT although HTTP is working on one device I cannot connect on a second device. Current status: |
OK, that means it is not a memory leak. I'll have to look at number of TCP sockets or something. Does it eventually recover, or does it need a restart? |
The working one worked for some hours. But it has also just stopped. It stopped with just the blue background page and 'settings....' at the bottom left, so no updating. So now no http connection on either, but pings and mqtt work fine. |
This sounds a lot like a TCP related issue. I'll have to have a play with the options. |
@revk how can we provide more input if you still can not reproduce as suggested? |
I don't have any other browsers installed, it would be a nuisance if browser specific, but if browsers are opening and holding open TCP connections that would be an issue as limited number of connections. Have you tried with safari at all? |
I'm afraid your customers may have different browser preferences/constraints among classical family Safari, Chrome, Firefox.
Yes fails too on iOS/Safari as already reported. |
OK that is odd as Safari seems OK for me. I can try more. Remote access may not help a lot, ideally I need it broken here so I can add extra debug on serial and monitor what is going on in detail. |
Your call (hoped you could have a special debug version pushing meaningful logs over MQTT). Try accessing with 2 Safari devices accessing same Faikin homepage. |
I will see when I have a chance, two web sockets at a time may be a factor I guess. |
Just to reiterate, I am seeing this issue just using It's entirely possible that the ways a browser does these requests (a larger volume & the addition of web sockets) exacerbates the issue, but this does not appear to be necessary for the issue to occur. |
Thanks for confirmation.
Sure, but the priority at this point is to indeed exacerbate it, so that @revk can at least reproduce & observe it. |
OK how? Just on curl to main page in a loop? Or what? And what do you "see" when it breaks, and how long does it take? |
I do not, and the BLE toggle is set to off.
Whenever the credentials are close to expiring a new set of credentials is generated for a device and a single curl call is done to update them. This call actually includes a bunch of settings but only The full curl command looks something like this: curl http://DEVICE-IP/revk-settings \
--data-urlencode hostname="..." \
--data-urlencode mqtthost="..." \
--data-urlencode mqttuser="$USERNAME" \
--data-urlencode mqttpass="$PASSWORD" \
--data-urlencode mqttport=8883 \
--data-urlencode tz="CET-1CEST,M3.5.0,M10.5.0/3" \
--data-urlencode ha=1\
--data-urlencode ble=0 \
--data-urlencode dark=1 \
--data-urlencode otaauto=0 \
--data-urlencode webcontrol=0
This curl call times out. I believe the default timeout that curl uses is a minute, so that means there was no response from the device within that time. The command will be retried, but it will continue to fail until I reboot the device. |
Wait, what? This is a new one... You are changing settings every 15 minutes, for new MQTT settings? Why? Why do you ever need new MQTT settings? It is interesting that it is a query string. That may be a place to look for memory leaks, etc. |
I don't need to do this (and I'll probably end up switching to using a client certificate instead once I have time to set that up), but for now the credentials that these devices have for MQTT are set to expire after some time, so the device needs new credentials in order to remain connected to MQTT. I mentioned this in an earlier post as well, though I didn't mention the exact interval then:
The behaviour matches a memory leak, yeah. It always seems to take some time after a restart before the problem reoccurs, which also lends credence to that idea. |
I'll follow up the query string. But I still have no clue why you would expire MQTT credentials for mqtts like that. |
No obvious leak in the code, but will test and see if free RAM goes down. |
Thinking about the BLE activation in the context of memory consumption: does having it ON significantly impact RAM usage? |
It does use RAM as it stores all visible temperature sensors. I would not say a lot of RAM (but depends how many devices in view). Also, I expect BLE being enabled at all uses some RAM too, and I don't know how much that is. So it could be a factor. |
Faikin hardware
Faikin-S3-MINI-N4-R2: 91c1bc5 2024-03-31T10:59:15 S21 from Amazon
Daikin hardware
FTXP35N5V1B via s403
Describe the bug
The website goes down, I can control the unit via MQTT and ping it, but no HTTP or whatsoever
To Reproduce
No idea, happened out of the blue, I waited to see if it comes back but no dice.
Expected behavior
Have the web service working, I searched for a reboot via MQTT to see if that fix it, but found none.
Additional context
I have 3 of them, all of them configured and setted up the same day, only one of them failed
The text was updated successfully, but these errors were encountered: