-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Websocket connections not working anymore for >0.14.1 #3855
Comments
Same with ESP8266 |
Please post your WS connection details and @willmmiles may have solution. |
Replicated on 0.14.2, works on 0.15. Investigating. I'm using |
Seems to work on 0.14.3 as well. I suspect this may have been fixed by the websocket memory management fixes in the newer version of AsyncWebServer. |
In the meantime I am able to catch a serial dump, however my WLED version does not include debug symbols. So nothing here to see :-(. I tested with 0.15.0-b1 and fails again. The connection request triggers a reboot of my device. If someone can provide a WLED_0.15.0-b1_ESP32.bin or any other affected version with debug symbols enabled I am happy to test. How do I get 0.14.3? |
Both versions available on Discord. |
Thx, will download and continue testing... |
Okay, here is the serial dump from a 0.14.3 debug build. As soon as my client connects, a reboot is triggered. I did this several times (see attached log) Is there anything more I can test/provide? |
Can you please send a backup of your cfg and presets? Then erase the flash storage ( I had a case yesterday where the filesystem seemed to be corrupted, and reading presets.json was causing crashes and other weird behaviour. Rebuilding the filesystem seems to fix it. I'm not sure what caused the corruption yet - I go back and forth between versions a lot. |
Here are the requested files. I changed the servers/user credentials. Hope, that this is not the deciding factor. At the moment I do not have PlatformIO installed. Will a factory reset using der web interface also to rebuilding the file system? Thanks for your help! |
Please add this to your environment and monitor from within PIO. It looks to me as it does not crash within WLED procedures though. |
Okay, please give me some time to setup everything. It has been a long time since I have been working with PlatformIO 😅. |
happening to me as well. downgrading to 0.13.1 fixes the issue. |
I got the toolchain working :-). Here is the output when connecting via websocket to a freshly uploaded esp32 image.
My WLED has no configuration except an IP adress for my Wifi. No presets or any other changes were made. If you need more information just tell. The reboot is triggered by a simple node app trying to connect... |
As I suspected, the error is not in WLED code but, unfortunately, in AsyncWebServer library. Can you capture a packet that causes the crash? Using Wireshark or similar. |
Or alternately, post a link to your node app. There's something different about the headers from the usual browser connections. |
Here are both: the very basic node app and the Wireshark recordings... Wireshark.zip Please change your WLED's IP in index.ts and run
If everything works, WLED's current state should be logged to the console. Happy easter |
Thanks for bearing with me! I was able to replicate it using your code and config, and tracked this to a use-after-free in AsyncWebServer. It was indeed triggered by the headers sent by node, and wouldn't replicate unless some other code caught it with its pants down, so to speak. I've pushed AsyncWebServer v2.2.1 which has the fix, and opened PR #3873 to adopt it. |
Perfect, I will re-run my tests after the PR merge. |
You can test it immediately by temporarily changing your copy of platformio.ini |
You're right. I quickly rebuilt the image with version 2.2.1 of AsyncWebserver, restored my presets and other settings and .... everything works again 👍 I enabled my Homebridge plugin again and as far as I could see, communication worked as it should be and as it was last seen in WLED 0.14.1. I will keep an eye on it for some of days... Thank you very much @willmmiles , @blazoncek ! |
What happened?
I am using a third-party library (wled-client) to access my WLED using websockets. After upgrading my WLED to any version newer than 0.14.1 the library stopped working. I replaced it with a native websocket implementation and it didn't work either. I always get ECONNRESET when trying to open the socket. After downgrading to 0.14.1. everything works again. The web interface is accessible without any issues. Http API is also working as expected.
To Reproduce Bug
Use any websocket client and connect to ws:///ws. It should return immediately the wled state upon connect. In my case it returns nothing.
Expected Behavior
Upon successful connection the state object should be returned.
Install Method
Binary from WLED.me
What version of WLED?
0.14.2
Which microcontroller/board are you seeing the problem on?
ESP32
Relevant log/trace output
No response
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: