How to flash Xiaomi router: official and custom firmware

The firmware of Xiaomi routers is a challenge that every owner of this equipment faces sooner or later. The reasons can be different from the desire to get new features to the need to fix critical bugs in the regular firmware. However, the process of updating software on Mi Router network devices has nuances that it is important to consider so as not to turn a router into a brick. Unlike smartphones, where firmware is often reduced to a few clicks, working with routers requires understanding network protocols and accuracy when manipulating the bootloader.

In this article, we will discuss all the current ways to firmware Xiaomi routers (including Mi Router models). 4A/4C/4Q/AC2100 And others), from official updates through the web interface to the installation of custom firmware like OpenWRT or Padavan, we will pay special attention to the typical errors that lead to the β€œbricking” of the device, and how to recover from a failed firmware. If you have never worked with a networking firmware before, don’t worry: we’ll give you clear instructions explaining each step.

Preparation for firmware: what you need to know before you start

Before you start updating, make sure you understand the risks: Incorrect firmware can lead to loss of warranty (for custom builds), network instability, or complete device failure.

  • πŸ” Router model: Clarify the exact modification (e.g. Mi Router) 4A Gigabit Edition or Gigabit Edition AX3600). Firmware is not universal!
  • πŸ“‹ Current version of the software: Write down the firmware version in the Status menu β†’ This will help you to roll back if necessary.
  • πŸ”Œ Backup power: Connect the router to a UPS or full charge laptop. power interrupts while firmware is through SSH It can make the device unsuitable for recovery without a soldering iron.
  • πŸ“‘ Network connection: Official updates require a stable Internet. Custom firmware requires a cable LAN (Wi-Fi offline!).

Also prepare:

  • πŸ–₯️ Computer with Windows/Linux/macOS (for SSH-You will need a terminal or a PuTTY).
  • πŸ“ Firmware file (official.bin or customized.trx/.img).
  • πŸ”§ Screwdriver (for disassembly of the body, if emergency recovery is required through UART).

⚠️ Attention: Xiaomi routers with firmware based MIWIFI (Like Mi Router. 3G/4) They can block the installation of third-party software through signature verification, in which case you will first need to unlock the downloader.

πŸ“Š What kind of firmware do you plan to install?
Official from Xiaomi
OpenWRT
Padavan
DD-WRT
Another.

Method 1: Official update via web interface

The easiest and most secure method is to upgrade through the router’s standard web interface, which is suitable for most users who want to get the latest fixes from the manufacturer without risking losing the warranty.

  1. Connect to the router network via cable or Wi-Fi.
  2. Open your browser and type in the address bar 192.168.31.1 (or miwifi.com).
  3. Log in (the default login and password is usually admin). + password).
  4. Go to the Software Update section (in new versions of the interface, the path may look like additionally). β†’ System system β†’ Update).
  5. Click Check Updates. If a new version is available, the system will prompt you to download and install it.
  6. Confirm the installation and wait for the reboot (usually takes 2-5 minutes).

If the automatic update does not work (for example, due to regional restrictions), you can download the firmware manually:

  1. Download the official.bin file from Xiaomi support site (select the version strictly for your model!).
  2. In the router’s web interface in the Software Update section, click Select a file and specify the downloaded.bin.
  3. Confirm the installation and wait for the process to be completed.
Model routerThe last official firmware (June 2026)Features
Mi Router 4A2.28.153Support IPv6, fixes for 5GHz Wi-Fi
Mi Router 4C2.30.121Improved stability at high load
AX36003.0.36Optimization for Mesh Networks
Mi Router AC21002.26.187Fixed vulnerabilities in the web interface

⚠️ Note: If after the update, the router has ceased to issue IP-address (DHCP It doesn’t work, reset to factory settings via the Reset button (hold 10 seconds), a common problem when switching between major firmware versions (e.g., with a new version of the software). 2.x on 3.x).

πŸ’‘

Official firmware Xiaomi are tested for compatibility with the equipment, but may lag behind the functionality of custom assemblies.

Method 2: Firmware through SSH (power-user)

Installation of firmware through SSH It gives you more control over the process and allows you to bypass some of the limitations of the web interface, which is suitable for installing custom firmware (for example, OpenWRT) or rolling back on the previous version. SSH-Access that new Xiaomi models may be blocked.

Here's the step-by-step instruction:

Turn on SSH in the web interface (section "Additional" β†’ SSH")

Download firmware in.trx or.bin format

Connect the router to the PC via cable LAN

Install PuTTY (Windows) or use Terminal (macOS/Linux)

-->

  1. Turn it on. SSH: Go to the router's web interface (192.168.31.1). β†’ SSH (Activate access and write down ports (usually 22).

Connect to the SSH

ssh root@192.168.31.1 -p 22


Password: Admin (or your current password)

Download the firmware to the router

  • Use it. SCP (For example, via WinSCP or a command in a terminal):
  • Install firmware: cd /tmp mtd write firmware.trx firmware For some models (e.g, AX3600) The command may be different: ubiformat /dev/mtd12 -y -f firmware.bin
  • Restart router: reboot

If the router does not respond after the reboot, try:

  • πŸ”„ Wait 10-15 minutes (the first run of a new firmware can be a long time).
  • πŸ”Œ Remove/insert the power supply.
  • πŸ› οΈ Take advantage of disaster recovery (see section below).
What to do if SSH disabled in the web interface?
On the new firmware Xiaomi blocks access to SSH. To enable it, you can: 1. Use the exploit via a web interface (for example, for Mi Router). 4A There are scripts on GitHub. 2. Reverse to the old firmware, where SSH unlocked and then upgrade to custom 3. disassemble the router and connect to UART-port.

Method 3: Install custom firmware (OpenWRT, Padavan)

Custom firmware like OpenWRT or Padavan opens up access to advanced settings that are not available in standard Xiaomi software.

  • 🌐 Settings VPN-servers (WireGuard, OpenVPN).
  • πŸ“‘ Optimize Wi-Fi (for example, increase transmission power).
  • πŸ”’ Blocking Advertising at Level DNS (AdGuard Home).
  • πŸ–₯️ External drive connections (Samba, DLNA).

There are, however, downsides:

  • ⚠️ Loss of warranty (if you resort to unlocking the bootloader).
  • ⚑ Possible performance issues (not all firmware is optimized for Xiaomi hardware).
  • πŸ”§ The need to manually adjust many parameters.

Instructions for OpenWRT:

  1. Download the firmware for your model from the official OpenWRT website. TOH (Table of Hardware – it shows supported devices and installation nuances.
  2. If your model requires unlocking the bootloader (for example, Mi Router) 4A), Do it through SSH: nvram set flag_try_sys1_failed=1 nvram set flag_try_sys2_failed=1 nvram commit reboot
  3. Install the firmware through SSH (similar to method 2) or web interface (if supported).
  4. After the reboot, go to the new web interface 192.168.1.1 (the default login/password is usually missing).

Instructions for Padavan:

  • πŸ“₯ Download firmware from the Padavan forum (choose the version for your hardware!).
  • πŸ”§ Set it through SSH or Breed Bootloader (if pre-installed).
  • βš™οΈ Manually configure the network – Padavan does not save configuration from the previous firmware.

πŸ’‘

Before installing custom firmware, back up your current settings via the web interface (More) β†’ Backups. This will help you quickly restore the network if something goes wrong.

Recovery of the router after a failed firmware

If the router has stopped responding to 192.168.31.1, it will not be IP Or it's constantly rebooting, don't panic. In 90 percent of cases, it's recoverable:

Method 1: Emergency Web Interface (MiWiFi Recovery)

Some Xiaomi models (e.g. Mi Router) 3/4) have a hidden recovery mode:

  1. Turn off the router.
  2. Press the Reset button and, holding it, connect the power.
  3. In 5-10 seconds, release the button. The indicators should flash orange.
  4. Connect to the router network via cable (IP-The PC address must be manually set to 192.168.1.2).
  5. Open in the browser 192.168.1.1 - should appear recovery interface.
  6. Download the official firmware.bin and wait for the process to be completed.

Method 2: Recovery through UART

If the web interface is not available, you will need physical access to the router board:

  1. Disassemble the body (carefully so as not to damage the antennas!).
  2. Find the connector. UART (4 contacts: GND, TX, RX, 3.3V).
  3. Connect a USB-to-TTL adapter (for example, CP2102) ce GND, TX, RX (feeding 3.3V don't plug in!).
  4. Open the terminal (speed 115200 bits/s) and turn on the router.
  5. At the time of download, interrupt it (usually with the key 1 or Ctrl).+C) and enter firmware commands through TFTP.

Example of teams UART (for Mi Router 3G):

setenv serverip 192.168.1.100


setenv ipaddr 192.168.1.1




tftpboot 0x80000000 firmware.bin




erase 0x9f020000 +0x7c0000




cp.b 0x80000000 0x9f020000 0x7c0000




bootm 0x9f020000

⚠️ Attention: When working with UART It is easy to damage the bootloader if you incorrectly specify memory addresses. For each Xiaomi model, flash addresses differ - look for accurate data on forums (for example, for each Xiaomi model, 4PDA).

Reverse to the previous version of the firmware

If the new firmware is unstable (e.g., Wi-Fi is broken or Internet is slowed down), you can return the previous version.

Through the web interface (if the router is loaded)

  1. Download the correct version of the firmware from XDA Developers or Xiaomi archive.
  2. Come to the extra. β†’ Update of the PO.
  3. Select the downloaded file and confirm the rollback.

Through SSH (if the web interface is blocked)

cd /tmp


wget http://link to firmware.bin




mtd write firmware.bin firmware




reboot

Through Breed Bootloader (if installed)

Breed is an alternative bootloader that allows you to choose firmware at the start:

  1. When turning on the router, hold the Reset button until all the indicators blink.
  2. Connect to the router network (IP 192.168.1.1).
  3. In the Breed web interface, select the Firmware Update section and download the desired file.

If rollbacks don’t work, try resetting to factory settings via Reset (hold 30 seconds), and sometimes conflicts arise because configuration files are incompatible between firmware versions.

Frequent mistakes and their solutions

Even if you follow the instructions, you can have problems, and here are the most common mistakes and ways to correct them:

Mistake.Possible causeDecision
The router does not turn on after firmwareIncompatible firmware or interrupted processRecovery through UART service-centre
Wi-Fi is not working after the updateResetting radio module settingsGo to Wi-Fi Settings and save the settings again
Invalid firmware error when downloadingInappropriate firmware file for the modelDownload the correct version from the official website
Constant reboots (bootloop)Damage to the loaderFirmware through TFTP emergency
No access to the web interface after firmwareReset IP-router address on 192.168.1.1Check PC network settings or do a router reset

If the router after firmware behaves unstable (for example, β€œhangs” once an hour), check:

  • πŸ”₯ Overheating: Open the case and clean the dust (especially relevant for the Mi Router 3).
  • πŸ“Ά Wi-Fi Channel Conflict: Manually set channel 6 or 11 for 2.4 GHz.
  • πŸ”„ Cyclical Reboot: Turn off Auto Update in Settings.
Can I run a Xiaomi router without a computer?
Yes, official firmware is installed directly through the router's web interface (192.168.31.1). However, custom firmware (e.g. OpenWRT) is usually required. SSH-access, which means a computer or smartphone with a terminal client (for example, Termux for Android).
How do I know which firmware is right for my Xiaomi model?
Check the exact model on the sticker under the router (for example, R4A or R3D). Then find it in the OpenWRT database or in the forum. 4PDA. Pay attention to the fee review (e.g. Mi Router) 4A v1 and v2 They may require different firmware).
What if the router distributes the Internet after firmware, but the web interface does not open?
Possible causes: Reset IP-router address on 192.168.1.1 (try to connect to this address); port conflict (try to disable the firewall on the PC); damage to the web server in the firmware (you need to roll back or flash through the firmware SSH). If nothing helps, reset to factory settings (Reset 10 seconds).
Can I flash the Xiaomi router through the Mi WiFi mobile app?
No, the Mi WiFi app does not support manual firmware installation; it can only initiate update verification over the Internet. Use the web interface (192.168.31.1) or SSH.
How to return the warranty after installing custom firmware?
Theoretically, you can flash back official software via MiWiFi Recovery or UART, but: πŸ”§ The service center may detect traces of interference (for example, a modified bootloader). πŸ“ Warranty is canceled if the case is opened (on new models there are fillings). πŸ”„ Some custom firmware blocks rollback to the runoff (for example, Padavan on the AX3600). If the warranty is critical, it is better not to risk with unofficial software.