micro-ROS porting to ESP32

Aug 27, 2020

The micro-ROS team is glad to announce that the pool of boards officially supported by the project has widened! The ESP32 MCU is now part of the family. ESP32 is a series of low-cost, low-power microcontrollers with integrated Wi-Fi and dual-mode Bluetooth, widely used for both commercial and industrial purposes.

ESP32 board

micro-ROS targets mid-range and medium-to-high performance 32-bits microcontrollers families. Up to now, the boards officially supported by the project were solely based on the STM32 series from ST, MCUs featuring ARM Cortex-M processors. On the other hand, the ESP32 is an ultra-low power consumption dual-core system with two Xtensa LX6 CPUs, exposing a large collection of peripherals.

Specifically, the port has been carried out for an Espressif ESP32-DevKitC-32E, an entry-level development board featuring an ESP32-WROOM-32E module integrating Wi-Fi and Bluetooth functions. The port makes use of FreeRTOS, one of the three RTOSes officially supported by the micro-ROS project, which is natively used by this family of boards, and supports the latest Foxy release of ROS 2. It works both with serial and Wi-Fi transports, the latter being particularly appealing as it marks the first hardware support of the micro-ROS project that exploits a natively integrated Wi-Fi antenna. Therefore, thanks to the combination of this highly capable Espressif board with micro-ROS, users will be able to develop wireless ROS2 applications that take advantage of the huge set of peripherals that ESP32 offers: I²C, SPI, I²S, LED drivers, PWM, etc. Furthermore, the ESP32-DevKitC-32E development board perfectly fits the typical requirements of the IoT systems targeted by micro-ROS, as it features a Flash memory of 4 MB, 448 KB ROM for booting and core functions, 520 KB SRAM for data and instructions and 16 KB SRAM in RTC.

The recent port of micro-ROS to ESP32 thus sets a milestone towards expanding the family of MCUs supported by micro-ROS and paves the way for further ports, ensuring this project an ever wider base of hardware support.

In order to try the new port, follow one of the core tutorials to install the micro-ROS build system, and then follow the instructions below:

ros2 run micro_ros_setup create_firmware_ws.sh freertos esp32
ros2 run micro_ros_setup configure_firmware.sh int32_publisher -t udp -i [your local machine IP] -p 8888
ros2 run micro_ros_setup build_firmware.sh menuconfig

# Now go to the micro-ROS Transport Settings → WiFi Configuration menu and fill your WiFi SSID and password. Save your changes, exit the interactive menu, and run:
ros2 run micro_ros_setup build_firmware.sh

# Connect your ESP32 to the computer with a micro-USB cable, and run:
ros2 run micro_ros_setup flash_firmware.sh

In order to open an agent you can find instructions here but we recommend using the docker image:

docker run -it --rm --net=host microros/micro-ros-agent:foxy udp4 --port 8888 -v6

Share on: