Wiznet makers

matthew

Published April 17, 2025 ©

81 UCC

8 WCC

30 VAR

0 Contests

0 Followers

0 Following

Original Link

🚀 Micropython with WIZnet W5500 EVB: Reliable Ethernet Communication for Raspberry Pi Pico

Using MicroPython and WIZnet W5500 EVB-Pico, this project enables stable Ethernet communication for Raspberry Pi Pico, including DHCP, ping, and TCP socket test

COMPONENTS Hardware components

WIZnet - W5500-EVB-Pico

x 2

Software Apps and online services

micropython - MicroPython

x 1


PROJECT DESCRIPTION

Looking to connect your Raspberry Pi Pico projects over Ethernet? This tutorial dives into using Micropython with the WIZnet W5500 EVB-Pico, a microcontroller board featuring WIZnet’s W5500 Ethernet TOE chip (TCP/IP Offload Engine).
From DHCP-based IP acquisition to bidirectional data transfer between multiple units, this step-by-step guide equips you to build robust wired communication for your IoT projects.


🛠 Hardware Overview

ComponentDescription
MCURaspberry Pi Pico
Ethernet ModuleWIZnet W5500 EVB-Pico
Communication InterfaceSPI (MOSI=19, MISO=16, SCK=18, CS=17, RESET=20)
Power SupplyUSB from host PC or charger
Status IndicatorOnboard LED (Pin 25)

W5500 TOE Ethernet Chip Advantage:
WIZnet’s W5500 integrates a hardware TCP/IP stack (TOE), enabling stable and offloaded Ethernet communication—ideal for low-power and embedded systems where reliability is a must.


💻 Software Stack

Stack LayerDetails
FirmwareMicropython v1.20.0 (official build recommended)
Development Toolrshell (for file upload, REPL access)
Programming LanguagePython (Micropython dialect)
Network InterfaceWIZNET5K driver
Transport ProtocolTCP/IP over Ethernet, DHCP or Static IP

🔁 Project Workflow

1. Flash Micropython & Set Up rshell

Install official v1.20.0 .uf2 Micropython firmware onto your Pico board.

Use rshell to upload scripts and access the REPL console.

2. Acquire IP via DHCP and Ping Test

Run dhcp_ping.py script using rshell repl.

Verify IP assignment and LED blinking pattern.

Ping the W5500 EVB from your PC to confirm connection.

3. W5500-to-W5500 Bidirectional Communication

Configure one board as a server (is_server=True) and the other as a client.

Use bidirectional.py to initiate continuous data transfer with LED-based visual feedback.

4. W5500 ↔ PC Socket Communication

Launch a TCP server on your PC using Python3.

Modify W5500 client code to connect to the PC’s IP.

Exchange integer data and monitor real-time activity.


🌟 Why W5500 Matters for Ethernet Projects

Built-in Hardware TCP/IP Stack (TOE): Less processing load on MCU.

Stable Ethernet over SPI: Ideal for industrial or IoT-grade reliability.

Micropython Friendly: Easy integration with MicroPython firmware and dev tools.

Minimal Latency: ~0.4ms ping response in test environments.

Supports DHCP and Static IP: Flexible in dynamic or controlled networks.


🔎 Key Code Snippets

python
# Initialize W5500 Ethernet Chip with SPI spi = SPI(0, 2_000_000, mosi=Pin(19), miso=Pin(16), sck=Pin(18)) nic = network.WIZNET5K(spi, Pin(17), Pin(20)) nic.active(True) nic.ifconfig('dhcp')  # Or assign static IP manually 
python
# TCP Server (either on W5500 or PC) s = socket() s.bind(('192.168.1.20', 5000)) s.listen(5) conn, addr = s.accept() data = conn.recv(2048) conn.send(data)

🧪 Testing Results

Ping latency: ~0.443 ms

Ethernet IP: Assigned dynamically via DHCP (192.168.1.95)

Bidirectional communication: Integer values passed back and forth successfully

LED patterns: Fast/slow blink logic to visually confirm communication status


🧰 Troubleshooting Tips

Use the official Micropython build to avoid socket errors.

Confirm both boards are powered and on the same network.

Use static IPs carefully; avoid IP conflicts on your router.

Monitor for OSError: 4 or EACCES—these often relate to improper startup sequence between server and client.


🔗 Resources & References

📄 Full Project Blog

📥 Micropython v1.20.0 .uf2 Download

🛠️ rshell GitHub Repo


💡 Future Applications

Build a reliable wired IoT sensor node using W5500 EVB

Develop a MicroPython-based gateway that bridges Ethernet and serial protocols

Extend the bidirectional logic for real-time device monitoring


✅ Ready to Share?

Let us know if you'd like to:

Highlight specific WIZnet features more prominently?

Include MQTT or cloud connectivity examples as follow-up?

Or shall we move on to the next stage: auto-generating the presentation slides (PPT)?


📌 Suggested Follow-Up Questions

Can this project integrate with cloud platforms via MQTT over Ethernet?

What makes the W5500 TOE chip more reliable than software TCP/IP?

Can I run a web server directly on W5500-based Pico?

How do I extend this to support multiple clients per server?

What are the real-world use cases for this architecture in industry or education?

Documents
Comments Write