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:
- Mijia STYJ02YM (viomi-v7)
- Mijia STYTJ02YM (viomi-v8) (experimental)
- a linux (Mac, raspberry pi or OpenWRT router may also work) machine with
bash
,ssh
,wget
,adb
andsha256sum
- the robot is already connected to your wifi (if you don't want to use the xiaomi app to do this, you can do this with python-miio
- the linux machine needs to be on the same network as the robot
- a good micro-USB cable (with data support) plugged into the robot’s micro-USB port.
You may need to install these packages, e.g. for Ubuntu:
apt install android-tools-adb wget coreutils
On Mac, install adb
and sha256sum
as follows:
# Package for adb
brew install android-platform-tools
# Package for sha256sum
brew install coreutils
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
- Enable the
adb shell
command. - Temporarily disable robot services to allow the adb bridge to persist during setup.
- Install
dropbear
along with your~/.ssh/id_rsa.pub
public key - (Optionally:) Install Valetudo.
-
Check that adb and your cable is working in general by connecting to an android phone (enable usb debugging on it), e.g. by using adb shell.
-
Check the
dmesg
output to see if your computer ever recognized a USB devices. Some machines are too slow, some USB stacks flaky. People have reported success with a raspberry pi when their main computer didn’t work. -
If you see a message like:
adb: insufficient permissions for device See [http://developer.android.com/tools/device.html] for more information
Follow the link for advice, in particular make sure that you are a member of the plugdev group and have setup correct udev rules (
dmesg
would probably show you the device ids). -
Finally, this may not be working on first attempt, but may need multiple tries, but typically not more than 10.
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).
Solution (does not apply to newer viomi-v8 models):
-
When SSH is working:
./viomi-root.sh restore_robot_services
-
When ADB is working:
adb shell cd /etc/rc.d ln -s ../init.d/robotManager S90robotManager
Solution:
- Please connect to your robot using:
adb shell
- Edit the
/etc/wifi/wpa_supplicant.conf
file using, e.g. vim:
vim /etc/wifi/wpa_supplicant.conf
- Add these lines at the end of the file:
network={ ssid="SSIDGOESHERE" psk="PASSWORDHERE" }
- Reboot the device:
reboot
- Check if your robot received an ip address:
adb shell ip a
- Try to connect over ssh from your computer, and change your
.ssh/config
file accordinglyssh root@robotIP
orssh vacuum