Do you want to make her say stuff when she bumps into something?
Good, let’s continue.
A vacuum robot that verbally reacts when it bumps into things is surprisingly funny.
It’s also a good way to add a bit more personality to a robot that already has a voice pack installed.
Thanks to a clever tool called oucher it’s easy to achieve it - without the hardware in the video. It’s a program that runs on your vacuum (just like Valetudo). When it sees a ‘Bumper’ event in the logs, it plays a sound. You need a rooted Xiaomi or Roborock vacuum cleaner with SSH access.
Installing the oucher
Clone the oucher repo and enter the directory.
git clone https://github.com/porech/roborock-oucher.git
cd roborock-oucher
To make the next steps a bit easier, we’ll assign the IP address of your vacuum to a variable. Find it on the status page of your router or with a mobile app called Fing.
export IP=192.168.xxx.x
First, SSH into the vacuum to install a few packages.
ssh root@$IP
From within the vacuum shell (it starts with root@rockrobo:~#):
It’s more fun to create your own set.
Find the right samples, for instance on portal2sounds.com
(download via ‘direct link’).
Convert mp3 to wav like this:
for i in *.mp3; do ffmpeg -i "$i""sounds/${i%.*}.wav"; done
Visit Valetudo in your browser (the IP of your vacuum) and go to Settings -> Sound and voice. Upload the downloaded .pkg file and press Upload Voice Pack.
The voice pack above consists of two parts; generated text-to-speech and actual Portal samples.
You can customize both of them, meaning that you can make GLaDOS say whatever you want her to! The README of my git repo describes how to do it. On a high level, you’ll:
Clone the repo and install a few tools
Customize the text of what the text-to-speech engine will say
Download and convert original samples of your choice
Package the sounds.
After this, you can go back to step 2 of the lazy version.
Next step
The Xiaomi vacuum is too quiet and polite for GLaDOS, we need a bit more character. Luckily, there’s the aptly named tool oucher that can make her talk whenever she bumps into something.
This guide describes how to root your Xiaomi/Roborock vacuum (meaning to gain administrator access). Check here if it works on yours.
The standard firmware requires a connection to the internet and it transmits information about your wifi SSID, gateway mac address and other information like your floor plan to Xiaomi’s servers every thirty minutes. If this makes you feel a bit uncomfortable, good, read on.
Rooting changes your vacuum cleaner from an appliance that needs the Chinese cloud to function to a computer that you own and control via your local wifi directly. A Xiaomi or Roborock vacuum cleaner is just a computer that runs linux. So as a bonus, you can do other cool stuff like installing custom voicepacks and other cool hacks.
The world of vacuum rooting can be a bit overwhelming so here’s a few names you might encounter:
DustCloud is where it all started. It’s a git repo by a guy called Dennis Giese that describes the process and tools for hacking Xiaomi devices.
DustBuilder is a web tool by the same guy that can build the firmware for you so you don’t have to do it yourself.
Valetudo is is a standalone program which runs on rooted roborock vacuums and allows you to control it without the cloud.
Valetudo RE is a fork of Valetudo with more functionality.
python-miio is a tool to talk to Xiaomi devices.
Win Mirobot 1.1.0 is an alternative tool to install the firmware or voicepacks. We won’t be using it in this guide.
This is what the interface of Valetudo looks like:
Simple and practical.
Getting started
We’re gonna follow the following steps:
Download custom (rooted) firmware.
Get a secret token from your device.
Install the firmware on the vacuum (flash it).
Set up Valetudo.
Download custom firmware
Generate SSH key
For our later steps, we will need an SSH key to be able to access the command line of the vacuum from the computer you’re currently using.
You can let DustBuilder create one for you, but it’s more secure to do it yourself.
In the form, enter your email. Select Your SSH-Public key and browse for it (it’s [your home directory]/.ssh/id_ed25519.pub). The other default settings are fine.
After submitting, it can take a few minutes before you receive a link to your firmware in the mail. When you do, download it. It’s called something like v11_004018.pkg. In the meantime, you can continue with the next step.
Get the token from your device
Make sure you have the following software installed on your computer:
python3
python3-pip
Now execute the following commands:
pip3 install wheel
pip3 install python-miio
Reset the vacuum’s wifi. For the first generation Xiaomi, this means pressing and holding the home and power buttons for 3-5 seconds.
After a short while your vacuum starts broadcasting a wifi access point. Move the device close to your computer and connect the computer to the access point. If you use a VPN, turn it off.
Run the following command to get your token:
mirobo --debug discover --handshake true
Flash the firmware
Find your local IP address. In windows, run ipconfig and look for your IPv4 address. On MacOS or Linux, run ifconfig | grep 192..
Before running the command below, make sure you replace the token value, your ip and the path to the built image.
The update will take up to about 10 minutes. The vacuum will tell you when it’s done.
Connect to your vacuum
After reconnecting your computer to the vacuums wifi, access the vacuum with:
ssh root@192.168.8.1
Because your public key was included in the firmware, you will be granted access. You’re now a user in the linux operating system running on your vacuum cleaner! What a time to be alive.
Feel free to poke around a bit and take a moment to enjoy the hacker vibes. Think of the possibilities! You could run any linux program on here…
But first, restart the vacuum:
reboot -h now
Set up Valetudo
When it’s done rebooting (make sure your computer is connected to the vacuum’s wifi again), visit http://192.168.8.1 in your browser to set up the connection from the vacuum to your wifi router.
After doing that, the vacuum no longer has a wifi access point. Get its new IP address (for instance on your router’s status page, or with a mobile app called Fing).
Visit the address in your browser.
Done! You can now control your vacuum from your local network.
Since last weekend my floor is cleaned by GLaDOS, the artificial intelligence who supervises the Aperture Science testing facilities in the Portal games.
Watch this video to get an idea of her delightful personality. Buy the games on Steam if you haven’t played them yet, they’re awesome!
In this series of blog posts I’ll document how I got her to perform the simple task of cleaning my floor - albeit somewhat reluctantly.
If you want to follow along, all you need is Xiaomi or Roborock vacuum cleaner, a bit of comfort using the command line and the appetite to play around. Mine is a first generation Xiaomi, but it should work on other generations as well (see if it’s featured on the pictures here).
This is what you’ll end up with. As you can see, she’s still alive and we’re getting along just fine.