---
title: "ESP32 + W5500 (SPI Ethernet) TCP Client Example — Full Guide"
url: "https://maker.wiznet.io/Grace_Koo/projects/esp32-w5500-guide/"
markdown_url: "https://maker.wiznet.io/Grace_Koo/projects/esp32-w5500-guide/md"
type: "WCC: WIZnet Created Content"
author: "Grace"
author_url: "https://maker.wiznet.io/Grace_Koo/"
original_author: "Grace Koo"
published: "2025-11-28"
language: "en"
hardware: ["WIZnet W5500", "Espressif ESP32", "WIZnet WIZ550io"]
likes: 0
views: 706
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# ESP32 + W5500 (SPI Ethernet) TCP Client Example — Full Guide

> A complete ESP32 + W5500 TCP client example using SPI Ethernet, static IP, and ESP-IDF 5.5.x. Reliable wired networking for industrial IoT.

Original author: Grace Koo

## Components

- **WIZnet W5500** x 1 ([docs](https://docs.wiznet.io/Product/Chip/Ethernet/W5500))
- **Espressif ESP32** x 1 ([docs](https://www.espressif.com/en/products/socs/esp32))
- **WIZnet WIZ550io** x 1 ([docs](https://docs.wiznet.io/Product/ioModule/wiz550io))
- Software: **microsoft Visual Studio 2015** ([docs](https://visualstudio.microsoft.com/vs/older-downloads/))

WIZnet parts: W5500 ([Datasheet](https://docs.wiznet.io/Product/Chip/Ethernet/W5500/datasheet?utm_source=maker&utm_medium=project&utm_campaign=w5500), [product hub](https://maker.wiznet.io/products/w5500/))

## Article

### 1️⃣ Overview

ESP32 includes built-in Wi-Fi, but for industrial, high-noise, or secure environments,
**wired Ethernet (W5500)** is more stable and predictable.

This guide explains how to use **ESP32 + WIZ550io(W5500)** with **ESP-IDF 5.5.x**,
covering:

- Example project creation command

- Hardware wiring

- Full menuconfig settings

- Ethernet initialization

- Build & flash

- Testing (TCP/iperf)

Everything is aligned with **your exact GPIO configuration**.

![](https://docs.wiznet.io/img/products/wiz550io/wiz550io_pinout_20140513_v4_mounthole_.jpg)

---

### 2️⃣ Install ESP-IDF

- After installing ESP-IDF Tools:

```plaintext
install.bat
export.bat
```

- Check version:

```plaintext
idf.py --version
```

- Expected:

```plaintext
ESP-IDF v5.5.1
```

---

### 3️⃣ Create an Example Project (TCP Client)

ESP-IDF provides ready-to-use examples for the W5500 component.

#### ✔ Create TCP Client Example

```plaintext
idf.py create-project-from-example "espressif/w5500=1.0.0:common_examples/tcp_client"
```

- Or create the iperf example:

```plaintext
idf.py create-project-from-example "espressif/w5500=1.0.0:common_examples/iperf"
```

- Move into project directory:

```plaintext
cd tcp_client
```

---

### 4️⃣ Hardware Wiring (Your exact GPIO pins)

| W5500 Pin | ESP32 GPIO | Notes |
| --- | --- | --- |
| SCLK | GPIO14 | SPI Clock |
| MOSI | GPIO13 | SPI MOSI |
| MISO | GPIO12 | SPI MISO |
| CS | GPIO15 | Chip Select |
| INT | GPIO4 | Optional interrupt |
| RESET | Not connected (set to -1) |  |
| 3.3V | 3.3V | Power |
| GND | GND | Ground |

---

### 5️⃣ Configure ESP-IDF (menuconfig)

- Run the config menu:

```plaintext
idf.py menuconfig
```

#### ✔ 5.1 Enable Ethernet

```plaintext
Component config  --->
    Ethernet  --->
        [*] Enable Ethernet
```

#### ✔ 5.2 Disable Internal EMAC

(W5500 SPI Ethernet **cannot** be combined with internal EMAC)

```plaintext
Component config → Ethernet →
    [ ] Internal EMAC
```

#### ✔ 5.3 Enable SPI Ethernet (W5500)

```plaintext
Component config → Ethernet →
    [*] SPI Ethernet
```

#### ✔ 5.4 Configure SPI Ethernet Module #1 (W5500)

```plaintext
Component config → Ethernet →
    SPI Ethernet Driver --->
        (1) Number of SPI Ethernet modules
        SPI Ethernet module #1 (W5500 Module) --->
            (1)  SPI Host Number (SPI2_HOST)
            (14) SPI SCLK GPIO number
            (13) SPI MOSI GPIO number
            (12) SPI MISO GPIO number
            (16) SPI clock speed (MHz)
            (15) SPI CS0 GPIO number
            (4)  Interrupt GPIO number
            (-1) PHY Reset GPIO number
            (1)  PHY Address
            [*] Auto-configure MAC address
```

---

### 6️⃣ Code Example

- iperf : <https://components.espressif.com/components/espressif/w5500/versions/1.0.0/examples/common_examples/iperf?language=en>

- tcp_client : <https://components.espressif.com/components/espressif/w5500/versions/1.0.0/examples/common_examples/iperf?language=en>

- simple_ethernet : <https://components.espressif.com/components/espressif/w5500/versions/1.0.0/examples/common_examples/iperf?language=en>

- tcp_server : <https://components.espressif.com/components/espressif/w5500/versions/1.0.0/examples/common_examples/iperf?language=en>

---

### 7️⃣ Build & Flash

```plaintext
idf.py set-target esp32
idf.py build
idf.py flash
```

---

### 8️⃣ Full Workflow Summary

- Install ESP-IDF (install/export)

- Create W5500 example project

```plaintext
idf.py create-project-from-example "espressif/w5500=1.0.0:common_examples/tcp_client"
```

- Wire ESP32 ↔ W5500

- Configure in menuconfig

```plaintext
idf.py menuconfig
```

- Enable SPI Ethernet, disable internal EMAC

- Build & flash

- Test TCP/iperf

---

Source: https://maker.wiznet.io/Grace_Koo/projects/esp32-w5500-guide/
