Simple Physical Controller for a Robot Vacuum (ESP32 + Raspberry Pi)
The idea for this project came from a very practical situation at home.
We have a Roborock robot vacuum, but it is configured only on my phone. In daily use, I mostly rely on room-by-room cleaning, which requires a bit of preparation before starting the vacuum. I wanted my kids to be able to start cleaning as well, but without needing access to my phone.
Recently, I experimented with an unofficial API available on GitHub, and I found that it was relatively easy to trigger cleaning commands for individual rooms. That gave me the idea to build a simple, dedicated controller.
Hardware Design
The device itself is intentionally simple:
ESP32 Huzzah (with built-in battery support)
Small LED display
Battery-powered operation
Custom 3D-printed enclosure
I designed a small case and printed it using a 3D printer to make the controller compact and easy to use for kids.
Challenges and Decisions
One of the main challenges was communication with the vacuum.
From a previous project, I knew that handling HTTPS requests directly on microcontrollers can be problematic. However, in this case, that assumption turned out to be irrelevant. The vacuum’s API does not use standard HTTP/HTTPS communication, but instead relies on lower-level TCP communication on specific ports.
After spending some time analyzing this, I decided not to reimplement or reverse-engineer the low-level protocol. That path would be complex and hard to maintain.
Instead, I chose a simpler and more robust workaround.
Leveraging an Existing Setup
In an earlier project, I had already integrated a Raspberry Pi into my coffee machine. That turned out to be very useful here.
I installed the CLI-based vacuum control tool (from GitHub) on the Raspberry Pi. Then I exposed a simple HTTP endpoint—reusing the same local server that the coffee machine project already provided.
This created a clean bridge:
ESP32 sends a simple HTTP request over the local network
Raspberry Pi translates it into the proper CLI/API command
The vacuum starts cleaning a specific room
Final Thoughts
Yes, the architecture might seem a bit over-engineered at first glance. However, in practice, it turned out to be:
very easy to implement
simple to set up
reliable in daily use
maintainable in the long term
Most importantly, it solved the original problem: the kids can now start the vacuum with a single button, without needing a phone.
Comments
Post a Comment