Is there a way to use sockets (like the lwip library) on ESP32, rather than the WiFiClient class?
I looked online and some people did it in MicroPython using the Arduino framework, but one in C/C++. So can it be done? If so, any sample code?
what is wrong with WiFiClient?
Nothing is wrong, but using sockets has less overhead, more control, and it's more portable to other OSes (like you can use the same code on a raspi or similar).
WiFiClient actually represents a socket.
There is no protocol defined in the class or other overheads, only the methods needed to write and read bytes from the stream.
Well, just a small overhead, although that's not the main issue.
you can use ESP-IDF
Yes, I know, but I like the convenience of Arduino for some projects.
Yes, you can use sockets. The same way as on much bigger machines.
If I may direct you to my site: GitHub - BojanJurca/Esp32_web_ftp_telnet_server_template: ESP32 with HTTP server, Telnet server, file system, FTP server FTP client, SMTP client, cron daemon and user management, there are examples of both, TCP clients and servers.
Thank you, very nice project!
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.