-
-
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
SyntaxError and sometimes a reset when changing presets in 2D. #3382
Comments
Here is a bigger configuration with more frequent errors. Switch between preset 23 (PixelsFire) and preset 14 (Start). |
For JSON errors you need browser's developer tools and see console log. |
Also preset file in the movie does not correspond to attached presets. |
Did You use the preset file from my first post? |
O.K. I got it. CSS is enable custom CSS in User Settings. So I diabled it. So where can I find the GET JSON with an error? |
Any file with JSON type. I.e. |
Yes. That's corrupt JSON. |
If you are not using ESP8266 then check if you flashed your ESP with non-standard flash or CPU speed (lowering the values to standard specs). If you are using ESP8266 I've seen such behaviour after we upgraded core to 3.1.2 but is transient in nature. Some responses may be corrupted. I am guessing some out-of-order new/free behaviour of AsyncWebServer or its components. |
Looks like the issue is connected to the number of segments or the size of segment data. |
Additional info: This is UI only problem as the HTTP response contains corrupt data (HTTP headers inserted into HTTP response payload). The issue (most likely) arises from the following code in AsyncJsonResponse *response = new AsyncJsonResponse(&doc, subJson==JSON_PATH_FXDATA || subJson==JSON_PATH_EFFECTS); // will clear and convert JsonDocument into JsonArray if necessary
JsonVariant lDoc = response->getRoot();
...
response->setLength();
request->send(response); Looks very much similar to what I've observed on ESP8266. Reducing the number of segments to 14 alleviates the problem. WS responses are not affected. |
I deleted 3 segments. Now I can not reproduce the error. It doesn't matter which 3 segments I delete, so I think the maximum number of segments when using ledmap is 13 !?! |
It is not ledmap related. At least I think so. |
You're right. I mean 2D matrix. My preset does not use a ledmap file. |
Similar to #3312 |
@blazoncek this is the first "smoking gun" with a full debug build - looks like stack overflow. I'll continue to investigate.
|
Debug and stack use are enemies. |
Seems you are right - it only happens with So back to zero. At least I can reproduce the UI JSON error. |
I can do that, but not consistently. |
@blazoncek can you cross-check something? I've changed this line in ws.cpp to
With this change I do not get the UI error any more. But not sure if this is a real fix, or its just hiding the symptoms. What do you think? the docs for measureJson say:
So if we want to serialise to a string, one more char is needed for the terminating '\0'. |
Would it be possible that these two (#3295) are related? |
I invite you to test |
The only explanation (suggested by your last screenshot) is that you run out of heap. Reduce your segment complexity or use ESP with PSRAM. |
One more thing. |
And what is the last response from WLED (network tab, click on the last message). |
In general, I have to say that I see these errors more and more often in my projects. It doesn't matter whether I use an ESP32 or D1Mini and whether I use LED MAPs or not. |
That does not explain I give up. You'll need to debug your issue on your own and if you indeed find a bug please report back. |
I give up, too. |
What happened?
I made an illuminated sign for the back under my jersey for my favorite club.
There are 540 LEDs arranged irregularly on the sign. I configured WLED so that I use this in a 2D Matrix.
When I choose a presets I often got a syntax error or a reset of the ESP32, even with the simplest configuration.
0923.1.mp4
To Reproduce Bug
Use the attached cfg and preset file.
preset_cfg.zip
Select the “Start” preset several times.
Expected Behavior
I expected that there would be no reset or error when changing the preset.
Install Method
Self-Compiled
What version of WLED?
WLED v0.14.0-b5 "Hoshi" (Build 2309100)
Which microcontroller/board are you seeing the problem on?
ESP32, ESP32-S3
Relevant log/trace output
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: