Skip to content

Cloud Free Firmware Image With Valetudo

herrwusel edited this page Mar 22, 2019 · 28 revisions

Suggested firmware versions

  • Gen1: v11_003468
  • Gen2: v11_001748


You will want to use a Linux based system. It doesn't matter if it is your base OS on your PC/Laptop, a VM on your PC, a Server or any other device like a Raspi. Chose the Distro you like (I'm more the Debian guy). Make sure it has access to your LAN/Internet. It does NOT NEED WIFI!

Bulding the firmware

Install required dependencides

You should make sure that the following packages are installed in your system:

  • bash
  • openssh (for ssh-keygen)
  • ccrypt
  • sed
  • dos2unix


You need to have a public / private ssh-key pair to connect to the robot. If you do not have a keypair yet, you can generate one with the following command

ssh-keygen -t ed25519 -C ""

Per default, the generated keys will be created under ~/.ssh. If you choose to create the keys in another location, remember your chosen location for later.

Preparations for building the image

  1. Create a new directory for your work

    mkdir rockrobo
    cd rockrobo
  2. Clone the dustcloud repository (until imagebuilder > 0.1 is available)

    git clone
  3. Create a directory for dummycloud

    mkdir dummycloud
    pushd dummycloud
  4. Download dummycloud from

    unzip -a dummycloud*.zip
  5. Create a valetudo directory

    mkdir valetudo
    pushd valetudo
  6. Download the latest valetudo binary from

    wget https://github ...
    mkdir deployment
    pushd deployment
  7. Create rrlogd-patcher directory

    mkdir rrlogd-patcher
    pushd rrlogd-patcher
  8. Download the latest

  9. Create firmware directory

    mkdir firmware
    pushd firmware
  10. Download the latest firmware (e.g. v001792)

    wget URL


Gen1[package name][package name] Example:

Gen2[package name][package name][package name][package name] Example:

  1. Download sound package


If you followed the above commands, your rockrobo directory structure should now look like this:

tree -L 2 rockrobo/
├── dummycloud
│   ├── doc
│   ├── dummycloud
│   ├──
│   └──
├── dustcloud
│   ├── cloudprotocol.pdf
│   ├── devices
│   ├── docker
│   ├── dummycloud
│   ├── dustcloud
│   ├── LICENSE
│   ├── Pipfile
│   ├── Pipfile.lock
│   ├── presentations
│   └──
├── firmware
│   ├── english.pkg
│   └── v11_001712.pkg
├── rrlogd-patcher
│   └──
└── valetudo
    ├── deployment
    └── valetudo

Next, we can create the firmware image.

Creating the firmware image

To create the firmware image you should run the following commands:

mkdir image
cd image     
sudo ../dustcloud/devices/xiaomi.vacuum/firmwarebuilder/ \
     --firmware=../firmware/v11_001712.pkg \
     --soundfile=../firmware/english.pkg \
     --public-key=$HOME/.ssh/ \
     --dummycloud-path=../dummycloud \
     --valetudo-path=../valetudo \
     --disable-firmware-updates \ \
     --rrlogd-patcher=../rrlogd-patcher/ \

Here you need now to remember the location of your generated public ssh-key, If you don't have a public key yet, take a look at the Prerequisites section.

Note that not all options are required. However if your router runs a ntp server you should use it. Also I would recommend to replace adbd so in case something goes really wrong you can still access it via USB.

Make sure that rrlogd gets patched, (see Appendix for supported versions). You should see something like:

Creating backup of rrlogd
Trying to patch rrlogd
Successfully patched rrlogd

WARNING: If you patch rrlogd you should use dummycloud or your data will be sent unencrypted to Xiaomi servers!

Flashing the firmware image

After the successful build of the firmware image, we can tell the robot to download and flash it. First, we need to create a virtual environment for it in python. For this the following packages need to be installed:

  • python3
  • python3-pip
  • python3-venv
cd ..
mkdir flasher
cd flasher
python3 -m venv venv

and install the required miio python packages:

source venv/bin/activate
pip3 install wheel
pip3 install python-miio
cd ..

You do NOT NEED to reset your robo or change to a device with WIFI. The following command just requires you to know the internaal IP of your robot (get it from your router, you may even set the IP to never refresh) and the already existing token (use google for the russian Mi Home app - it was the quickest and easiest way I was able to achieve it):

python3 dustcloud/devices/xiaomi.vacuum/firmwarebuilder/ -a X.X.X.X -t XXXXXXXXXXXXXXXX -f image/output/v11_001792.pkg

In this case you do not need to setup your WIFI on the robot again, like described at the bottom of this page.

After the successful transfer of the image to the robot, the robot will start flashing the image. This will take about 5~10 minutes. After the process is done, the robot will state that the update was successful.

Eventually, we can log in to our robot via ssh:

ssh root@

If everything works out, you can now log in to your robot - enjoy.

You're done now using this method. You can proceed to: "Check if dummycloud is correctly set up"

If you face any trouble, check: "Flashing doesn't work"

────────────────────────────────────────────────────────────── Else:

Next, turn your vacuum on and place it in the charger docking station. Connect yourself via WLAN to your robot, the SSID should be sth. like


Now we are finally ready to flash the firmware.

IMPORTANT: The flasher scripts will create a web server where the robot will download the firmware image. This means it needs to be able to connect to port 80 on this box. Make sure that the firewall will not block the network access.

Flash the firmware using:

python3 dustcloud/devices/xiaomi.vacuum/firmwarebuilder/ -f image/output/v11_001712.pkg

After the successful transfer of the image to the robot, the robot will start flashing the image. This will take about 5~10 minutes. After the process is done, the robot will state that the update was successful.

Eventually, we can log in to our robot via ssh:

ssh root@

If everything works out, you can now log in to your robot - enjoy.

If you face any trouble, check: "Flashing doesn't work"

Check if dummycloud is correctly set up

Assuming you are logged into your robot, we can check if the dummycloud is correctly set up. First, we need to examine if the dummycloud executable is running via

pgrep dummycloud

The result should be a process id number, e.g. 397. Next, we have to check the firewall rules, the port 8053 needs to be redirected to127.0.0.1, so that the robot is communicating with the dummycloud. Execute

iptables -t nat -L

The result should contain the following:

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
DNAT       udp  --  anywhere            udp dpt:8053 to:

Furthermore, one can verify if the dummycloud is working directly on the robot. If the WiFi LED is constantly on (~30 s after startup), everything is working as expected.


Flashing doesn't work

Make sure your firewall is turned off that the robot can connect to your machine for downloading the firmware.

If you know your firewall can't be the reason for it, you may just try it again in the first place.

Connect robot to your WiFi

To integrate the unprovisionised robot to your local WiFi, you need to execute the following on your host PC (not on the robot) to obtain the robot's token:

cd rockrobo
source flasher/venv/bin/activate
mirobo --debug discover --handshake true

The token will be sth. like 456b567549786e6e73754374323*****. With this token we can set up the WiFi to which the robot will connect.

mirobo --ip= --token=456b567549786e6e73754374323***** configure-wifi YOUR_SSID YOUR_WIFI_PASSWORD     

Now the robot will be in your local WiFi and you can give it for example a static ip via your router.

Blocking traffic to the outside of your WiFi

To make sure that no traffic from the robot can escape your local WiFi, you can add the following rules to the firewall of your robot (to make it permanent put in in /etc/rc.local before exit0):

iptables -A OUTPUT -d -j ACCEPT
iptables -A OUTPUT -d -j ACCEPT
iptables -A OUTPUT -j DROP

Have fun!


Just for fun stuff


If you're familiar with bash and want to play a bit more around, I can give you some advices.

Let's start getting an editor you can at least work with:

apt update && apt install vim

Then let's fix the apt sources:

echo "deb trusty main universe restricted multiverse
deb trusty-security main universe restricted multiverse
deb trusty-updates main universe restricted multiverse
deb trusty main" > /etc/apt/sources.list

Let's then clean the apt lists and update again:

rm -rf /var/lib/apt/lists && apt update

Now looking at "df -h" will most likely release to you that there is almost no storage. So making some storage "the dirty way": (in this case I decided to free some space to install docker and try my setup from my dedicated host)

mkdir -p /mnt/data/relocated/var/cache && mkdir /mnt/data/relocated/var/lib

mv /var/cache/apt /mnt/data/relocated/var/cache && ln -s /mnt/data/relocated/var/cache/apt /var/cache/apt

mv /var/lib/apt /mnt/data/relocated/var/lib && ln -s /mnt/data/relocated/var/lib/apt /var/lib/apt

mv /usr/local/bin/valetudo /mnt/data/valetudo/ && ln -s /mnt/data/valetudo/valetudo /usr/local/bin/valetudo

mv /usr /mnt/data/relocated && ln -s /mnt/data/relocated/usr /usr


You may want to do an upgrade and have some tools which could be useful, at least for the update process of valetudo itself which I just did yesterday:

apt upgrade; apt install locate wget; updatedb

Changing port of valetudo:

echo "env VAC_WEBPORT=8080" >> /etc/init/valetudo.conf && service valetudo restart

Note that your web panel is accessible via "http://roborock:8080".

That's it for now, I haven't continued myself further. Please be patient.

You can’t perform that action at this time.