Skip to content
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

AsyncTCPSock vs AsyncTCP #7

Closed
guilhermeaiolfi opened this issue Oct 24, 2021 · 4 comments
Closed

AsyncTCPSock vs AsyncTCP #7

guilhermeaiolfi opened this issue Oct 24, 2021 · 4 comments

Comments

@guilhermeaiolfi
Copy link

Hi,

I am trying to understand how all those pieces in the ESP32 world fit together (I've got one ESP32 a couple of days ago). I played one day in the arduino IDE and now I'm using the PlatformIO and Arduino Core there. I was going to use AsyncTCP and ESPAsyncWebServer but some comments made me look for forks as the stability in the original project is not that great. Hopefully you can put answer some of my questions:

  1. Is this a replacement for AsyncTCP? Can I use in my environment? Or do I need esp-idf (that's something I don't really know exactly what it is).
  2. Your ESPAsyncWebServer are suppose to work with AsyncTCP or AsyncTCPSock? or Both?
  3. What is the advantage of using AsyncTCPSock?

Thanks

@avillacis
Copy link
Member

To answer your questions in order:

  1. AsyncTCPSock is, in fact, an API-compatible replacement for AsyncTCP. As part of the development of the OpenVenti firmware, I realized that, while having the ability to decouple the webserver interface from the main loop (using ESPAsyncWebServer) was good, the underlying library, AsyncTCP, introduced lockups and watchdog resets resulting from a bad design choice (discussed here), which could not be worked around, and so I decided to implement a replacement. You could, probably, use it in your environment in the same way as AsyncTCP could be used. My main development environment is Arduino IDE.
  2. The ESPAsyncWebServer library can be used with /either/ AsyncTCP or AsyncTCPSock, but not both at once in the same project. This is true of the original library, as well as any of the several forks available, including my own.
  3. The main reason to use AsyncTCPSock instead of AsyncTCP is the removal of at least one lockup scenario that may happen. Additionally, I dogfood the library in my own projects, so it should be reasonably up to date and working. Recently it even added conditional support for SSL/TLS connections, which several forks of AsyncTCP offered, yet none of the pull requests have been accepted into the original AsyncTCP library.

Hope this helps.

@guilhermeaiolfi
Copy link
Author

Thank you for the explanation. I started today to play with it. So far so good. I read about the openventi firmware. If it is good enough for a respirator, it will be more than OK for my project :) And congratulations for being part of the OpenVenti firmware. I wasn't aware of it. You are a kind and good man, sir.

@DRSDavidSoft
Copy link

Excellent information, I was wondering about the differences since there is no README.md files. Additionally, if #23 could be addressed, if would be beneficial to new users discovering the repo and using it!

@mathieucarbou
Copy link

Besides #23, you can also see some perf tests I did on ESPAsyncWS comparing the 2 libraries on te community maintained fork of https://github.com/mathieucarbou/ESPAsyncWebServer?tab=readme-ov-file#performance:

https://github.com/mathieucarbou/ESPAsyncWebServer?tab=readme-ov-file#performance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants