Wiznet makers

ronpang

Published June 05, 2026 ©

192 UCC

93 WCC

34 VAR

0 Contests

1 Followers

0 Following

Original Link

How to Run MicroPython Ethernet with WIZnet W5500 on ESP32-C3?

This ESP32-C3 education project records the process of building and flashing MicroPython so an ESP32-C3 can use a WIZnet W5500 Ethernet module as a wired networ

COMPONENTS
PROJECT DESCRIPTION

How to Run MicroPython Ethernet with WIZnet W5500 on ESP32-C3?

Summary

This ESP32-C3 education project records the process of building and flashing MicroPython so an ESP32-C3 can use a WIZnet W5500 Ethernet module as a wired network interface. The W5500 provides the SPI-connected Ethernet controller, hardware TCP/IP stack, socket resources, and packet buffering, while MicroPython provides the high-level scripting environment for network experiments and classroom debugging.

What the Project Does

The project goal is to use ESP32-C3 + W5500 as a wired gateway running MicroPython. The source article frames the work as a practical build-and-flash record rather than a finished application: it covers macOS and Windows build differences, MicroPython and ESP-IDF version matching, correct .bin selection during flashing, and W5500 driver usage.

The architecture is useful for education because it separates three concerns that students often mix together. ESP32-C3 runs the MicroPython firmware and user scripts. W5500 provides the wired Ethernet path over SPI. The MicroPython network layer exposes the interface so normal socket or HTTP-style experiments can be written at the Python level instead of starting with a full C network stack.

The public CSDN preview confirms the W5500 and MicroPython target, but the full article content is locked behind the CSDN column subscription. Because the complete build commands, patch set, and driver code cannot be fully inspected from the accessible page, this article does not claim project-specific source code beyond what is visible in the public preview.

Where WIZnet Fits

The exact WIZnet product is W5500. In this project, W5500 is the wired Ethernet controller connected to ESP32-C3 through SPI. It provides the Ethernet MAC/PHY, hardwired TCP/IP stack, 8 independent sockets, and 32 KB internal Tx/Rx buffer memory. WIZnet documents W5500 as supporting TCP, UDP, ICMP, IPv4, ARP, IGMP, and PPPoE, with SPI up to 80 MHz.

This matters because ESP32-C3 already has Wi-Fi capability, but the project is explicitly about making wired Ethernet work under MicroPython. W5500 shifts the Ethernet transport and socket-buffering work into a dedicated controller, leaving the ESP32-C3 to handle firmware boot, SPI access, MicroPython runtime behavior, and user scripts.

MicroPython’s documentation states that WIZnet W5500 is supported on the ESP32 port through the network.LAN interface. The ESP32 quick reference also documents SPI Ethernet interfaces and lists network.PHY_W5500 as a supported SPI Ethernet type.

Implementation Notes

The public source verifies the project target but does not expose complete source files. The following is not copied from the article.

Conceptual integration example based on MicroPython ESP32 LAN documentation

 
import network
from machine import Pin, SPI

spi = SPI(1, sck=Pin(12), mosi=Pin(13), miso=Pin(14))

lan = network.LAN(
    spi=spi,
    phy_type=network.PHY_W5500,
    phy_addr=0,
    cs=Pin(10),
    int=Pin(11),
)

lan.active(True)
print(lan.ipconfig("addr4"))
 

This code shows the architecture MicroPython expects for ESP32 SPI Ethernet: an SPI bus, chip select, interrupt pin, W5500 PHY type, and network activation. The actual ESP32-C3 board pins must be changed to match the hardware design. MicroPython notes that SPI Ethernet clock speed is configured at compile time, not only by the SPI object created in the script.

For a compiled MicroPython image, the important build-time question is whether W5500 support is included in the selected firmware configuration. MicroPython documents WIZnet support as a compile-time option for some ports and notes that the ESP32 port uses network.LAN for W5500.

Practical Tips / Pitfalls

  • Confirm the USB-UART bridge first. The source article specifically reports trouble with a CH343 serial chip under macOS and a switch to Windows for compilation and flashing. 
  • Treat MicroPython, ESP-IDF, and board target as a matched set. A firmware image built for the wrong ESP32 variant or wrong MicroPython/ESP-IDF combination may flash but fail later.
  • Verify W5500 support in the firmware before debugging wiring. If the build does not include SPI Ethernet support, Python-level network code will not fix it.
  • Route SPI cleanly: SCK, MOSI, MISO, CS, INT, and reset should be stable before testing DHCP or sockets.
  • Start with a static IP or simple LAN status check before higher-level protocols. It reduces the number of variables while verifying the W5500 path.
  • Keep Wi-Fi and W5500 tests separate during lessons. Students should know whether a socket is using WLAN or LAN.

FAQ

Q: Why use WIZnet W5500 with ESP32-C3 MicroPython?
A: W5500 provides wired Ethernet, hardware TCP/IP offload, 8 sockets, and internal packet buffers. This lets an ESP32-C3 MicroPython project use a stable wired network path while keeping user code at the Python socket layer instead of building a full Ethernet stack in application code.

Q: How does W5500 connect to the ESP32-C3 platform?
A: W5500 connects over SPI. At minimum the design needs SCK, MOSI, MISO, chip select, interrupt, reset, power, ground, and the RJ45/magnetics side of the Ethernet module. MicroPython’s ESP32 documentation shows W5500 configuration through network.LAN(spi=..., phy_type=network.PHY_W5500, cs=..., int=...).

Q: What role does W5500 play in this project?
A: W5500 is the Ethernet transport device. ESP32-C3 runs MicroPython and user scripts, while W5500 handles the wired Ethernet interface, TCP/IP socket engine, and packet buffers used by MicroPython’s LAN network interface.

Q: Can beginners follow this education project?
A: Yes, but it is best for learners who already understand ESP32 flashing, serial ports, SPI wiring, and basic IP addressing. The article is especially useful as a build-and-flash troubleshooting record because it highlights the practical problems around USB drivers, firmware images, ESP-IDF compatibility, and W5500 driver enablement.

Q: How does W5500 compare with Wi-Fi on ESP32-C3?
A: Wi-Fi is simpler when the lesson is about wireless access-point connection and password-based networking; MicroPython exposes that through network.WLAN(). W5500 is better when the lesson needs a fixed wired LAN path, SPI Ethernet bring-up, and explicit Ethernet module behavior through network.LAN(). Both can use normal sockets after the network interface is active, but they teach different system boundaries.

Source

Original article: CSDN, “ESP32-C3 + W5500 + MicroPython 编译记录.” The public preview confirms the ESP32-C3, W5500, MicroPython, build/flash, and W5500 driver-use scope, but the full article is locked behind CSDN subscription access.

MicroPython reference: network.WIZNET5K documentation and ESP32 quick reference for SPI Ethernet using network.LAN and PHY_W5500.

WIZnet product reference: W5500 documentation.

Tags

#W5500 #WIZnet #ESP32C3 #MicroPython #SPIEthernet #networkLAN #Education #Ethernet #WiFi #FirmwareBuild #EmbeddedPython #TCPIP

 

ESP32-C3에서 WIZnet W5500으로 MicroPython 이더넷을 실행하는 방법은?

요약

이 ESP32-C3 교육용 프로젝트는 ESP32-C3가 WIZnet W5500 이더넷 모듈을 유선 네트워크 인터페이스로 사용할 수 있도록 MicroPython을 빌드하고 플래시하는 과정을 기록합니다. W5500은 SPI로 연결되는 이더넷 컨트롤러, 하드웨어 TCP/IP 스택, 소켓 자원, 패킷 버퍼링을 제공하고, MicroPython은 네트워크 실험과 수업용 디버깅을 위한 고수준 스크립팅 환경을 제공합니다.

프로젝트가 하는 일

이 프로젝트의 목표는 ESP32-C3 + W5500 조합을 MicroPython 기반 유선 게이트웨이로 사용하는 것입니다. 원문은 완성된 애플리케이션보다는 실제 빌드 및 플래시 기록에 가깝습니다. macOS와 Windows 빌드 차이, MicroPython과 ESP-IDF 버전 매칭, 플래시 시 올바른 .bin 선택, W5500 드라이버 사용 과정을 다룹니다.

이 구조는 교육용으로 유용합니다. 학생들이 자주 혼동하는 세 가지 요소를 분리해서 보여주기 때문입니다. ESP32-C3는 MicroPython 펌웨어와 사용자 스크립트를 실행합니다. W5500은 SPI를 통해 유선 이더넷 경로를 제공합니다. MicroPython 네트워크 계층은 이 인터페이스를 노출하므로, 전체 C 네트워크 스택을 직접 다루기 전에 Python 수준에서 socket 또는 HTTP 형태의 실험을 작성할 수 있습니다.

공개 CSDN 미리보기에서는 W5500과 MicroPython 대상이 확인되지만, 전체 글은 CSDN 컬럼 구독 뒤에 있습니다. 따라서 전체 빌드 명령, 패치 세트, 드라이버 코드를 공개 페이지에서 완전히 검토할 수는 없습니다. 이 글은 공개 미리보기에서 확인 가능한 범위를 넘어 프로젝트별 소스 코드를 단정하지 않습니다.

WIZnet이 들어가는 위치

이 프로젝트에서 사용되는 WIZnet 제품은 W5500입니다. W5500은 ESP32-C3에 SPI로 연결되는 유선 이더넷 컨트롤러입니다. Ethernet MAC/PHY, 하드웨어 TCP/IP 스택, 8개 독립 소켓, 32 KB 내부 Tx/Rx 버퍼 메모리를 제공합니다. WIZnet 문서 기준으로 W5500은 TCP, UDP, ICMP, IPv4, ARP, IGMP, PPPoE를 지원하고 최대 80 MHz SPI를 제공합니다.

이 점이 중요한 이유는 ESP32-C3가 이미 Wi-Fi 기능을 갖고 있지만, 이 프로젝트의 목적은 MicroPython에서 유선 이더넷을 동작시키는 것이기 때문입니다. W5500은 이더넷 전송과 소켓 버퍼링 작업을 전용 컨트롤러로 옮기고, ESP32-C3는 펌웨어 부팅, SPI 접근, MicroPython 런타임 동작, 사용자 스크립트 실행을 담당합니다.

MicroPython 문서는 ESP32 포트에서 WIZnet W5500이 network.LAN 인터페이스를 통해 지원된다고 설명합니다. ESP32 quick reference도 SPI Ethernet 인터페이스를 문서화하며, network.PHY_W5500을 지원되는 SPI Ethernet 타입으로 제시합니다.

구현 참고 사항

공개 소스에서는 프로젝트 대상은 확인할 수 있지만, 전체 소스 파일은 공개되어 있지 않습니다. 아래 코드는 원문에서 복사한 코드가 아닙니다.

MicroPython ESP32 LAN 문서 기반 개념적 통합 예제

 
import network
from machine import Pin, SPI

spi = SPI(1, sck=Pin(12), mosi=Pin(13), miso=Pin(14))

lan = network.LAN(
    spi=spi,
    phy_type=network.PHY_W5500,
    phy_addr=0,
    cs=Pin(10),
    int=Pin(11),
)

lan.active(True)
print(lan.ipconfig("addr4"))
 

이 코드는 MicroPython이 ESP32 SPI Ethernet에 기대하는 구조를 보여줍니다. SPI 버스, chip select, interrupt 핀, W5500 PHY type, 네트워크 활성화가 필요합니다. 실제 ESP32-C3 보드에서는 하드웨어 설계에 맞게 핀 번호를 변경해야 합니다. MicroPython 문서는 SPI Ethernet clock speed가 스크립트에서 생성한 SPI 객체만으로 결정되는 것이 아니라, 컴파일 시 설정된다고 설명합니다.

컴파일된 MicroPython 이미지에서는 선택한 펌웨어 설정에 W5500 지원이 포함되어 있는지가 중요합니다. MicroPython 문서는 일부 포트에서 WIZnet 지원이 컴파일 타임 옵션이라고 설명하며, ESP32 포트에서는 W5500에 network.LAN을 사용한다고 안내합니다.

실무 팁 / 주의점

  • USB-UART 브리지를 먼저 확인해야 합니다. 원문은 macOS에서 CH343 serial chip 관련 문제가 있었고, 컴파일과 플래시를 Windows로 전환한 경험을 언급합니다.
  • MicroPython, ESP-IDF, 보드 타깃은 서로 맞는 조합으로 사용해야 합니다. 잘못된 ESP32 변형이나 맞지 않는 MicroPython/ESP-IDF 조합으로 빌드한 펌웨어는 플래시는 되더라도 이후 동작이 실패할 수 있습니다.
  • 배선을 디버깅하기 전에 펌웨어에 W5500 지원이 포함되어 있는지 확인해야 합니다. 빌드에 SPI Ethernet 지원이 없으면 Python 수준의 네트워크 코드는 문제를 해결할 수 없습니다.
  • SPI 배선은 안정적으로 구성해야 합니다. SCK, MOSI, MISO, CS, INT, reset이 DHCP나 socket 테스트 전에 먼저 안정적으로 동작해야 합니다.
  • 상위 프로토콜로 넘어가기 전에 static IP 또는 간단한 LAN 상태 확인부터 시작하는 것이 좋습니다. W5500 경로를 검증할 때 변수를 줄일 수 있습니다.
  • 수업에서는 Wi-Fi 테스트와 W5500 테스트를 분리해야 합니다. 학생들이 socket이 WLAN을 사용하는지 LAN을 사용하는지 명확히 알아야 합니다.

FAQ

Q: ESP32-C3 MicroPython에서 왜 WIZnet W5500을 사용하나요?
A: W5500은 유선 이더넷, 하드웨어 TCP/IP 오프로딩, 8개 소켓, 내부 패킷 버퍼를 제공합니다. 이를 통해 ESP32-C3 MicroPython 프로젝트는 안정적인 유선 네트워크 경로를 사용할 수 있고, 사용자 코드는 전체 이더넷 스택을 애플리케이션에서 직접 구현하지 않고 Python socket 계층에서 작성할 수 있습니다.

Q: W5500은 ESP32-C3 플랫폼에 어떻게 연결하나요?
A: W5500은 SPI로 연결됩니다. 최소한 SCK, MOSI, MISO, chip select, interrupt, reset, 전원, GND, RJ45/magnetics 쪽 이더넷 모듈 연결이 필요합니다. MicroPython ESP32 문서는 network.LAN(spi=..., phy_type=network.PHY_W5500, cs=..., int=...) 형태로 W5500 설정을 보여줍니다.

Q: 이 프로젝트에서 W5500은 어떤 역할을 하나요?
A: W5500은 이더넷 전송 장치입니다. ESP32-C3는 MicroPython과 사용자 스크립트를 실행하고, W5500은 MicroPython의 LAN 네트워크 인터페이스가 사용하는 유선 이더넷 인터페이스, TCP/IP 소켓 엔진, 패킷 버퍼를 담당합니다.

Q: 초보자도 이 교육용 프로젝트를 따라갈 수 있나요?
A: ESP32 플래시, 시리얼 포트, SPI 배선, 기본 IP 주소 설정을 이해하고 있다면 가능합니다. 이 글은 USB 드라이버, 펌웨어 이미지, ESP-IDF 호환성, W5500 드라이버 활성화 같은 실제 빌드 및 플래시 문제를 다룬다는 점에서 교육용으로 유용합니다.

Q: ESP32-C3에서 W5500은 Wi-Fi와 어떻게 다른가요?
A: Wi-Fi는 무선 AP 연결과 비밀번호 기반 네트워킹을 배우는 수업에 더 간단할 수 있으며, MicroPython에서는 network.WLAN()으로 접근합니다. W5500은 고정된 유선 LAN 경로, SPI Ethernet bring-up, network.LAN()을 통한 명시적인 이더넷 모듈 동작을 학습할 때 더 적합합니다. 두 방식 모두 네트워크 인터페이스가 활성화된 뒤에는 일반 socket을 사용할 수 있지만, 가르치는 시스템 경계가 다릅니다.

출처

Original article: CSDN, “ESP32-C3 + W5500 + MicroPython 编译记录.” 공개 미리보기에서는 ESP32-C3, W5500, MicroPython, 빌드 및 플래시, W5500 드라이버 사용 범위를 확인할 수 있지만, 전체 글은 CSDN 구독 접근 뒤에 있습니다.
https://blog.csdn.net/yueritian/article/details/148372793

MicroPython reference: network.WIZNET5K documentation and ESP32 quick reference for SPI Ethernet using network.LAN and PHY_W5500.
https://docs.micropython.org/en/latest/library/network.WIZNET5K.html

WIZnet product reference: W5500 documentation.
https://docs.wiznet.io/Product/Chip/Ethernet/W5500

태그

#W5500 #WIZnet #ESP32C3 #MicroPython #SPIEthernet #networkLAN #Education #Ethernet #WiFi #FirmwareBuild #EmbeddedPython #TCPIP

 
 
Documents
Comments Write