AsyncWebSocket: is there an equivalent in arduino-esp32 v3.0.0 ?

PaulZC
Posts: 6
Joined: Thu Jan 04, 2024 11:52 am

AsyncWebSocket: is there an equivalent in arduino-esp32 v3.0.0 ?

Postby PaulZC » Wed May 22, 2024 1:04 pm

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

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: AsyncWebSocket: is there an equivalent in arduino-esp32 v3.0.0 ?

Postby lbernstone » Wed May 22, 2024 4:23 pm

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.

PaulZC
Posts: 6
Joined: Thu Jan 04, 2024 11:52 am

Re: AsyncWebSocket: is there an equivalent in arduino-esp32 v3.0.0 ?

Postby PaulZC » Thu May 23, 2024 6:00 pm

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

noweare
Posts: 72
Joined: Tue Jul 02, 2019 11:35 am

Re: AsyncWebSocket: is there an equivalent in arduino-esp32 v3.0.0 ?

Postby noweare » Wed Jun 05, 2024 1:28 am

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.

User avatar
Basalt
Posts: 28
Joined: Wed Aug 16, 2023 7:59 pm

Re: AsyncWebSocket: is there an equivalent in arduino-esp32 v3.0.0 ?

Postby Basalt » Wed Jun 05, 2024 7:24 am

I’m interested!
Can you please share how you did that?

Thanks in advance

noweare
Posts: 72
Joined: Tue Jul 02, 2019 11:35 am

Re: AsyncWebSocket: is there an equivalent in arduino-esp32 v3.0.0 ?

Postby noweare » Wed Jun 05, 2024 5:23 pm

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.

User avatar
Basalt
Posts: 28
Joined: Wed Aug 16, 2023 7:59 pm

Re: AsyncWebSocket: is there an equivalent in arduino-esp32 v3.0.0 ?

Postby Basalt » Wed Jun 05, 2024 9:04 pm

Many thanks !

Who is online

Users browsing this forum: DonEvans and 99 guests