Liberating a vacuum robot
The time had come for me to finally invest in some vacuum robot again. I was eyeing with that idea for a while now, but hesitated until recently because basically all current robots require some cloud connection for even the most simple tasks like locally starting a cleaning process. In addition I wanted something which I can integrate into my openHAB setup which made choosing one of the available options nearly impossible.
This changed when I stumbled upon a project again I remembered some colleagues told me about quiet some time ago: Valetudo. Valetudo is an “open source cloud replacement for vacuum robots enabling local-only operation”. Their supported robots are limited, but I still found one fitting my needs: The Dreame Z10 Pro, which conveniently also happened to be one of the two recommended options.
Consulting the documentation for the Z10 Pro, beside the robot itself I also needed an 3.3v USB UART adapter. I bought one with an CP2102 chip (which is one of the two recommended ones) from a small online shop for around 5€.
After everything arrived I first inspected the robot if everything was okay and let it have a little test run with its spot-cleaning feature. This can be done manually and without any setup by placing the robot somewhere and pressing the right of the three top buttons for it to start.
Ensuring the vacuum robot can indeed vacuum I turned it completely off again and started to disassemble its top cover. Below that lies the port for the USB UART connector which is needed for the connection between the computer and the robot. It looked easy just by the images in the documentation, but in reality that top cover sits on so tight that I was afraid something on it could snap any second. Several pry tools, a spatula covered in cloth and a bit of cold sweat later and that cover popped off without any damage – phew.
Connecting to the robot via the USB UART adapter was pretty easy. The Valetudo docs feature useful imagery and the adapter had every label pinned on it. The only thing I was unsure about was where to put the ‘GND’ cable into since there are two possible connections for it. A quick visit on YouTube searching for somebody doing a similar thing to their Z10 Pro revealed to me that only one GND connection is needed. I chose to use the bottom one.
On my computer the first thing I needed to do was installing ‘screen’. Most Linux distributions have this tool in their repositories, so installing was just a matter of calling the package manager once.
As soon as ‘screen’ was ready to use, I continued following the documentation to use it to connect to the vacuum robot. I first did not get any output at all, but swapping the RX and TX cables with each other as advised was the solution to that one. Logs where filling my screen, including
chpasswd: password for 'root' changed which is intended and a good sign.
The next step involved pressing the wifi reset button for less than 1 second to get access to a login prompt. Simple as that, but sadly that is where my journey got slowed down a bit: Instead of the login prompt I just got a log line telling me:
can't open '/etc/os_release': No such file or directory.
Having a quick research tour I found a technical information document about Dreame vacuum robots by Dennis Giese which described my issue as being a sign for the firmware being too new.
Sidenote: Simply said, Valetudo itself is only the software tool running on the robot providing the interface to the robots functionality. For being able to run such custom software on the robot at all the installation of a custom firmware is needed in first place. The project dontvacuum.me by security researcher Dennis Giese provides the tooling to create and install the needed custom firmware, which also can include Valetudo if configured accordingly.
At this point I could not find any useful information on how to possibly downgrade the factory installed firmware for me to gain access to the needed login prompt. I posted my disappointment on Mastodon and started to pack up the robot again when I got a reply suggesting that I should get in touch with the project maintainer since that worked out for the person messaging me who experienced a similar problem in the past. I contacted Dennis Giese (btw. he is a great guy!) and asked him if there was still hope for me left. Lo and behold he was able to help me manually and my robot was ready to be logged onto and to be continued setting up the custom firmware and Valetudo.
From here on no more roadblocks happened and everything else went smoothly. I logged onto the robot, copied the necessary files over and installed the custom firmware which already had the latest version of Valetudo bundled. A quick initial setup later and my robot vacuum was liberated and ready to use fully offline!
As for now I am going to use Valetudos web interface on my phone which is being accessible by the robots IP address. It is even “installable” onto the iOS homescreen as a homescreen web app with a nice icon and such. I also ensured that my router always assigns the same IP to the robot so I do not have to look it up every once in a while.
For the near future I am planning to integrate it into my openHAB installation so it will blend in with the rest of my home automation setup. Until then!