Page 1 of 1

Two different HTTP servers (ETH and Wi-Fi) on WT32-ETH01

Posted: Tue Oct 28, 2025 9:10 pm
by Disraeli
My device needs to handle HTTP requests over both Wi-Fi and an Ethernet cable. The WT32-ETH01 is perfect for this. Unfortunately, I haven't worked with ESP32 before. I'm seeking advice: is it possible to implement two HTTP servers using LwIP + FreeRTOS on the WT32-ETH01 board? Could you please suggest some examples or where to start? Maybe there are examples specifically for this board. I would be grateful for any advice.

Re: Two different HTTP servers (ETH and Wi-Fi) on WT32-ETH01

Posted: Sun Nov 09, 2025 6:05 am
by nopnop2002
Any ESP32 with WiFi functionality allows you to run two HTTP servers simultaneously.
The first server uses WiFi.
The second server uses Ethernet.

The WT32-ETH01 comes equipped with a LAN8720 Ethernet module, so no external PHY is required.

It's important to set config.server_port and config.ctrl_port to different ports for WiFi and Ethernet.

Code: Select all

    httpd_handle_t server = NULL;
    httpd_config_t config = HTTPD_DEFAULT_CONFIG();

    // Purge "Least Recently Used”connection
    config.lru_purge_enable = true;
    // TCP Port number for receiving and transmitting HTTP traffic
    config.server_port = server_port;
    // TCP Port number for control
    config.ctrl_port = ctrl_port;
192.168.0.137 is Ethernet connection.
192.168.0.138 is WiFi connection.

Code: Select all

I (15127) example_common: Connected to example_netif_eth
I (15137) example_common: - IPv4 address: 192.168.0.137,
I (15137) example_common: Connected to example_netif_sta
I (15147) example_common: - IPv4 address: 192.168.0.138,
I (15147) HTTP_SERVER_STA: Starting HTTP server on 192.168.0.138:8080
I (15157) HTTP_SERVER_STA: param.server_port=[8080]
I (15157) HTTP_SERVER_STA: param.ctrl_port=[32767]
I (15167) HTTP_SERVER_ETH: Starting HTTP server on 192.168.0.137:8081
I (15177) HTTP_SERVER_ETH: param.server_port=[8081]
I (15177) HTTP_SERVER_ETH: param.ctrl_port=[32768]

Re: Two different HTTP servers (ETH and Wi-Fi) on WT32-ETH01

Posted: Sun Nov 09, 2025 5:58 pm
by Disraeli
Thank you very much for your answer! I will definitely take your advice about the ports into account.

However, the initialization of LwIP when using both interfaces simultaneously is not entirely clear to me. This is because in the examples, both Ethernet and Wi-Fi use the same functions to initialize the netif:

Code: Select all

esp_netif_init()
esp_event_loop_create_default()
Calling these functions once during Wi-Fi initialization and a second time during Ethernet initialization would cause a conflict.

Re: Two different HTTP servers (ETH and Wi-Fi) on WT32-ETH01

Posted: Mon Nov 10, 2025 11:51 am
by nopnop2002
We are currently preparing to release a sample project.

We will let you know once it is ready.

Re: Two different HTTP servers (ETH and Wi-Fi) on WT32-ETH01

Posted: Tue Nov 11, 2025 7:17 am
by Disraeli
That would be wonderful. I'm looking forward to hearing from you. I hope you won't forget about me.

Re: Two different HTTP servers (ETH and Wi-Fi) on WT32-ETH01

Posted: Tue Nov 11, 2025 10:38 am
by nopnop2002
is it possible to implement two HTTP servers using LwIP + FreeRTOS on the WT32-ETH01 board?
I found that it is possible to start two HTTP servers not only on the WT32-ETH01 but on all ESP32s.

https://github.com/nopnop2002/esp-idf-d ... /tree/main

Re: Two different HTTP servers (ETH and Wi-Fi) on WT32-ETH01

Posted: Tue Nov 11, 2025 12:01 pm
by Disraeli
I'm very grateful, I'll try running your example on my end.

Re: Two different HTTP servers (ETH and Wi-Fi) on WT32-ETH01

Posted: Mon Nov 17, 2025 7:29 am
by Disraeli
Thank you. It's really work!