How to install alternative firmware on a robot vacuum cleaner Xiaomi: risks, preparation and step-by-step process

Xiaomi’s robot vacuum cleaners have long been popular with a combination of affordable pricing and advanced features. However, standard software from the manufacturer often limits the device’s capabilities: no support for third-party cards, some settings are blocked, and updates come with a delay. The solution is to install custom firmware, a modified version of the software that unlocks the hidden potential of the technology.

But before you start, it's important to understand that the firmware process is fraught with risks. Mistakes can turn your vacuum cleaner into a brick, disqualify warranties, or disrupt sensors. In this article, we'll look at everything from preparing and selecting firmware to recovering from possible failures. We'll focus on Xiaomi Mi Robot Vacuum-Mop 2 Pro, S5 Max, and STYJ02YM, as they're the most popular models among enthusiasts.

If you're new to the custom firmware world, we recommend you study each section carefully, and experienced users can immediately go to the instructions for the firmware or recovery unit, and for those who are still in doubt, below is a comparison table of pros and cons of alternative software.

What gives custom firmware: pros and cons

Before you take a risk, assess whether the game is worth the candle. Xiaomi’s alternative vacuum cleaner firmware is usually created by the developer community (e.g., based on OpenMIUI or Valetudo) and offers:

  • πŸ”“ Full control of the device: access to hidden fan speed settings, sensor sensitivity, cleaning modes.
  • πŸ—ΊοΈ Third-party map support: the ability to download room maps from Google Maps or OpenStreetMap instead of Xiaomi’s proprietary solutions.
  • πŸš€ Improved algorithms: optimized cleaning routes, support for areas with different settings (e.g. carpets vs laminate).
  • πŸ”„ Regular updates from the community, not every six months from the manufacturer.

But there is a downside:

AdvantagesDeficiencies
Extended functionality (e.g. manual speed control)Loss of official guarantee
Lack of advertising and telemetry feesRisk of β€œbricking” in case of error
Support for informal integrations (Home Assistant, Node-RED)Potential bugs in alpha/beta versions
Possibility of rollback on stock firmwareDifficulty setting up for beginners

Critical: Firmware from third-party developers do not pass Xiaomi certification, which means that some features (for example, laser scanning in the Internet) are not certified. LDS-sensors) may operate unstablely or require additional calibration.

⚠️ Note: On LiDAR models (e.g. Xiaomi Mop 2 Ultra), unofficial software can cause card construction to fail. Check compatibility on the Valetudo forum before firmware.

Preparation for firmware: what to do in advance

Successful firmware is 80% pre-production-dependent, and here's a checklist of mandatory actions:

Download the official firmware (in case of rollbacks)|Check the model of the vacuum cleaner in Settings β†’ About the device|Create a backup of maps and settings|Prepare. USB-OTG cable (for some models)|Install ADB-PC-driver

-->

First, you need to determine the exact model of your vacuum cleaner.

  1. Turn the device over and find a sticker with the serial number.
  2. Or go to the Mi Home app, select a vacuum cleaner β†’ Settings β†’ About the device.

For example, for Xiaomi STYJ02YM, Valetudo RE firmware is suitable, and for the S5 Max, a modified version of Mi Home Hacked.

Also prepare:

  • πŸ’» Windows computer 10/11 or Linux (for the ADB and Fastboot).
  • πŸ”Œ Cable USB Type-C (original, undamaged!).
  • πŸ“± Mi Home app with tied vacuum cleaner (required to unlock).
  • πŸ”‹ Charge at least 50% – interruption due to battery discharge guaranteed to kill the device.

Xiaomi Mi Robot Vacuum-Mop 2 Pro|Xiaomi S5/S5 Max|Xiaomi STYJ02YM (Mop 2)|Xiaomi Mop 2 Ultra|Another model

-->

⚠️ Warning: If your vacuum cleaner is tied to a Xiaomi account with two-factor authentication, untie it before firmware or save backup codes. Some custom firmware blocks access to cloud features.

Unlock the bootloader: without it anywhere

By default, Xiaomi vacuum cleaners have a locked bootloader, which prevents the installation of third-party software. Unlocking requires official permission from Xiaomi, but there are workarounds.

Method 1: Official Unblock (for experienced users)

  1. Go to the Mi Unlock website and log in.
  2. Download the Mi Unlock Tool utility and connect the vacuum cleaner to your PC in Fastboot mode (press Power + Home for 10 seconds).
  3. Follow the instructions of the program. Usually, it takes 72 hours to unlock (Xiaomi checks the account).

Method 2: Bypass ADB (not working on all models)

adb shell


su




echo"wait-for-device" > /data/local/tmp/bootloader_unlock




reboot bootloader

If the official method didn’t work, try exploits for a specific model. For example, for STYJ02YM, Xiaomi ADB/Fastboot Tools utility with Bypass Mi Account option is suitable.

What happens if you don’t unlock the bootloader?
Without unlocking, you can’t flash custom recovery (like TWRP) or the kernel. Maximum – you can replace some system files through ADB, but this is fraught with failures. On new models (2023+), Xiaomi has tightened protection: trying to flash a locked device leads to hardware locking the eMMC chip.

After successful unlocking, check the status of the team:

fastboot oem device-info

The answer should be Device unlocked: true.

Step-by-step instructions: how to sew a vacuum cleaner

Now, to the most critical point, we'll look at two methods: through ADB Sideload (for.zip firmware) and through Fastboot (for.img images).

This method is suitable for firmware based on Valetudo or OpenMIUI.

  1. Download the firmware (e.g. Valetudo RE) and place the valetudo-re-*.zip file in the folder with ADB.
  2. Connect the vacuum cleaner to your PC and turn it into ADB: Turn off the device. Press the Power + Dock buttons for 5 seconds. Connect the cable, and the blue light should light up.
adb devices

Your device should be displayed (e.g. 192.168.1.100:5555).

adb sideload valetudo-re-*.zip

It'll take 5-10 minutes. Don't turn off the cable.

Method 2: Fastboot Firmware (for experienced)

This method requires an unlocked bootloader and is suitable for custom recovery installation (e.g. TWRP).

  1. Download recovery.img image for your model (see XDA Developers).
  2. Transform the vacuum cleaner to Fastboot mode (press Power + Home for 10 seconds).
  3. Recovery: fastboot flash recovery.img fastboot reboot recovery
  4. In TWRP, select Install β†’ specify the path to firmware (.zip) β†’ swipe for confirmation.

Step 2: Calibration of sensors.

For models with LiDAR or LDS, recalibration is required:

  1. Go to Settings β†’ Hardware β†’ Calibration.
  2. Follow the instructions on the screen (usually you need to manually rotate the vacuum cleaner 360Β°).
  3. Save the map of the room through Map β†’ Save.

Step 3: Integration with a smart home.

Custom firmware supports MQTT and Home Assistant.

# Example of configuration for Home Assistant (configuration.yaml)


vacuum:




- platform: valetudo




host: 192.168.1.100




token:"your_token_here"

πŸ’‘

After firmware, be sure to update the room maps.Old maps from Mi Home are not compatible with Valetudo and can cause navigation errors.

Recovery after a failure: what to do if something goes wrong

Even with care, there are failures, problems and solutions.

Problem 1: The vacuum cleaner is not turned on (brick)

Symptoms: no response to buttons, no lights.

Decision:

  1. Connect the vacuum cleaner to charge for 30 minutes.
  2. Press Power + Dock + Spot Clean for 20 seconds.
  3. If it doesn’t work, run the stock firmware through Fastboot: fastboot flash all stock_rom.img

Problem 2: Sensor error (codes E1, E2, E5)

Symptoms: The vacuum cleaner beeps, shows an error of the collision sensor or LiDAR.

Decision:

  • πŸ”§ Recalibrate sensors through Settings β†’ Hardware β†’ Reset Sensors.
  • πŸ”„ Reverse to the previous firmware version (the current one may not be compatible with your model).
  • πŸ› οΈ Disassemble the vacuum cleaner and check the connection of sensor plumes (carefully!).

Problem 3: Wi-Fi or the Cloud is not working

Symptoms: The vacuum cleaner does not connect to the network, does not respond to commands from the application.

Decision:

  1. Reset your network settings: Settings β†’ Network β†’ Forget Wi-Fi.
  2. If you are using Valetudo, check your MQTT settings in /etc/valetudo/config.json.
  3. Models with an ESP8266 chip (such as the S5 Max) may require Wi-Fi module firmware separately.

⚠️ Note: If after firmware vacuum cleaner is constantly reloaded, most likely damaged partition table GPT. It can be restored only through Fastboot with a complete flashing of all partitions (boot, system, vendor).

Frequent Questions (FAQ)

Can I clean the vacuum cleaner without unlocking the loader?
Technically, but with serious limitations. Without unlocking, you can only replace some of your system files through ADB, which can be unstable.
How to get back the official firmware Xiaomi?
Download the stock firmware for your model from Xiaomi Firmware. Run it through Fastboot: fastboot flash all stock_firmware.img Then, re-tire the vacuum cleaner at Mi Home.
Will the voice assistant (Alice, Google Assistant) work after the firmware?
No, custom firmware disables Xiaomi’s cloud services, including voice assistants, but you can configure management via Home Assistant or Node-RED with your own voice commands.
How to update custom firmware?
Most alternative firmware (e.g. Valetudo) support OTA-For this: Go to Settings β†’ System β†’ Updates. Press Check for Updates. Confirm the installation of the new version. OTA It does not work, download the update manually and run through ADB Sideload.
Can I use a phone to clean the vacuum cleaner without a PC?
Some firmware (such as Mi Home Hacked) is installed through a modified Mi Home app on Android, but it still requires a computer to unlock the bootloader and firmware via Fastboot.