-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Disconnect on large websocket message #21
Comments
I've looked into it abit. This looks like a bug in the library itself, it has nothing to do with memory restrictions on the esp32 or anything like that. I'm not even sure it has something to do with the message size, I think it's something about the protocol that is not implemented corectly (probably on my end). I've tried poking around, but nothing too obvious popped out. I'm working on it and will keep you updated. Thanks, |
Oh good, glad it wasn't me being daft! Let me know if there's anything I can do to help debug it. |
Thanks again for openning this issue @Jonty! Look for version 0.4.7, It should resolve your issue. I've tested it locally and it seems to work fine. Iv'e tried running your code on an ESP8266 and it crashed, I guess it makes sense considering how much data is being transferred. (Everything worked fine with an ESP32, after using the new version). Version 0.4.7 is available as a zip from the release page, and it will be on the Library Manager very soon. Please make sure everything works as expected on your end. Best regards, |
Just in case this is also relevant, I can't seem to find any way to get the library to reconnect properly when the connection closes like this. Adding |
Sorry to have to reopen this, but it doesn't appear to be resolved for me! Running the example code above still results in:
I've fetched the latest zip and installed it - I even removed the library and checked it wouldn't build when it was removed! No dice. If there's anything I can do to help debug this, let me know. |
Bah, wait, ignore me - this seems to have been a cache problem. It is now reliably crashing so I presume this esp32 doesn't have enough memory! Thanks. |
Well, I get inconsistent crashes. Sometimes the ESP32 does not crash and prints the data correctly. I might try to improve the memory usage of the library, it is far from optimized.. Anyway, I recommend you try another websockets library just to see if it's an optimization problem or a physical restriction. Let me know if you found a solution (if you don't mind sharing), |
I am almost certain that is because the response sizes can vary enormously and it's hit-and-miss as to if the data will fit in memory on a standard ESP32 WROOM module - I've got a much larger WROVER module on the way and will test with that! |
Ok cool, good luck! |
Hello!
I'm trying to use this library on an ESP32 against API's that stream very large messages (~40k).
It works fine for the smaller messages, however as soon as a large message (should be) received a
WebsocketsEvent::ConnectionClosed
event is emitted and the connection is dropped.I did some brief digging and it looks like the TCP connection stops being
available()
, but I'm not clear why.This example code demonstrates the problem:
Any help very much appreciated.
The text was updated successfully, but these errors were encountered: