Skip to content

VacuumRobots manual update root Howto

Sergey Vlasov edited this page Apr 12, 2020 · 29 revisions

Hint

There is an automatic tool for flashing. See flasher.py in the firmwarebuilder release. Details can be found in PR#47

Warning

Do not flash Gen2 firmware to Gen1, and vice versa!

General idea

  1. Install python-miio (python3!)
  2. Install ccrypt (apt-get install ccrypt)
  3. Create custom image with imagebuilder.sh, copy MD5 sum
    • You need to create your own ssh keypair and create an authorized key file (for Windows you might use PuttyGen to create the keypair).
    • Copy language pack (#LanguageCode#.pkg) and v11_xxxxxx.pkg into folder of the imagebuilder.sh. english.pkg is obsolete now, all new firmwares contain the new english soundfiles. To enable english by default, you need to convert your vacuum from CCC to CE.
    • The image builder needs to be run as root (need to mount image).
      • If you use Windows: you need to run it in either Docker container or Linux VM, Windows WSL and macOS do not work.
      • When using Docker make sure to pass --privileged flag, like this: docker run -it --privileged ubuntu.
  4. Install a local webserver and place created image (located in /output) into htdocs
    • Do not change filename, it must have the format v11_xxxxxx.pkg.
    • You may use also the integrated Python3-HTTP-Server.
  5. Connect the vacuum robot to the charging station.

Update without automatic flasher (obsolete if you use flasher.py)

  1. Put vacuum robot in unprovisioned mode (press WiFi button)
  2. Connect to open WiFi of the robot(rockrobo-XXXX)
    • Do not connect to any other network (e.g. LAN)
  3. mirobo discover --handshake true

    • You'll retrieve the token (copy hash represented by placholder #Token for further use):
    • INFO:miio.device: IP 192.168.8.x (ID: $) - token: b'#Token'
  4. mirobo --ip=192.168.8.1 --token=#Token_from_above# status -> should return status

  5. mirobo --ip=192.168.8.1 --token=#Token_from_above# raw-command miIO.ota '{"mode":"normal", "install":"1", "app_url":"http://#ipaddress-of-your-computer#/v11_#version#.pkg", "file_md5":"#md5#","proc":"dnld install"}'

    • replace ipaddress, version and md5 with your data ( md5 = copied md5 sum of section "preparation" step 3)
    • Check status with command from 4)
    • Wait 10 minutes (you should see an access on your http server, when http-get is done)
  6. In case you get a warning about battery needs to be at least 20% charged: connect the robot with your charging station and charge it while updating. This warning can appear even if your robot is charged more then 20%.
  7. If update is complete: try ssh access on 192.168.8.1 with user root

Instructions on Linux

These instructions were tested on Ubuntu 14.04 and 17.10, Debian 9, and Fedora 27. Ubuntu 18.04 verified to work on 7 March 2020.

Create the firmware image

  1. Install the required packages:

    ## Ubuntu
    sudo apt-get install ccrypt git wget unzip dos2unix
    
    ## Fedora
    sudo dnf install ccrypt git wget unzip dos2unix
  2. Create a working directory:

    mkdir dustcloud
    cd dustcloud
  3. Download and unzip the dustcloud firmwarebuilder:

    wget https://github.com/dgiese/dustcloud/releases/download/0.3/firmwarebuilder_0.3.zip
    unzip firmwarebuilder_0.3.zip
  4. Download the firmware image and language data:

  5. 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.

  6. Run the image builder:

    sudo ./dustcloud/devices/xiaomi.vacuum/firmwarebuilder/imagebuilder.sh -f v11_001228.pkg -k id_rsa.pub
  7. 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:

  1. Install the required packages:

    sudo apt-get install python3 python3-pip python3-venv python3-dev
  2. Create a virtual env for our python packages:

    python3 -m venv .venv
  3. Enter the virtual env:

    . .venv/bin/activate
  4. Install wheel so the other packages can be installed successfully:

    pip install wheel
  5. Install python-miio for communicating with the vacuum:

    pip install -Iv python-miio==0.4.8
  6. Now press the wifi button on your vacuum and join the wifi created by it ('roborock-vacuum-s5_XXXXXXXX' or similar).

  7. Use the flasher script to upload the new firmware:

    python flasher.py -f output/v11_001228.pkg
  8. The update takes several minutes. After the upload is complete, the robot explains that it is now going to install and upgrade and restarts when it is complete. Once the robot has successfully restarted, you can connect to it via SSH.

Clone this wiki locally