arduinoWebSockets icon indicating copy to clipboard operation
arduinoWebSockets copied to clipboard

ESP32 Async Mode

Open n9wxu opened this issue 5 years ago • 7 comments

I would like to use the ESP32 in Async Mode with the websocket library. It appears that the trigger for this is NETWORK_ESP8266_ASYNC as further into that branch, there is a check for ESP32.

This is not clear to me and I would hate to put references to the ESP8266 in my ESP32 project. That will cause confusion to my future self.

n9wxu avatar May 14 '20 15:05 n9wxu

does the ESP32 have a async backend? the lib is using ESPAsyncTCP for the ESP8266. if there is a equivalent for the ESP32, integrating a new Network option is possible. if the ESP32 lib shares the same API then the ESPAsyncTCP variant its easy, otherwise it requires some work.

Links2004 avatar May 14 '20 16:05 Links2004

Yes It is called AsyncTCP

Look here for an example: https://github.com/me-no-dev/ESPAsyncWebServer

n9wxu avatar May 14 '20 19:05 n9wxu

Yes It is called AsyncTCP

Look here for an example: https://github.com/me-no-dev/ESPAsyncWebServer

ESPAsyncWebServer implements only server side of webSockets. We also need client...

petr-fiala avatar Nov 08 '20 21:11 petr-fiala

Yes It is called AsyncTCP

@n9wxu You copied a link to the server.

https://github.com/me-no-dev/AsyncTCP

@petr-fiala @Links2004 I am not sure if it is the exact same API but it shares a lot with ESPAsynTCP.

CelliesProjects avatar Dec 01 '20 16:12 CelliesProjects

@CelliesProjects i tried to use AsyncTCP with arduinoWebSockets on esp32, i managed to integrate it, but it was crashing like crazy, every 1 - 5 second esp32 restarted.. my guess is that there is too may dynamic allocations, after few seconds i always ended up with f*cked up (fragmented) memory which causes esp32 restart. I also tryed to fix it, remove as many dynamic allocations as i could but i wasnt successful.

I'm using arduinoWebSockets for realtime video transfer between two esp32s, so any leaks or significant memory fragmentation will make it crash in a few seconds. @Links2004 should try to integrate AsyncTCP, it would be absolutely awesome to have async arduinoWebSockets for esp32.

petr-fiala avatar Dec 01 '20 17:12 petr-fiala

@Links2004

yangminglong avatar Nov 07 '22 02:11 yangminglong

+1

lucasalberto01 avatar Feb 19 '24 13:02 lucasalberto01