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

Disraeli
Posts: 9
Joined: Tue Oct 28, 2025 9:02 pm

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

Postby Disraeli » Tue Oct 28, 2025 9:10 pm

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.

nopnop2002
Posts: 347
Joined: Thu Oct 03, 2019 10:52 pm
Contact:

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

Postby nopnop2002 » Sun Nov 09, 2025 6:05 am

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]
Attachments
wifi.jpg
wifi.jpg (35.62 KiB) Viewed 4213 times
ethernet.jpg
ethernet.jpg (34.73 KiB) Viewed 4213 times

Disraeli
Posts: 9
Joined: Tue Oct 28, 2025 9:02 pm

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

Postby Disraeli » Sun Nov 09, 2025 5:58 pm

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.

nopnop2002
Posts: 347
Joined: Thu Oct 03, 2019 10:52 pm
Contact:

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

Postby nopnop2002 » Mon Nov 10, 2025 11:51 am

We are currently preparing to release a sample project.

We will let you know once it is ready.

Disraeli
Posts: 9
Joined: Tue Oct 28, 2025 9:02 pm

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

Postby Disraeli » Tue Nov 11, 2025 7:17 am

That would be wonderful. I'm looking forward to hearing from you. I hope you won't forget about me.

nopnop2002
Posts: 347
Joined: Thu Oct 03, 2019 10:52 pm
Contact:

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

Postby nopnop2002 » Tue Nov 11, 2025 10:38 am

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

Disraeli
Posts: 9
Joined: Tue Oct 28, 2025 9:02 pm

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

Postby Disraeli » Tue Nov 11, 2025 12:01 pm

I'm very grateful, I'll try running your example on my end.

Disraeli
Posts: 9
Joined: Tue Oct 28, 2025 9:02 pm

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

Postby Disraeli » Mon Nov 17, 2025 7:29 am

Thank you. It's really work!

Who is online

Users browsing this forum: Baidu [Spider], ChatGPT-User and 3 guests