Add Map to Xiaomi vacuum cleaner

Hi ThunderGreen,

unfortunately I don’t have a v2 on which I could try this method, but most likely it will work.
The software for v1 and v2 are very similar: on v1 there are many configuration files with disabled v2 options.

Please if someone have a v2 and wants to try to get maps, let us know.

I saw how to copy v2 image in the vacuum … I might give the a try but still not clear for me if it works offline.my vacuum is not connected to internet at all

Yes, you can use this method also without any Internet connection to the Xiaomi Cloud.

I’m without any connection to the Cloud too.

The v2 has crypted logs that means the livestream of the map works - but everything else needs improvment. There is also the solution i postet before - there it runs on a extra port with a service and server so you can access it without ssh.

but for both you need a rooted system

now it works to also get the crypted logs - my it is @asphalter interesting for you how it works.

Is there a better write up on how to root the vac? I have spend sometime on the Dustcloud github and still don’t quite understand it. Thanks

I think once it’s finished writing need a clean write-up for home assistant and gather all information together

@kiucheng I followed the guide at: DustCloud - Root HowTo

Below you’ll find the procedure:

Instructions on Linux
These instructions were tested on Ubuntu 14.04 and 17.10 and Fedora 27.

Create the firmware image
Install the required packages: Ubuntu: sudo apt-get install ccrypt git wget Fedora: sudo dnf install ccrypt git             
wget
Create a working directory: mkdir dc && cd dc
Download the dustcloud repository: git clone https://github.com/dgiese/dustcloud.git
Download the firmware image and language data:
For Xiaomi Gen 2 download the latest .pkg from here:     
https://dustcloud.seemoo.de/public/xiaomi.vacuum.gen2/original/
For Xiaomi Gen 1 download the latest .pkg from here: 
https://dustcloud.seemoo.de/public/xiaomi.vacuum.gen1/original/encrypted/
For both Xiaomi: wget https://github.com/dgiese/dustcloud/raw/master/devices/xiaomi.vacuum/original-    
soundpackages/encrypted/english.pkg
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.
Run the image builder: sudo ./dustcloud/devices/xiaomi.vacuum/firmwarebuilder/imagebuilder.sh -f 
v11_001228.pkg -k id_rsa.pub
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.

Install the required packages: sudo apt-get install python3 python3-pip python3-venv python3-dev 
Create a virtual env for our python packages: python3 -m venv .venv
Enter the virtual env: . .venv/bin/activate
Install wheel so the other packages can be installed successfully: pip install wheel
Install python-miio for communicating with the vacuum: pip install python-miio
Now press the wifi button on your vacuum and join the wifi created by it ('roborock-vacuum-s5_XXXXXXXX' 
or similar).
Use the flasher script to upload the new firmware: python 
dustcloud/devices/xiaomi.vacuum/firmwarebuilder/flasher.py -f output/v11_001228.pkg
The update takes several minutes. After the upload is complete, the robot explains that it is now going to 
install an upgrade and restarts when it is complete. Once the robot has successfully restarted, you can 
connect to it via SSH.
2 Likes

@cma0815 thank you for your time watching at my work. I’m glad to help!

I noticed your solution using a dedicated server on the vacuum to serve maps, but I really prefer to serve them over an encrypted, secure and already embedded service. The connection is started FROM the vacuum to avoid the creation of users on the device nor accessing using root user to fetch the maps.

@kiucheng Please try the root procedure and, if you encounter any problem, tell us. We’ll suggest you the right way.

Try and have fun :rofl:

it is not my work - i just helped the person who is coding the otherone. Thank you for your response.

Is there anyone who tried to implement my solution? :hugs:

2 Likes

A good how to and I’ll give it a shot

Try to watch at the README on Github:

https://github.com/asphalter/xiaomi_vacuum

I will.for the moment I do. A full clean every morning …this creates map and zoned cleaning works but I’ll give it a try

Yes, it’s not something related with zoned cleaning, but you’ll have the option to see the vacuum run during the cleaning and draw the lines across the map in real time.

Hi, I’m lurking here a while now and decided to root my Vacuum!
As I already had the token it was quite easy, followed the steps and used flasher.py using the ip and token.

Tried your way of adding the map and it’s working!
Had to change some things in the script tho, like directories and such.

Maybe you can add this more clear in your readme what to change?
For example, in the maps_to_ha.sh I had to change to RDIR, even tho above it says “### You shouldn’t touch anything below ###”.

Also in the config file I had to use my https to reach to navmap.
I hoped using just /local/navmap.png worked but unfortunately.


Anyway, it’s working now and that’s really cool!

Thanks for your hard work.

1 Like

Amazing! Nice job! Is it version 2 (Roborock S5)? Thanks!

Mine is V1, but like he said somewhere above, maybe it’s also possible with V2

1 Like

Just did it. Works nice (I ofc had to modify paths and such).

Maybe add a script that SCP:s stuff into the right folders given that you run it from a third machine?

Hello @Schneider, it’s absolutely possible to use this system also with v2.

I’ve just upgraded the github repo to explicitly confirm the compatibility with both v1 and v2.

1 Like

Thanks @Fietspomp for your confirmation, I’m glad to know that you’re successfully using my code.

I upgraded a little bit the repo to fit better the default paths making easier to install.