-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Invalid response from WLED API in Home Assistant when simply turning on the LED strip #4546
Comments
It's very intermittent and I can't reproduce it on demand, but here's a log entry from when activating a scene in Home Assistant.
|
to offer any help, we'd need to know what ther expected response is and what the actual response is WLED sends. |
Thank you for the log! |
@Aircoookie anything we can do to figure this out? Personally I think it has to do with the ESP8266 module that has less memory then the ESP32, but still weird though because it works on 0.14.4 and it is a fairly short ledstrip (although long data cable to the ledstrip itself of 3m. Just thinking out loud here as my knowledge about this is far from many of you here, but could it be that the cable length is causing a delay between the command send by WLED and the response from the strip itself which in turn causes these issues? I can't speak for the others noticing this same bug, but I can imagine something like this happens. And it could be that added features in the 0.15 release causes the node to use more memory and therefor have more issues with things like this on lower end node like the ESP8266. |
If it helps, my log above is from an ESP8266 device running WLED. |
@FGOD1983 can you try if the latest alpha (nightly build) changes anything? recently a new way of incoming request-queue handling was added but I am not familiar with what exactly changed. |
yeah sure, will give that a try the coming days. Let's hope it fixes the issues |
Do I need to use the normal 8266 bin file or the compat one?
|
FYI handling of 503 (standard HTTP error code for internal server error) should be correctly implemented in Home Assistant. As @DedeHai pointed out in the code, 503 is issued when JSON buffer cannot be locked as it is already locked by another request. There is a work by @willmmiles that will implement queueing in AWS but is not yet used. Unfortunately it increases binary size considerably. If you want immediate resolution, switch to ESP32 or reduce number of HTTP/MQTT/IR/playlist JSON requests (and their cadence). |
@blazoncek so basically, my assumption that the setting of the preset by the automation and then turning the ledstrip on, goes to fast sometimes resulting in these errors and putting a second wait between them could resolve this issue? |
Sorry I'm just catching up. The queuing logic is all merged, but it looks like something has gone wrong with that process - we shouldn't be generating a 503 and then calling |
Arg, I'm just misinterpreting the image of a diff above -- I'm used to a line-oriented diff display. The 0.16 code is fine. So to summarize: a 503 HTTP response ("Service Unavailable") is WLED telling the client to "come back later", and no, HA doesn't respect them and faults instead. The switch to using the new AWS |
so with 0.16 there is no need for HA to adjust something in this matter? So far the ledstrip has been working correctly, but I didn't go outside enough in the evening/morning yet to test it enough. |
"Need" is a strong word .. ;) Yes, 0.16 attempts to accommodate clients that don't properly handle HTTP retries. |
I'm on 0.15.0 |
What happened?
Many times when one of my automations in Home Assistant is just simply turning on the LED strip (60 LEDs, no segments, so not really a big thing), the Home Assistant automation fails to do so because it received a
Invalid response from WLED API
error response from the device.1 minute later it would just turn on fine as it would normally do without issues.
This started to happen since version 0.15.0 and as some people reported on this Home Assistant issue (home-assistant/core#132284), the issues are gone when you downgrade back to 0.14.4.
To Reproduce Bug
It is hard to reproduce as it seems to be just randomly happening and a few seconds/minutes later there is no issue at all when turning on the device. It also seems to be correctly working when you manually turn on the device in Home Assistant.
It could be that in the automation I let it set a preset and then turn it on which could cause a API timeout if that happens to fast, but then again, it does work a minute later and there are no issues with this on 0.14.4
Expected Behavior
just normally turn on the LED strip without errors or timeouts
Install Method
Binary from WLED.me
What version of WLED?
0.15.0
Which microcontroller/board are you seeing the problem on?
ESP8266
Relevant log/trace output
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: