Page 1 of 1
AsyncWebSocket: is there an equivalent in arduino-esp32 v3.0.0 ?
Posted: Wed May 22, 2024 1:04 pm
by PaulZC
Hi,
We have been using me-no-dev's ESPAsyncWebServer very successfully for a couple of years, with arduino-esp32 <= v2.0.11.
I am investigating whether it is possible to replace ESPAsyncWebServer with WebServer on arduino-esp32 v3.0.0 (RC3). I have the WebServer running on both WiFi and ETH (W5500), but I can not find an equivalent for AsyncWebSocket and/or a handler for "/ws"...
Is it possible to replicate AsyncWebSocket with WebServer in arduino-esp32 v3.0.0 ?
I'd be really grateful if someone could point me at some code....
Sincere thanks in advance,
Paul
Re: AsyncWebSocket: is there an equivalent in arduino-esp32 v3.0.0 ?
Posted: Wed May 22, 2024 4:23 pm
by lbernstone
WebServer simply doesn't have that functionality. There are a couple websocket libraries out there, but you can only have one or the other library listening on a port, so you can't service both at the same time. The
ESP-IDF http server library does have a websocket server included.
Re: AsyncWebSocket: is there an equivalent in arduino-esp32 v3.0.0 ?
Posted: Thu May 23, 2024 6:00 pm
by PaulZC
Many thanks lbernstone ,
I've got WebServer and esp_http_server running simultaneously. esp_http_server is only serving the /ws websocket - on port 81. WebServer is doing everything else - on port 80. They seem to be playing very nicely together! I stole most of the websocket code from the ws_echo_server protocol example.
Very best wishes,
Paul
Re: AsyncWebSocket: is there an equivalent in arduino-esp32 v3.0.0 ?
Posted: Wed Jun 05, 2024 1:28 am
by noweare
PaulZC wrote: ↑Thu May 23, 2024 6:00 pm
I've got WebServer and esp_http_server running simultaneously. esp_http_server is only serving the /ws websocket - on port 81. WebServer is doing everything else - on port 80. They seem to be playing very nicely together! I stole most of the websocket code from the ws_echo_server protocol example.
I got the webserver and sockets working just using the esp_http_server if your interested.
Re: AsyncWebSocket: is there an equivalent in arduino-esp32 v3.0.0 ?
Posted: Wed Jun 05, 2024 7:24 am
by Basalt
I’m interested!
Can you please share how you did that?
Thanks in advance
Re: AsyncWebSocket: is there an equivalent in arduino-esp32 v3.0.0 ?
Posted: Wed Jun 05, 2024 5:23 pm
by noweare
Basalt wrote: ↑Wed Jun 05, 2024 7:24 am
I’m interested!
Can you please share how you did that?
Thanks in advance
I will put the project up on my github in a day or two. I sent you a PM.
Re: AsyncWebSocket: is there an equivalent in arduino-esp32 v3.0.0 ?
Posted: Wed Jun 05, 2024 9:04 pm
by Basalt
Many thanks !