mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-15 17:12:59 -04:00
esp32-testing
Multi Roomba Rover
a remake of my RoombaRover project with a decentralized and embedded approach
Hardware stack
On each roomba:
- an esp32
- a level shifter
- DONT FORGET THE BRC PIN PULSE
- a power supply
- an openIPC camera
- USB wifi card
- microphone
- speaker
- MAYBE a master relay which can be turned off programatically to save the roomba from discharging. based on battery voltage plus urgent battery #?
Current software layout
.
├── include/
│ ├── config.example.h // copy to config.h with your Wi-Fi + server settings
│ └── protocol.h // shared packet layout (control + telemetry)
├── src/main.cpp // ESP32 firmware entrypoint (PlatformIO)
└── server/
├── package.json // Node.js server + Socket.IO web UI
├── robots.example.json // copy/edit to robots.json for your fleet
├── src/ // UDP relay + telemetry decoder
└── public/ // barebones HTML/JS UI
Firmware quickstart
cp include/config.example.h include/config.hand fill in:WIFI_SSID/WIFI_PASSWORDCONTROL_SERVER_IP(Node server host)ROOMBA_ID(unique per robot; must match the server entry)- tweak ports only if you have a reason.
- Flash with PlatformIO:
pio run -t upload(envesp32s3). - The firmware spawns three FreeRTOS tasks:
- control loop (5 ms cadence) – consumes UDP control packets and drives the Create 2 via UART pins 16/17. Wheel commands decay to zero if no packets arrive for 250 ms.
- telemetry loop (500 ms cadence) – polls sensor group 100, appends Wi-Fi/LRU stats, and streams UDP telemetry to the server.
- BRC maintenance – pulses GPIO5 low for 1 s every minute to keep the robot awake.
Server + web UI quickstart
cd servercp robots.example.json robots.jsonand add one entry per robot. Only theidis required (must matchROOMBA_IDin the firmware); overridecontrolPort/maxWheelSpeedif you deviate from defaults.- Install deps:
npm install - Run in dev mode:
npm run dev- HTTP + Socket.IO on
http://localhost:8080 - UDP control bind port
62000, telemetry bind port62001(override with env vars).
- HTTP + Socket.IO on
- Open the web UI:
- select a robot
- drive with WASD (left/right wheel mm/s shown in telemetry summary)
- buttons issue Safe/Full/Enable-OI/Dock commands
- sensor list renders the decoded Create 2 group-100 payload plus ESP stats
Each ESP32 announces itself as soon as it streams telemetry, so the server automatically learns the robot’s current IP address (no static DHCP entries required). If you do know a static IP, you can still set deviceHost in robots.json and the server will use it immediately.
UDP streams stay simple:
- server -> ESP32: fixed 12-byte control packet blasted at 50 Hz per robot
- ESP32 -> server: framed telemetry header + raw sensor group 100 + trailer (CRC-8)
Languages
JavaScript
91.3%
Go
4.2%
C++
2.3%
Shell
1.4%
CSS
0.4%
Other
0.3%