# Roborock full Valetudo install guide

## Resources

* [Github](https://github.com/Hypfer/Valetudo)
* [Flash/Reflash firmware](https://valetudo.cloud/pages/installation/roborock-ota.html)

## Flash

1. Factory Reset:

* Open the top cover
* A toothpick hold down the Reset button and the Home button (return to base)
* After 5 seconds release the "Reset" Home button hold until the cleaner starts to speak.
* Reconfigure the vacuum cleaner using the Mi home app.

1. Download firmware from [here](https://vacuumz.info/download/gen1/)
2. Flashing the firmware image

To flash the image we are going to use <mark style="color:green;">`python-miio`</mark>, which provides <mark style="color:green;">`mirobo`</mark> - a tool to control a vacuum cleaner from a terminal.

First, we need to get it and for this we recommend to create a python virtual environment for it.

Dependencies:

* python3
* python3-pip
* python3-venv

```bash
cd ..
mkdir flasher
cd flasher
python3 -m venv venv
```

Now, when the virtual environment is ready we are going to activate it and install miio python package which provides mirobo:

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

Flashing an image requires providing your robot’s token. To acquire it, connect to your robot’s WiFi Access Point and run the following command: **`mirobo --debug discover --handshake true`**

Output:

```bash
INFO:miio.miioprotocol:  IP 192.168.8.1 (ID: 0f90319a) - token: b'ffffffffffffffffffffffffffffffff'
```

With token in out hand we can upload the firmware to the robot:

```bash
mirobo --token XXXXXXXXXXXXXXXX --ip ROBOT_IP_ADDRESS update-firmware path/to/built/image.pkg
```

<mark style="color:green;">`ROBOT_IP_ADDRESS`</mark> is <mark style="color:orange;">`192.168.8.1`</mark> by default but if you’re upgrading Valetudo to a new version, you need to replace it with the robot’s current IP address. Also please keep the distance between your WiFi antenna and your robot as short as possible or the connection might get lost.

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.&#x20;

You should then reboot the Robot either via ssh command <mark style="color:orange;">`ssh root@192.168.8.1`</mark> and typing reboot or simply by taking it out of dock and push the ON switch to prevent valetudo stuck on LOADING STATE???

#### Firmware Installation fails

… before the download bar appears:

* Warnings about lack of IP or Token - Check miio’s usage
* Firewall active? - Disable your personal firewall.
* Using a VM to flash the image? - Try to flash the image from your Host (just copy the firmware image)
* Token wrong? - Did you initiate a WiFi reset on the robot? Then you have to refetch the token, see above.
* Your PC does not know how to route, is more than one network interfaces active? Maybe disable LAN
* Wrong IP address on your WiFi? - Check that DHCP is active on your WiFi device.

… after the download bar appeared:

* Did you make an update of the robot firmware via the Xiaomi App? Then go back to original using factory reset: while holding the plug button shortly press the reset button.
* Distance between WiFi devices is to big. Try putting the robo near your PC.
* Battery is lower than 20%. Please Charge. Place the Vacuum in the dock.

Connect your robot to your Wifi

To connect the robot to your home Wifi, just connect to <mark style="color:orange;">`http://192.168.8.1`</mark> and use Valetudos settings dialog to enter your wifi credentials. Please note that only `WPA2-PSK` is supported. After updating the Wifi settings, you should reboot your robot. Open Valetudo

You need to get the IP of your robot (e.g. from your router) and connect to it using your browser e.g. <mark style="color:orange;">`http://192.168.Y.Z`</mark>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.arkannis.net/iot/valetudo/roborock-full-valetudo-install-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
