MicroROS-Pub
MicroROS-Pub
How to Run micro-ROS over Ethernet on ESP32-S3-ETH Using the W5500 Hardware TCP/IP Stack?
Summary
This project demonstrates how to connect an ESP32-S3-ETH board to a ROS 2 system using micro-ROS over wired Ethernet.
Instead of relying on Wi-Fi, it uses the WIZnet W5500 Ethernet controller to provide a hardware TCP/IP stack and hardware UDP sockets. The ESP32-S3 focuses on executing the micro-ROS application while the W5500 handles Ethernet packet processing, providing a stable and deterministic communication path to a micro-ROS Agent running on ROS 2 Jazzy.
What the Project Does
The project implements a micro-ROS publisher on an ESP32-S3-ETH board. Every second, the firmware publishes an incrementing std_msgs/msg/Int32 message to a ROS 2 topic through a micro-ROS Agent.
Unlike many ESP32 Ethernet examples that use the ESP-IDF Ethernet driver with lwIP, this implementation communicates through the Arduino Ethernet library configured for the W5500 Ethernet controller.
The communication flow is:
rclc Executor
│
│ Timer Event
▼
timer_callback()
│
│ rcl_publish(std_msgs/msg/Int32)
▼
rcl / rmw_microxrcedds
│
▼
Micro XRCE-DDS Client
│
▼
Custom UDP Transport
│
▼
Arduino EthernetUDP
│
▼
W5500 Hardware UDP Socket
│
▼
W5500 Hardware TCP/IP Engine
│
▼
10/100BASE-TX Ethernet
│
▼
micro-ROS Agent
UDP/IPv4 Port 8888
│
▼
ROS 2 Jazzy
The micro-ROS Agent receives XRCE-DDS packets over UDP and forwards them into the ROS 2 DDS network, allowing the ESP32-S3 node to behave as a standard ROS 2 publisher.
Where WIZnet Fits
The key technical feature of this project is that it uses the W5500 as the actual networking engine, not simply as an Ethernet PHY.
The project configures the Arduino Ethernet library and registers a custom micro-ROS Ethernet transport instead of using the ESP-IDF esp_eth or lwIP networking stack.
This means:
Ethernet communication is performed through W5500 hardware sockets
UDP packets are processed by the W5500 Hardware TCP/IP Engine
The ESP32-S3 does not execute a software TCP/IP stack for this communication path
The MCU can dedicate more processing time to ROS 2 application logic
It is important to distinguish between the transport protocol and the network stack.
This project does not use TCP communication.
Instead:
Transport Protocol: UDP
Network Stack: W5500 Hardware TCP/IP Stack
Agent Mode: udp4
Communication: Hardware UDP Socket
Therefore, the correct technical description is:
micro-ROS communicates over UDP while the UDP packets are processed by the W5500 Hardware TCP/IP Stack.
This is an important architectural distinction that differentiates this implementation from ESP32 Ethernet solutions based on lwIP.
Implementation Notes
W5500 Initialization
File: src/main.cpp
SPI.begin(W5500_SCK, W5500_MISO, W5500_MOSI, W5500_CS);
Ethernet.init(W5500_CS);
set_microros_eth_transports(
esp_mac,
esp_ip,
agent_ip,
dns,
gateway,
agent_port
);
The firmware initializes the SPI bus, configures the W5500 chip select, and registers the W5500 Ethernet interface as the custom transport used by micro-ROS.
This is the point where Micro XRCE-DDS is connected to the W5500 UDP transport.
Creating the ROS Publisher
File: src/main.cpp
RCCHECK(rclc_publisher_init_best_effort(
&publisher,
&node,
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Int32),
PublisherTopic
));
The project creates a Best Effort publisher, which naturally matches the UDP transport used by Micro XRCE-DDS.
Running the Agent
The README starts the micro-ROS Agent with:
ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888
The udp4 option confirms that communication uses UDP over IPv4, not TCP.
Why This Architecture Matters
Many ESP32 Ethernet projects use the following architecture:
ESP32
└── lwIP
└── Ethernet Driver
└── Ethernet Controller
This project follows a different architecture:
ESP32-S3
│
micro-ROS Application
│
Micro XRCE-DDS
│
Arduino Ethernet
│
W5500 Hardware TCP/IP Engine
│
Ethernet
The advantages include:
Deterministic wired communication
No Wi-Fi interference
Hardware socket processing
Reduced networking overhead on the MCU
Reliable communication for industrial and robotic systems
Practical Tips
Reset the W5500 before Ethernet initialization for improved startup reliability.
Verify Ethernet link status before creating micro-ROS entities.
Ensure the Agent IP address matches the local network configuration.
UDP Best Effort is ideal for telemetry but should not be used for safety-critical commands without application-level acknowledgement.
Plan hardware socket usage if additional Ethernet services (HTTP, Modbus TCP, MQTT, etc.) are added.
Keep SPI traces short and ensure proper power decoupling for reliable high-speed communication.
FAQ
Why use the W5500 instead of Wi-Fi?
The W5500 provides deterministic wired Ethernet communication that is immune to RF interference. This is especially valuable for robotics and industrial control systems where communication stability is more important than mobility.
Does this project use TCP?
No.
The communication protocol is UDP.
However, UDP packets are processed by the W5500 Hardware TCP/IP Stack, which supports both TCP and UDP in hardware.
Does the ESP32-S3 use lwIP?
Based on the project implementation, no.
The firmware uses the Arduino Ethernet library together with the custom micro-ROS Ethernet transport rather than the ESP-IDF Ethernet driver and lwIP socket APIs.
What role does the W5500 play?
The W5500 acts as the Ethernet networking engine by providing:
Hardware IPv4 processing
Hardware UDP sockets
Socket buffer management
Ethernet packet transmission and reception
The ESP32-S3 primarily executes the micro-ROS application.
Comparison with Similar WIZnet Maker Projects
| Project | Platform | WIZnet Product | Network Stack | micro-ROS / ROS2 | Main Focus | Difference from Your UCC |
|---|---|---|---|---|---|---|
| Wired mros2-esp32 with W5500 | ESP32-S3 | W5500 | ESP-IDF Ethernet | mros2-esp32 | Replace Wi-Fi with Ethernet | Uses ESP-IDF networking instead of Arduino micro-ROS transport |
| SPI-Ethernet Module W5500 Usage Manual | ESP32-S3 | W5500 | ESP-IDF + W5500 | mros2-esp32 | Step-by-step migration from Wi-Fi to Ethernet | Configuration guide rather than a standalone micro-ROS publisher implementation |
| micro_ros_raspberrypi_pico_sdk | RP2040 / W55RP20 | W5500 | WIZnet TOE | micro-ROS | Strategy, architecture and TOE advantages | Focuses on RP2040 ecosystem instead of ESP32-S3 |
| w5500-ros2driver | W5500 | W5500 | MicroPython | ROS2 | ROS2 communication driver | Different software stack and no ESP32-S3 micro-ROS implementation |
Source
Original Project
https://github.com/103031430/MicroROS-Pub
Key Files
src/main.cpp
platformio.ini
README.md
Related Software
micro-ROS
Micro XRCE-DDS
Arduino Ethernet Library
ROS 2 Jazzy
micro-ROS Agent
License
No explicit LICENSE file is included in the repository at the time of writing.
Tags
W5500 ESP32-S3 ESP32-S3-ETH micro-ROS ROS2 Ethernet UDP Hardware TCP/IP Stack Micro XRCE-DDS PlatformIO Robotics

