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]