Add Map to Xiaomi vacuum cleaner

I am in the telegram dev channel yes i read about this but was wondering how to set ip up in hass :slight_smile: my robot is already rooted. Will check this immediately.

I’ve already got the token and from integration with HA - where do I start the rooting process with that?

Thats not the roken … thats another key. If you want take mentioned russain version of mihome and u can sniff the token directly from the robot, Well… then u have to root it with this wiki:

I’m finding that the firmware version on the instructions are quite old compared to what’s currently installed on my MiRobot Gen 1. Any risks of pushing an older modified firmware?

Nope. Downgrading is always better than upgrading in those cases.xiaomi tried to block their firmware in further updates.its highly recommended not to upgrade the Robo one the robot is rooted u will loose the root by upgrading the robot with the mihome app.

I can’t root my MiRobot v1, any help here would be appreciated.

Key points:

  • My MiRobot V1 has the latest firmware 3.3.9_003416
  • I’m following the Ubuntu steps on the guide here: https://github.com/dgiese/dustcloud/wiki/VacuumRobots-manual-update-root-Howto
  • I’m using Ubuntu 16.04 LTS using VirtualBox on a Windows 10 Machine. I tried it with Ubuntu 14.04 per the instructions but there were too many issues with Python and VENV versions being too old.
  • The newest firmware available according to the links on the instructions is v11_003254
  • All the steps work fine except for the final steps to upload the firmware

When I enter this into the terminal the result is:
python dustcloud/devices/xiaomi.vacuum/firmwarebuilder/flasher.py -f output/v11_003254.pkg

Flasher for Xiaomi Vacuum
Address is not set. Trying to discover.
Connecting to device 10.0.2.2...
Sending handshake to get token
Unable to discover a device at address 10.0.2.2
Traceback (most recent call last):
File "dustcloud/devices/xiaomi.vacuum/firmwarebuilder/flasher.py", line 206, in <module>
main()
File "dustcloud/devices/xiaomi.vacuum/firmwarebuilder/flasher.py", line 148, in main
m = vacuum.do_discover()
File "/home/sebastian/dc/.venv/lib/python3.5/site-packages/miio/device.py", line 162, in do_discover
raise DeviceException("Unable to discover the device %s" % self.ip)
miio.exceptions.DeviceException: Unable to discover the device 10.0.2.2

So I added the IP address of the MiRobot (when it’s in WIFI connecting mode) and get the below result:
python dustcloud/devices/xiaomi.vacuum/firmwarebuilder/flasher.py -f output/v11_003254.pkg -a 192.168.8.1

Flasher for Xiaomi Vacuum
Connecting to device 192.168.8.1...
Sending handshake to get token
Starting local http server...
Serving http server at 10.0.2.15:38069
Sending ota command with parameters: {"mode": "normal", "file_md5": "a37aa29d89780201fae295f4f42b6f2b", "app_url": "http://10.0.2.15:38069/output/v11_003254.pkg", "proc": "dnld install", "install": "1"}
Ota started!

Firmware downloaded successfully.
Exiting.

It gets to “firmware download successfully” very quickly. I’d expect the MiRobot to tell me it will update and do it’s thing but it does nothing at this point. To get my MiRobot working again i have to use the MiHome app and get it connected back to my wifi router.

Any advice? Do you think it’s new Xiaomi firmware blocking my downgrade?

it takes a while to update. When it starts, you’ll see the LED flash on the vacuum. Once finished it’ll restart and will tell you it’s updated the firmware

The led only flashes to indicate that its in wifi mode. I waited 10 minutes but nothing happens…

can you see the firmware upload progress bar in your terminal?

oh you appear to have forgotten to provide the token :wink:

It’s says “firmware downloaded successfully" then “exiting” within about 5 seconds of my command in the terminal. I see no progress bar.

Could it be the new firmware is blocking the downgrade?

that’s quite possible… but can you confirm you’re tried the command with the token? I don’t believe it’ll work without…
python dustcloud/devices/xiaomi.vacuum/firmwarebuilder/flasher.py -f output/v11_003254.pkg -a 192.168.8.1 -t xyz

The Ubuntu steps on https://github.com/dgiese/dustcloud/wiki/VacuumRobots-manual-update-root-Howto have no instructions on how to retrieve the token.

Is it the same token that I’m currently using to connect the mirobot in my home assistant YAML configuration? Do you know how I can get the token in Ubuntu?

When you do mirobo discover --handshake true it should display the token (or so the doc states), but in any case yes it’s the same token as the one you use in HA.

Unfortunately, that command doesn’t work for me. I get the below error. What’s worse, i think when i reset the WIFI on the mirobot it changes the token, so no my Home Assistant no longer talks to the MiRobot, and I don’t have the root working either

(.venv) sebastian@sebastian-VirtualBox:~/dc$ mirobo discover --handshake true
Traceback (most recent call last):
  File "/home/sebastian/dc/.venv/bin/mirobo", line 7, in <module>
    from miio.vacuum_cli import cli
  File "/home/sebastian/dc/.venv/lib/python3.5/site-packages/miio/vacuum_cli.py", line 21, in <module>
    from .updater import OneShotServer
  File "/home/sebastian/dc/.venv/lib/python3.5/site-packages/miio/updater.py", line 3, in <module>
    import netifaces
ImportError: No module named 'netifaces'

doc states this, maybe that’s why?:
Connect to open WiFi of the robot(rockrobo-XXXX)

I’m following those steps.

I wonder if I’m getting these issues cause I’m running Ubuntu in a Virtualbox VM. the Ubuntu instructions are able to auto find the mirobot and auto retrieve the token, so specifying them shouldn’t be needed. But not working for me.

sorry mate, not sure what else to try. And to reply to your earlier question yes it’s possible that a newer version of the firmware blocks the rooting… Sorry

I appreciate the help. @Skeletorjus was able to follow the Ubuntu steps using a VM so maybe it’s the updated firmware that’s causing me issues

I’ll keep trying and if i figure something out, will update here.

1 Like

Hey, @sebdoan

I think the token is reset every time you reset the WiFi-connection.
When I did it, I already had the token from a older version of MiHome, so I didn’t have to do all the steps. Maybe this is the route to go to get the token back.
In your error message you’re missing netifaces, so try pip install netifaces to get it.

I do remember encountering something similar that you are, but it was easily fixed, I just don’t remember how! Maybe some missing packages, wrong permissions or something similar…?
One thing i do remeber is that when it failed, the image had to be re-downloaded and patched again, strange as it might seem.