Git Product home page Git Product logo

Comments (6)

Jonty avatar Jonty commented on May 24, 2024 1

This works beautifully! Apologies I didn't have time to help you debug it.

Thank you so much for all your help. If you have a wishlist/patreon/similar, please let me know.

from arduinowebsockets.

gilmaimon avatar gilmaimon commented on May 24, 2024

Interesting.

The MAX value you are seeing is actually -1 but is shown as max value because the variable is signed. -1 indicates an error in receiving data from the socket. I will look into it now.

Also, I've added a c++ tag to your code snipped (edited your post) so it's easier to read, I hope you don't mind.

I will look at it and will keep you updated.

Gil.

from arduinowebsockets.

Jonty avatar Jonty commented on May 24, 2024

I thought that might be the case but didn't want to presume! Let me know if I can help with the debugging.

from arduinowebsockets.

gilmaimon avatar gilmaimon commented on May 24, 2024

Sure,
Few experiments you could make that will help pin down the problem:

  • Run the exact same thing with the highest debug settings. Meaning set esp32 logs to Verbose. This should tell us a lot about what's going in inside the esp32 libraries.
  • Run the code with the latest Arduino-ESP32 libraries. I've found out recently that the Espressif team working on that is doing a lot of changes without pushing them as stable releases. Can you try cloning the master branch and run the same code?
  • Last thing, which will help if this is actually a memory issue. Is to add this line before connect:
client.setFragmentsPolicy(FragmentsPolicy_Notify);

Websocket servers often use fragmented messages to send large amounts of data. I aggregate those fragments inside the library's memory and then pass it as a complete message. Adding that line will cause each fragment to be passed to the callback, thus (hopefully) saving plenty of memory. If the esp32 is running out of space, this might help.

I had to reset my PC this weekend, so I'm still setting everything up.

Thanks,
Gil.

from arduinowebsockets.

gilmaimon avatar gilmaimon commented on May 24, 2024

I've worked on your issue, I believe it is fixed now. Please look at the branch bugfix/unchecked_reads_issue_26

It should really improve error handling and memory management.

Please let me know if it's working for you (with your new board) before I merge it.

Gil.

from arduinowebsockets.

gilmaimon avatar gilmaimon commented on May 24, 2024

Thank you! Iv'e released version 0.4.10 with the patch.

Your time invested in opening your issues and helping the library evolve is all I need! (You could give the library a star, it might help others find it 😅)

Have an awesome day,
Gil.

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.