(See the README.md file in the upper level 'examples' directory for more information about examples.)
## Overview
This example demonstrates basic usage of Ethernet interface and WiFi station together. The workflow of the example could be as follow:
1. Connects to both WiFi and Ethernet using common-connect component
2. Starts two tasks, one for each interface to resolve configured host name and connect to it periodically
3. Connection to host endpoint is handled by:
- creating a socket as TCP client
- binding it to the related interface (Ethernet of WiFi)
- send and receive a trivial HTTP request and response
If you have a new multiple interface application to go (for example, connect to IoT cloud via Ethernet and WiFi), try this as a basic template, then add your own code.
## How to use example
### Hardware Required
To run this example, you need to have one ESP32 development board integrated with an Ethernet interface, for example, ESP32-Ethernet-Kit, or just connect your ESP32-DevkitC board to a breakout board which features RMII Ethernet PHY.
*`Example Connection Configuration` menu to choose the connection details:
- Enter SSID and password for WiFi connection
- Set Ethernet type and configuration for Ethernet connection
- Note that the project is preconfigured to have both WiFi and Ethernet interface enabled by default
- See the [README.md](../../README.md) for more details about common example connection component
*`Example Configuration` menu:
- Set host name and port for the tcp_client to connect to
### Build and Flash
Run `idf.py -p PORT flash monitor` to build and flash the project..
(To exit the serial monitor, type ``Ctrl-]``.)
See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) for full steps to configure and use ESP-IDF to build projects.
## Example Output
```bash
I (695) example_connect: Connecting to DavidsAP...
If using Ethernet for the first time, it is recommended to start with the [Ethernet example readme](../../../ethernet/basic/README.md), which contains instructions for connecting and configuring the PHY.