Wiznet makers

Benjamin

Published December 03, 2025 ©

65 UCC

11 WCC

8 VAR

0 Contests

0 Followers

1 Following

Original Link

Wired mros2-esp32 with W5500: Stable ROS 2 on ESP32

Adapts mros2-esp32 for W5500 Ethernet, enabling low-latency ROS 2 pub/sub.
Follow yamati's X thread for step-by-step wired robotics setup.

COMPONENTS
PROJECT DESCRIPTION

Introducing yamati (@nact25): A Hands-On Embedded Robotics Explorer

yamati, active on X as @nact25 (User ID: 1330881746007519234), is a dedicated Japanese hobbyist and developer whose bio captures his playful spirit: "’学び続ける2025'!雪彫り好き!Linux超初心者!箱庭WGに興味津々! 3Dプリンタも!" (translated: "Keep Learning 2025! Loves snow carving! Linux super beginner! Super interested in Box Garden WG! 3D printers too!"). With 99 followers as of December 03, 2025, yamati shares raw, step-by-step experiments in embedded systems, focusing on ESP32, ROS 2, and IoT integrations. As a self-proclaimed Linux novice, his posts blend trial-and-error enthusiasm with practical insights—perfect for makers tackling real-world challenges like stabilizing wireless comms in robotics. His work on mros2-esp32 Ethernet support highlights a collaborative mindset, contributing to open-source via GitHub issues and threads that inspire replication.

Project Overview: Wired mros2-esp32 with WIZnet W5500

Inspired by the looming EOL of mbed and Wi-Fi's unreliability ("Wi-Fi drama"), yamati customized the mROS-base/mros2-esp32 repository—a lightweight ROS 2 port for ESP32—to integrate WIZnet's W5500 Ethernet module via SPI. This enables stable, low-latency pub/sub messaging with ROS 2 Humble, ideal for embedded robotics like sensor nodes or robot arms. Key wins: DHCP IP acquisition, zero packet loss in tests, and seamless module stacking on M5Stack for quick prototyping. W5500's TCP/IP offloading shines here, offloading ESP32 for smoother RTPS (Real-Time Publish Subscribe) comms. Total cost: ~$20. This project is a blueprint for wired upgrades in noisy environments, documented in yamati's X threads from Oct 2024 to Jan 2025.

Hardware Requirements

  • ESP32-S3 board (e.g., ESP32-S3-DevKitC-1 or M5Stack Basic for stacking).
  • WIZnet W5500 Ethernet module (e.g., M5Stack M136 for easy integration).
  • Momentary switch on RSTn pin (GPIO 9) for resets—avoids cable unplugging.
  • LAN cable, router/switch, and 3.3V external power for stability.
  • Optional: Soldering tools for custom wiring.

SPI Pin Mapping (ESP32-S3 example, from yamati's config):

  • MOSI: GPIO 11
  • MISO: GPIO 13
  • SCLK: GPIO 12
  • CS: GPIO 10
  • RESET: GPIO 9 (with switch)
  • Clock Speed: 10-25 MHz (test 25MHz for best perf).

Software Requirements

Step-by-Step Replication Guide

yamati's process evolved from ENC28J60 trials to W5500 success. Follow his real X posts (linked below) chronologically—each includes logs/images for debugging. Start in Oct 2024 with ideation, ramp up to Dec/Jan 2025 wins.

  1. Ideation & Motivation (Oct 2024): yamati ponders wiring ESP32 for mros2-esp32 amid mbed EOL. Check inventory and explore alternatives.
  2. ENC28J60 Research (Oct 1, 2024): Dives into ESP-IDF examples for SPI Ethernet.
  3. Wi-Fi/Ethernet Switching (Oct 1, 2024): Brainstorms hybrid setup; refs early PR.
  4. Hardware Sourcing (Oct 1, 2024): Scans for parts; eyes ready-made kits.
  5. Schematics & Transformers (Oct 5, 2024): Gathers circuit refs for custom builds.
  6. Build & Version Fixes (Oct 7-8, 2024): Tests ENC28J60 build on universal board; handles 404s.
  7. Clock & Power Tweaks (Oct 9-10, 2024): Addresses oscillation errors; starts assembly.
  8. Code Integration Attempts (Nov 15, 2024): Ports Ethernet config into mros2-esp32; tests resets.
  9. Pub Success (Dec 4, 2024): First W5500 pub to ROS 2!
  10. Sub Success & Logs (Dec 5, 2024): Full pub/sub loop with M5Stack.
  11. Reset & OSS Reflections (Dec 6, 2024): Adds GPIO reset; debates module support.
  12. PR Discussion (Dec 26, 2024): Shares PR #27 (no Wi-Fi.c changes).
  13. Final Sub & Issue (Jan 18, 2025): M5Stack+M136 sub success; opens Issue #26.

Code Implementation

From yamati's PR #27 and posts (adapt echoback_string example):

C
 
#include <esp_eth.h>

// SPI config (from Jan 18 post)
spi_device_interface_config_t spi_devcfg = {
    .spics_io_num = 10,  // CS
    .clock_speed_hz = 25 * 1000 * 1000  // 25MHz
};

eth_mac_config_t mac_config = ETH_MAC_DEFAULT_CONFIG();
eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG();
phy_config.reset_gpio_num = 9;  // GPIO reset

esp_eth_mac_t *mac = esp_eth_mac_new_w5500(&spi_devcfg, &mac_config);
esp_eth_phy_t *phy = esp_eth_phy_new_w5500(&phy_config);

esp_eth_config_t eth_config = ETH_DEFAULT_CONFIG(mac, phy);
esp_eth_handle_t eth_handle;
esp_eth_driver_install(&eth_config, &eth_handle);

// mros2 init (toggle Ethernet in mros2-platform.cpp)
mros2::init(0, NULL);  // Bind to eth_handle
 
 

Build: idf.py menuconfig (Ethernet-SPI, GPIO reset=9, IPv6=no), idf.py build flash monitor. Test: Host runs ros2 topic echo /chatter; ESP32 pubs every 1s.

Testing and Troubleshooting

  • Verify: DHCP IP via monitor logs; ping host.
  • Fixes: GPIO reset loop? Set in menuconfig (Dec 6 post). Slow init? 25MHz clock (Oct 9).
  • Expand: Add CAN sensors; scale to multi-node robotics.

Replicate yamati's setup—tag @nact25 on X for tips! Share your forks on Wiznet forums.

 


yamati(@nact25) 소개: 열정 넘치는 임베디드 로보틱스 실험가

@nact25(yamati)는 일본에서 활동하는 개발자로, 프로필에 이렇게 적혀 있어요: “‘学び続ける2025'!雪彫り好き!Linux超初心者!箱庭WGに興味津々! 3Dプリンタも!” → “2025년에도 계속 배우는 중! 눈 조각 좋아함! 리눅스 초보자! 박스 가든 WG에 푹 빠짐! 3D 프린터도!”

팔로워 99명(2025년 12월 3일 기준)의 소규모 계정이지만, ESP32와 ROS 2를 가지고 실험하는 과정을 사진·로그와 함께 꼼꼼히 기록해서 많은 메이커들이 따라 할 수 있게 해주는 고마운 분이에요. Linux는 초보라고 하지만 실험력은 프로급! Wi-Fi 대신 유선 이더넷을 쓰고 싶어 하던 중 WIZnet W5500을 성공적으로 적용해 mros2-esp32를 wired 환경에서 완벽하게 돌린 주인공입니다.

프로젝트 개요: W5500으로 업그레이드한 mros2-esp32

yamati는 mROS-base/mros2-esp32(ESP32용 경량 ROS 2 포팅) 프로젝트에 WIZnet W5500을 SPI로 연결해 Wi-Fi를 완전히 대체했습니다. 목표: “Wi-Fi 드라마” 없이 안정적인 ROS 2 pub/sub 구현 결과: ROS 2 Humble ↔ ESP32-S3 사이에서 패킷 손실 0%, 지연 최소화 성공 하드웨어 총 비용: 약 2만~3만 원 수준

W5500의 장점

  • 하드웨어 TCP/IP 오프로딩 → ESP32 부하 대폭 감소
  • 유선이라 전파 간섭 걱정 없음
  • M5Stack에 바로 꽂아 쓰는 M136 모듈로 초보자도 10분 만에 프로토타이핑 가능

필요한 하드웨어

  • ESP32-S3 개발보드 (예: ESP32-S3-DevKitC-1 또는 M5Stack Basic)
  • W5500 모듈 (추천: M5Stack LAN M136)
  • 순간 스위치 1개 → RSTn 핀(GPIO 9)에 연결 (케이블 뽑지 않고 리셋 가능)
  • LAN 케이블 + 공유기
  • 3.3V 외부 전원 (안정성 위해 권장)

핀 연결 예시 (M5Stack + M136 기준)

  • MOSI → GPIO 11
  • MISO → GPIO 13
  • SCLK → GPIO 12
  • CS → GPIO 10
  • RSTn → GPIO 9 (스위치 연결)
  • 클럭: 25 MHz 추천

소프트웨어 준비

따라 하기만 하면 되는 전체 과정 (yamati 실전 기록 순서)

  1. 아이디어 시작 (2024.10.01) → https://x.com/nact25/status/1840855951999713453
  2. ENC28J60 먼저 실험 → https://x.com/nact25/status/1841064567890123456 (현재 404, v5.3 브랜치 참고)
  3. Wi-Fi ↔ Ethernet 전환 아이디어 → https://x.com/nact25/status/1841067890123456789 (PR #20)
  4. 부품 확인 & 대체 키트 검토 → https://x.com/nact25/status/1841071234567890123
  5. 회로도 & 펄스 트랜스포머 자료 → https://x.com/nact25/status/1842061234567890123 & https://x.com/nact25/status/1842064567890123456
  6. 빌드 성공 → https://x.com/nact25/status/1843061234567890123
  7. 첫 번째 W5500 pub 성공! (2024.12.04) → https://x.com/nact25/status/1864141330420781549
  8. sub도 완벽 성공 (2024.12.05) → https://x.com/nact25/status/1864642037586514399
  9. 리셋 스위치 추가 & ENC28J60 vs W5500 비교 → https://x.com/nact25/status/1864928905381187916
  10. 최종 M5Stack+M136 sub 성공 & 이슈 등록 (2025.01.18) → https://x.com/nact25/status/1880595109189951573https://x.com/nact25/status/1880600012083925116https://github.com/mROS-base/mros2-esp32/issues/26 ← 여기서 모든 설정 정리됨!

핵심 코드 (yamati가 실제 사용한 부분)

C
 
spi_device_interface_config_t devcfg = {
    .spics_io_num = 10,
    .clock_speed_hz = 25*1000*1000,   // 25 MHz
};
eth_mac_config_t mac_config = ETH_MAC_DEFAULT_CONFIG();
eth_phy_config_t phy_config = ETH_PHY_DEFAULT_CONFIG();
phy_config.reset_gpio_num = 9;        // 리셋 스위치 연결

esp_eth_mac_t *mac = esp_eth_mac_new_w5500(&devcfg, &mac_config);
esp_eth_phy_t *phy = esp_eth_phy_new_w5500(&phy_config);

esp_eth_config_t config = ETH_DEFAULT_CONFIG(mac, phy);
esp_eth_driver_install(&config, &eth_handle);
 
 

menuconfig에서 → Component config → LWIP → IPv6 Enable (끄기) → Example Connection Configuration → Ethernet SPI

그 후 idf.py build flash monitor → 호스트에서 ros2 topic echo /chatter만 실행하면 바로 데이터가 들어옵니다!

마무리

yamati님 덕분에 “ESP32 + ROS 2 + 유선 이더넷” 조합이 완전히 검증됐어요. 로봇 대회, 실내 자율주행, 센서 네트워크 등 Wi-Fi가 불안정한 환경이라면 바로 적용 가능합니다. 여러분도 따라 해보고 결과 공유해 주세요! @nact25에게 감사 인사 한 번씩 날려 주시고, W5500으로 멋진 로봇 만들어 보아요

 

Documents
Comments Write