ESP32 + W5500 Ethernet Quick Start Guide
Step-by-step flow: Network Test → Speed Test → Time Sync

Welcome, fellow makers.
You're about to unlock a rock-solid combo: ESP32 + WIZnet W5500, an Ethernet-capable setup that’s lightweight, deterministic, and ideal for industrial or DIY networked projects.
This post is your armory — not just theory, but curated, field-tested code insights with all the “guns and swords” ready for action.
🔧 The Common Foundation: How ESP32 Talks to WIZnet W5500
All three examples below share a core initialization sequence.
Understand this flow, and you can build anything on top of it.
⚙️ Step 1 – SPI Ethernet Driver Init
Internally configures the SPI bus and W5500 driver
Returns esp_eth_handle_t
for use throughout the stack
🌐 Step 2 – Attach to the TCP/IP Stack
This “glue” attaches the Ethernet driver to the esp-netif TCP/IP stack
Essential for IP addressing, DHCP, DNS, and more
🚀 Step 3 – Start Ethernet
Starts the driver state machine
At this point, DHCP or Static IP kicks in
You're now online
✨ Highlighted Use Cases: Three Scenarios, Three Purposes
1️⃣ Basic DHCP + IP Logging (Minimal Setup)
Plug in and get online — verify that Ethernet is alive and working
🔑 Key Code
Registers handlers for Link Up/Down
and IP Assigned
Optional: Multiple ports supported with esp_netif_config
tweaks
🎯 Purpose
Confirm W5500 is wired correctly
Get an IP via DHCP
Print your network status via logs
2️⃣ Interactive Console + iperf Testing
Bring in the console, type commands, measure performance in real time
🔑 Key Code
Launches a UART REPL console
Lets you run commands like iperf -u -s
and ethernet info
Great for network benchmarking
🎯 Purpose
Real-world UDP/TCP speed test with iperf
CLI-style UX for debugging or dev boards
Scriptable interface for advanced users
3️⃣ PTP (Precision Time Protocol) + Pulse Output
Use W5500 to generate nanosecond-accurate GPIO pulses — yes, really
🔑 Key Code
Starts PTPD (Precision Time Daemon)
Waits for clock sync
Then toggles a GPIO at precisely defined intervals (e.g. every X ns)
🎯 Purpose
Industrial-grade timing sync
PTP master/slave logic handled internally
GPIO output in perfect sync with network time
🧭 Summary: Choose Your Weapon
Scenario | Use When You Want To... |
---|---|
① Basic | Just get IP and check status |
② Console | Benchmark speeds & test over UART |
③ PTP | Generate precisely timed signals |
If you're building a system with W5500 at the core, this is your foundation.
Whether you're writing a driver, building a logger, or syncing real-time events — you now have the full toolkit.