Skip to content

Development Setup

The RoArm-M2-S runs on an ESP32 MCU. To modify or reflash the firmware, you need Arduino IDE configured with the ESP32 board support package.

  • Arduino IDE 2.x (or 1.8.x)
  • USB-C cable
  • CP2102 or CH340 USB-serial driver (usually included with your OS)
  1. Install Arduino IDE from arduino.cc

  2. Add ESP32 board support

    Open File → Preferences and add this URL to “Additional boards manager URLs”:

    https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
  3. Install the ESP32 package

    Go to Tools → Board → Boards Manager, search for “esp32”, and install esp32 by Espressif Systems (version 2.x recommended).

  4. Select the board

    Tools → Board → ESP32 Arduino → ESP32 Dev Module

  5. Configure upload settings

    SettingValue
    BoardESP32 Dev Module
    Upload Speed921600
    Flash Frequency80MHz
    Flash Size4MB (32Mb)
    Partition SchemeDefault 4MB with spiffs
    Port(your USB-serial port)

Install these through Sketch → Include Library → Manage Libraries:

LibraryPurpose
ArduinoJsonJSON command parsing
ESP32ServoServo PWM control
SCServoSerial bus servo protocol
ESPAsyncWebServerHTTP server for web control
AsyncTCPAsync TCP for the web server
SPIFFSFlash file system (built-in)

The main firmware sketch is organized around the JSON command dispatcher in json_cmd.h. Each command type (T code) maps to a handler function:

RoArm-M2_example/
├── RoArm-M2_example.ino # Main sketch, setup/loop
├── json_cmd.h # Command type definitions
├── ctrl.h # Motion control & kinematics
├── wifi_ctrl.h # WiFi AP/STA configuration
├── esp_now_ctrl.h # ESP-NOW peer-to-peer
├── file_ctrl.h # SPIFFS file operations
└── mission_ctrl.h # Step recording & playback
  1. Connect the ESP32 board via USB-C

  2. Select the correct port in Tools → Port

  3. Hold the BOOT button on the ESP32 board, click Upload in Arduino IDE, then release BOOT when you see “Connecting…”

  4. Wait for upload to complete. The serial monitor (115200 baud) will show startup messages.

Open the Serial Monitor at 115200 baud. You should see boot messages and the WiFi configuration. Send a test command:

{"T":105}

This requests position feedback. A working arm will respond with current joint positions and XYZ coordinates.

If you prefer PlatformIO over Arduino IDE, create a platformio.ini:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
upload_speed = 921600
lib_deps =
bblanchon/ArduinoJson
madhephaestus/ESP32Servo
ESPAsyncWebServer
AsyncTCP

Development workflow based on the Waveshare Secondary Development Tool guide. Firmware: waveshareteam/roarm_m2.