rumpeltux / viomi-rooting

Tool for rooting the Xiaomi STYJ02YM (viomi-v7) and Mijia STYTJ02YM (viomi-v8) vacuum robot
100 stars 36 forks source link

Viomi Rooting Tool

This tool aims to automate the rooting process described in Rooting the Xiaomi STYJ02YM (viomi-v7) Vacuum Robot.

It is known to work with the following models:

Prerequisites

Linux setup

You may need to install these packages, e.g. for Ubuntu:

apt install android-tools-adb wget coreutils

Mac setup

On Mac, install adb and sha256sum as follows:

# Package for adb
brew install android-platform-tools

# Package for sha256sum
brew install coreutils

Usage instructions

Clone this repository, then run the following command and follow its instructions:

./viomi-root.sh

Note: For newer viomi-v8 models, above will not work, but you can try the following experimental procedure based on findings by @Dropaq:

NEW_V8=1 ./viomi-root.sh

What’s the script doing?

  1. Enable the adb shell command.
  2. Temporarily disable robot services to allow the adb bridge to persist during setup.
  3. Install dropbear along with your ~/.ssh/id_rsa.pub public key
  4. (Optionally:) Install Valetudo.

Troubleshooting

No adb connection is established.

The script was not able to establish a ssh connection and didn't finish.

Solution: Rerun the remaining steps of the script

ssh vacuum "passwd"  # change the password
./viomi-root.sh restore_robot_services
./viomi-root.sh install_valetudo

If ssh -vvv vacuum gives you this error: debug1: send_pubkey_test: no mutual signature algorithm, add the option PubkeyAcceptedKeyTypes=ssh-rsa to your local .ssh/config (see #42).

The robot appears dead, but SSH or ADB are working.

Solution (does not apply to newer viomi-v8 models):

I accidentally resetted the wifi settings (Robot already rooted!).

Solution:

  1. Please connect to your robot using: adb shell
  2. Edit the /etc/wifi/wpa_supplicant.conf file using, e.g. vim:
    vim /etc/wifi/wpa_supplicant.conf
  3. Add these lines at the end of the file:
    network={
        ssid="SSIDGOESHERE"
        psk="PASSWORDHERE"
    }
  4. Reboot the device: reboot
  5. Check if your robot received an ip address: adb shell ip a
  6. Try to connect over ssh from your computer, and change your .ssh/config file accordingly ssh root@robotIP or ssh vacuum