Thanks @thundergreen, @Skeletorjus and @lolouk44 for helping me to root my MiRobot. For everyone’s benefit the detailed steps I took (from scratch) are as below:
Instructions on how to root MiRobot using Ubuntu Virtualbox VM
Setup
- Ensure you have the IP Address and Token for your MiRobot.
- The official instructions to get the token are on this page, however if you’re looking for a easy solution for Android this post will give you a modified MiHome Android App that will show the Token in the MiRobot’s Network information page. When i tested it the link was for version 5.4.14 (it continually gets updated)
- You’ll know you have the correct Token and IP address if you Home Assistant YAML file is successfully integrated for the MiRobot
- Install the latest version of Virtualbox
- Download Ubuntu v16 http://releases.ubuntu.com/16.04/
- Setup a Linux VM on VirtualBox and Install Ubuntu v16. Ensure:
- Network is configured as a “Bridge Adapter”. If you don’t do this the webserver to upload the firmware to the MiRobot will fail.
- the ISO file you just downloaded is mounted as a CD for install
Create the firmware image
- Run the Terminteral
- Install the required packages: Ubuntu:
sudo apt-get install ccrypt git wget
- Create a working directory:
mkdir dc && cd dc
- Download the dustcloud repository:
git clone https://github.com/dgiese/dustcloud.git
- Download the firmware image and language data:
- For Xiaomi Gen 2 download the latest
.pkg
from here. Place it into the “dc” folder created in step 3: https://dustcloud.seemoo.de/public/xiaomi.vacuum.gen2/original/ - For Xiaomi Gen 1 download the latest
.pkg
from here: https://dustcloud.seemoo.de/public/xiaomi.vacuum.gen1/original/encrypted/ - For both Xiaomi:
wget https://github.com/dgiese/dustcloud/raw/master/devices/xiaomi.vacuum/original-soundpackages/encrypted/english.pkg
- Copy your public SSH key to the working directory:
cp ~/.ssh/id_rsa.pub .
- if you don’t have SSH keys yet, refer to this guide to create them.
- Run the image builder:
sudo ./dustcloud/devices/xiaomi.vacuum/firmwarebuilder/imagebuilder.sh -f v11_003254.pkg -k id_rsa.pub
- After the build has succeeded, you are ready to upload the firmware to your vacuum.
Upload the firmware image
This assumes we are still in the working directory from the building step.
- Install the required packages:
sudo apt-get install python3 python3-pip python3-venv python3-dev
- Create a virtual env for our python packages:
python3 -m venv .venv
- Enter the virtual env:
. .venv/bin/activate
- Upgrade pip: pip install --upgrade pip
- Install wheel so the other packages can be installed successfully:
pip install wheel
- Install python-miio for communicating with the vacuum:
pip install python-miio
- Use the flasher script to upload the new firmware (for the XXX values use the IP address and Token from the very first step):
python dustcloud/devices/xiaomi.vacuum/firmwarebuilder/flasher.py -f output/v11_003254.pkg -a X.X.X.X -t XXXXX
- The update takes several minutes. After the upload is complete, the robot explains that it is now going to install an upgrade and restarts when it is complete. Once the robot has successfully restarted, you can connect to it via SSH.
- For me the final step’s upload failed to get to 100% on multiple occasions. I restarted both the MiRobot and the Ubuntu VM and then it was successful. When it hits 100% you’ll hear the MiRobot say “upgrading firmware this should take 5 to 10 minutes” and once upgrade is finished it’ll play music then say “charging” if it’s in the dock. If you check you MiHome app the firmware should now be v3254 (or whatever version you used)