Git Product home page Git Product logo

Comments (9)

gilmaimon avatar gilmaimon commented on May 24, 2024

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,
Gil.

from arduinowebsockets.

Jonty avatar Jonty commented on May 24, 2024

Oh good, glad it wasn't me being daft! Let me know if there's anything I can do to help debug it.

from arduinowebsockets.

gilmaimon avatar gilmaimon commented on May 24, 2024

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,
Gil.

from arduinowebsockets.

Jonty avatar Jonty commented on May 24, 2024

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 client.connect(websockets_connection_string); to the WebsocketsEvent::ConnectionClosed block does result in the connection reopening, however ping() or send() after that no longer get responses from the server - presumably they're not being sent, or the responses are not being handled.

from arduinowebsockets.

Jonty avatar Jonty commented on May 24, 2024

Sorry to have to reopen this, but it doesn't appear to be resolved for me!

Running the example code above still results in:

.ConnectionOpened
GotPong
Got Message: {"op":"pong"}
ConnectionClosed

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.

from arduinowebsockets.

Jonty avatar Jonty commented on May 24, 2024

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.

from arduinowebsockets.

gilmaimon avatar gilmaimon commented on May 24, 2024

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),
Gil.

from arduinowebsockets.

Jonty avatar Jonty commented on May 24, 2024

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!

from arduinowebsockets.

gilmaimon avatar gilmaimon commented on May 24, 2024

Ok cool, good luck!

from arduinowebsockets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.