Skip to content

Hexapod Arduino ESP32

$0.00

Arduino source code for the Hexapod Macaroon, Mochi and Nougat.

  • One sketch runs all three — only the WiFi name, servo timing and gait tables change between models
  • 19 built-in motions — walking at six headings, fast walk, turns in place, a climbing gait, body rotations and twist
  • Binary WiFi UDP protocol, plus real-time pose streaming of all 18 joints at 50 Hz
  • Browser-based servo calibration saved to EEPROM, and OTA firmware updates

For ESP32 controller boards. Licensed GPL v3 — free to download, read and modify.


Terms and Conditions for Source Code Purchase

SKU: hexapod-mochi-arduino-esp32 Category:

Hexapod Arduino ESP32 is the open-source firmware that runs every RookiDroid hexapod built on an ESP32 controller board — Macaroon, Mochi and Nougat. Same sketch, same WiFi control, same browser-based calibration on all three. Flash it, join the robot’s WiFi network, and walk it from your phone or stream poses to it live from a computer.

One Firmware, Three Robots

The sketch is identical across all three models. Only two things change from robot to robot:

  • A couple of lines in config.h — the WiFi network name and the servo timing.
  • motion.h — the gait look-up tables, generated from each model’s leg geometry.
Model Servos Default WiFi network Servo delay
Macaroon 25kg digital hexapod_macaroon 25 ms
Mochi MG92B micro hexapod 12 ms
Nougat 21G digital hexapod_nougat 12 ms

The password is hexapod_1234 on all three, and the robot always lives at 192.168.4.1.

What It Does

  • Its own WiFi access point — the robot hosts the network, so there’s no router to configure. It runs its stand-up sequence as soon as a client connects.
  • 19 built-in motions — standby, walking at six headings, fast walk forward and back, turning in place, a climbing gait, body pitch / roll / yaw, and a twist.
  • Binary UDP protocol — compact 6-byte motion packets on port 1234, with plain-text commands still accepted for testing from a terminal.
  • Real-time pose streaming — push raw positions for all 18 joints at 50 Hz, with per-joint slew limiting and a 1-second failsafe that eases the robot back to standby if the stream stops.
  • Browser-based calibration — open http://192.168.4.1, nudge each of the 18 servos with +/− buttons (about 0.44° per tick), and save. Offsets go to EEPROM and survive power cycles.
  • Over-the-air updates — upload new firmware over WiFi from the Arduino IDE, no USB cable needed.

What’s Included

  • hexapod_esp32.ino and its sketch tabs: motion_control, realtime, network, calibration and web_ui
  • config.h (WiFi, servo pin mappings, hardware settings) and motion.h (the gait tables)
  • hexapod.h, protocol.h and web_page.h — shared state, UDP packet layouts and the calibration page
  • A README with the full UDP command reference, including every packet’s field layout

Requirements

  • Arduino IDE 2.x with arduino-esp32 board support
  • Adafruit PWM Servo Driver library (for the PCA9685 drivers). AsyncUDP, ArduinoOTA, EEPROM and WebServer ship with arduino-esp32.
  • Board settings: ESP32 Dev Module, upload speed 115200, flash frequency 80MHz, partition scheme “Default 4MB with spiffs”
  • A controller board — the Macaroon board for Macaroon, or the Mochi & Nougat board for the other two

Getting Started

  1. Install the Arduino IDE, add arduino-esp32 board support, and install the Adafruit PWM Servo Driver library.
  2. Open hexapod_esp32.ino and set APSSID / APPSK in config.h if you want your own network name.
  3. Select ESP32 Dev Module and the right COM port, then upload.
  4. Power the robot, join its WiFi network, and open http://192.168.4.1 to calibrate the servos.
  5. Drive it with the Android app, or stream poses live with Hexapod Link.

Make It Your Own

The gaits aren’t hand-written — they come out of a Python inverse-kinematics generator. Open the notebook, change the step height, stride length or body geometry, run all cells, and drop the regenerated motion.h back into the sketch. Add a brand-new motion and it needs one extra entry in the motion table to become a command you can send over UDP.

Licensed under the GNU General Public License v3.0. Read it, change it, share what you build.

One firmware. Three robots. Flash it and make it walk.