-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Service error in Home Assistant if more than 2 segments are added #3447
Comments
Can you provide the JSON HomeAssistant is getting? |
Tell me how to do it? |
Use Wireshark. |
Having same issue; one WLED setup with a single segment works fine. The other two WLED setups that both have 3 segments (plus the Main conrol) exhibit the same/similar problem when turning on/off, of Besides Wireshark, which isn't feasible here, is there another method to get HA to dump the JSON and/or commands? |
That's a request for HA team. |
Hi, Example:
As you can see there is no proper closing of the json-string in the response of the wled-device which I think leads to the error messages in Home Assistant beause it is not a valid json response which gets parsed in Home Assistant. Example of a WLED Device with one segment and version 0.13.3 which does not generate error messages in Home Assistant:
Here the json in the response is valid. Hope that helps for further debugging.. Regards |
@saruter thanks. Unfortunately it still does not show why. If you have a PacketSender you can also use that to capture response in entirety. |
@blazoncek The pcap file was recorded on the Home Assistant Host System with the following command Infos about IPs and content: When turning the WLED-Device on or off in Home Assistant the following error is displayed: When looking at the response of the WLED-Device at first I observed that the json-string seems not to be ended/closed correctly. When looking closer at the characters in the json response which seems to raise the error message in Home Assistant I looked closer at the characters at char 861 and observed that there are two colons in a row
Hope that helps... |
I have yet to review packet capture but this looks to me as a known issue with AsyncWebServer corrupting JSON text buffer although I've only seen JSON corruption on ESP8266. What happens if you submit the same packet using PacketSender application? What I mean is reducing the amount of packets/requests submitted to ESP to a single one. |
I just tried with Packetsender: Sending HTTP Post for turning on, response: So it seems to be the same here, but I found out that the problematic characters are always happening in Segment json with id 2 and it is a little different when turning on and off but has two times the "spc" string there. That's not happening in the other json for the other segments: Problematic json when turning off: |
I've tried several times (on each of ESP8266, ESP32, ESP32-C3, ESP32-S2) and I was not able to reproduce. @saruter can you contact me on Discord and I'll send specially built binary. |
This is happening to me on HA 10.3 and WLED 14. I had a light (Shelf Light) that had three segments and when I tried to update to WLED 14 via the Home Assistant GUI, it failed out so I reflashed WLED directly onto the device (8266). I renamed the light to "Shelf Light" and re-added it to HA, and since then it's been giving the error mentioned a few times. I didn't know if anyone else having the error had also re-added an existing light. |
I ran into this as well, and can reproduce it with curl:
As you can see, the JSON is truncated. The Content-Length does match what was returned. WLED v0.14.0 "Hoshi", installed today, on "esp8266 3.1.2 (2)" (it's a Wemos D1 Mini). |
0.13.3:
|
It looks like the JSON really is bigger, and hits some size limit? |
Please try 0_15 branch. |
and HA seems happy too :-) |
Is the workaround/solution at this point to build from the 0.15 branch? Thanks. |
Using WLED 14.4 (didn't try 14.1, 14.2 and 14.3) the issue is now resolved. So AFAIC this issue can be closed. |
What happened?
On version wled 0.14, when adding more than 2 segments to the home assistant while turning on the segments, a service error appears (Could not call the light/turn_on service. unexpected character: line 1 column 851 (char 850)
To Reproduce Bug
Add more than 2 segments
Expected Behavior
Operation of more segments
Install Method
Binary from WLED.me
What version of WLED?
WLED 0.14.0
Which microcontroller/board are you seeing the problem on?
ESP8266
Relevant log/trace output
Anything else?
Sorry if the text looks stupid, I wrote it through a translator
Code of Conduct
The text was updated successfully, but these errors were encountered: