How to reflash the Xiaomi 4A router: official and custom methods

Xiaomi Router 4A (R4A or Mi Router 4A Gigabit Edition) is still a popular home networking solution due to its price-performance balance. However, standard firmware from the manufacturer does not always meet the needs of users: someone wants to expand the device’s capabilities with custom firmware (like OpenWRT or Padavan), and someone needs a simple update to fix bugs or improve security. In this article, we will discuss both scenarios – from an official update via the web interface to installing alternative software with the bootloader unlock.

It's important to understand that flashing is not a harmless operation. Mistakes can turn a router into a brick, and using informal firmware is not warranty. We will describe each step in detail, including unique nuances for the 4A model (for example, the features of working with the MT7628AN chip and the limits on 32 MB of flash memory) to minimize risks. If you are a beginner, start with the official method, experienced users will find here details on unlocking the bootloader and installing OpenWRT.

Preparation for Flashing: What You Need to Know Before You Start

Before you start updating, make sure your Xiaomi Router 4A meets the following key requirements:

  • πŸ”Œ Stable power supply: use the original power supply (5V/1A). Voltage changes during firmware can damage flash memory.
  • πŸ“Ά Backup Internet: If you update via a web interface, connect the router to the network with a cable - Wi-Fi can turn off in the process.
  • πŸ’Ύ Settings Backup: Export the current configuration to the file (in the Settings menu) β†’ System system β†’ Backup. This will save you time to reconfigure.
  • ⚑ Laptop Charge: If you are running through SSH, Make sure your PC doesn’t run out – interrupting a session is critical.

Pay special attention to the current firmware versions. Xiaomi Router 4A has two main lines of software:

  • πŸ”Ή Stock (MiWiFi): official firmware with limited functionality but maximum stability. miwifi_r4a_firmware_*.bin.
  • πŸ”Ή Castomy (OpenWRT/Padavan): Expands capabilities (e.g., supports WireGuard, AdGuard Home), but requires unlocking the bootloader.

⚠️ Note: If your router is purchased outside of China (e.g., the global version of Mi Router) 4A International, some custom firmware may not support localization of the interface or Wi-Fi frequency for your region.

To determine the current firmware version, go to Settings β†’ Status β†’ Firmware version. Write it down to help you choose the right file to upgrade. If you plan to install OpenWRT, check the Wi-Fi chip model (in Xiaomi 4A it is usually MT7628AN or MT7612EN), as this is the build choice.

πŸ“Š What kind of firmware do you plan to install?
Official (MiWiFi)
OpenWRT
Padavan
Another custom
I haven't decided yet.

Official firmware update via web interface

The safest way is to upgrade through the standard MiWiFi interface, which is suitable for most users and does not require technical skills.

  1. Connect the router to the Internet through WAN-port (blue connector) Make sure the connection is stable.
  2. Open your browser and type in 192.168.31.1 (or miwifi.com). Sign in with your Xiaomi account.
  3. Go to Settings β†’ Update firmware. The system will automatically check for new versions.
  4. If the update is available, click Update. Do not turn off power or restart the router for 5-10 minutes.

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

  1. Download the latest version of the software from the official Xiaomi Support website (select a file for the R4A model).
  2. In the router’s web interface, go to Settings β†’ Firmware Update β†’ Select a file and download the downloaded.bin file.
  3. Confirm installation. The router will restart automatically.

⚠️ Warning: If the router does not load after the update (all indicators are on or orange LED flashes), try resetting with the Reset button (hold 10 seconds). UART or TFTP (described below).

β˜‘οΈ Preparation for manual upgrade

Done: 0 / 4

Installation of custom firmware: unlocking the loader

To install OpenWRT, Padavan, or other alternative firmware, you need to unlock the router’s bootloader, which is irreversible and voids the warranty.

  • πŸ–₯️ Computer with Windows or Linux (for example, for SSH-access).
  • πŸ”§ The PuTTY programme (for SSH) WinSCP (for file transfer).
  • πŸ“ OpenWRT firmware for MT7628AN (Only download from trusted sources, such as openwrt.org).
  • πŸ”‘ SN-router number (located on the sticker at the bottom of the device).

The unlocking process includes several stages:

  1. Activation of the Developer Mode: Connect to the router SSH (The username and password are admin and the password from the web interface. boot_wait=on nvram set uart_en=1 nvram commit reboot
  2. UART connection: You will need a soldering iron and a USB-UART adapter (for example, CP2102). Connect to TX, RX, GND contacts on the router board (unpinning is available in the OpenWRT documentation).
  3. Loading custom firmware: through TFTP or SCP Download the firmware file (usually) openwrt-ramips-mt7628-xiaomi_mi-router-4a-squashfs-sysupgrade.bin).

Once you have successfully run your firmware, the router will restart and you can log into a new web interface (usually at 192.168.1.1). First, change the administrator password – it is often installed by default in custom firmware (for example, the password for OpenWRT).

What if the router does not load after the firmware?
If the indicators burn out of the box after installing custom firmware (e.g., constant red), try: 1. Hold the Reset button for 30 seconds for a full reset. 2. Connect to UART and check the download logs (possibly the firmware is not suitable for your board revision). 3. Repeat the firmware through TFTP in emergency mode (instructions are available on 4PDA forums).

Comparison of firmware: which one to choose for Xiaomi 4A

The choice of firmware depends on your tasks. Below is a table with a comparison of key features:

CharacteristicsStock (MiWiFi)OpenWRTPadavan
Support for VPNPPTP/L2TP (Old) OnlyWireGuard, OpenVPN, IPSecOpenVPN, Shadowsocks
Traffic managementBasic QoSSQM, nftables, tcExtended QoS over IP/MAC
Support for USB supportNo.Yes, Samba, DLNA, 3G-modems)Yes (with limitations)
StabilityTall.Medium (depending on assembly)High (optimized for MT7628)
LocalizationRussian, EnglishMultilingual (packages need to be installed)Russian (in most of the assemblies)

For most home users, Padavan is the best choice: it keeps MiWiFi setup simple, but adds advanced features (e.g. AdBlock, DDNS, IPv6 support). OpenWRT is suitable for enthusiasts who are ready to configure the router via the command line and install packages manually.

πŸ’‘

If after installing OpenWRT router began to slow down, try to disable unnecessary services through the command systemctl disable. [service] (For example, systemctl disable dnsmasq, if you use an external DNS-server).

Recovery of the router after a failed firmware

If the router stops loading (it doesn't respond to ping, the power indicator doesn't burn, or flashes red), don't panic. In 90% of cases, it can be restored. Here's an algorithm for actions:

  1. Hardware reset: Hold the Reset button for 15-20 seconds. If the router reacts (flashes the indicator), try going to the web interface.
  2. Recovery through TFTP: Connect the router to the PC via Ethernet (use) LAN-port WAN!). Set up on PC static IP 192.168.31.2/24. Launch it. TFTP-server, Tftpd64) And put a firmware file with a name in its directory. miwifi.bin. Hold the Reset button, turn on the router power and hold the button still. 10 The router must automatically download the firmware.
  3. UART firmware: If TFTP doesn't help, you'll need a soldering iron and USB-UART adapter. Connect to the router console (speed 57600 baht) and enter commands to download firmware via tftp: setenv serverip 192.168.31.2 setenv ipaddr 192.168.31.1 tftpboot 0x80060000 miwifi.binse erase 0x9f020000 +0x7a0000 cp.b 0x80060000 0x9f020000 0x7a0000 reboot

⚠️ If the router does not respond even to UART (No response to commands, most likely, the flash memory is damaged, in which case only the replacement of the Winbond chip will help. 25Q128 (or similar) by programmer CH341A. Contact the service center - self-repair requires experience with soldering equipment.

πŸ’‘

TFTP recovery only works if the boot loader is not damaged. If the router is not showing signs of life (it is not warming, the indicators are not flashing), the problem may be in the hardware.

Optimal settings after firmware

After successfully installing a new firmware, it is recommended to perform a basic setup to improve performance and safety:

  • πŸ”’ Change the administrator password: OpenWRT has no default password, Padavan β€” admin/admin.
  • 🌐 Set up. DNS: replace the standard DNS-1.1.1.1 Cloudflare or 8.8.8.8 (Google) servers to speed up the Internet.
  • πŸ“‘ Optimize Wi-Fi: Set the channel manually (like 6 or 11 for 2.4GHz) to avoid interference. 802.11r (fast roaming) if you don't have a mesh network.Reduce the transmission power to 50% if the router overheats.
  • πŸ›‘οΈ Activate the firewall: In OpenWRT, turn on Firewall β†’ Basic Settings β†’ Drop Invalid Packets.

It is useful for Padavan to enable Jumbo Frames (in the LAN β†’ Switch section) if your network supports gigabit speeds, which will reduce the load on the router’s CPU when transferring large files.

If you have installed OpenWRT, consider installing additional packages:

  • πŸ“Š luci-app-sqm – to control buffers and reduce ping in games.
  • πŸ” luci-app-adblock – blocking advertising at the level of DNS.
  • πŸ”„ luci-app-ddns - dynamic DNS remotely.

Frequent mistakes and their solutions

Even with the exact following of the instructions, there can be problems, and let's look at typical scenarios and ways to fix them:

  • 🚫 Invalid firmware error when downloading: Reason: firmware file is not suitable for your model. Solution: download firmware specifically for Xiaomi Router 4A (don't confuse 4C or 4Q). Check the checksum (MD5) file.
  • πŸ”„ Router fixes on reboot: Reason: Configuration partition damaged. Solution: boot to failsafe-mode (hold Reset when turned on) and reset through firstboot.
  • πŸ“Ά Wi-Fi doesn't work after firmware: Reason: there are no drivers for your Wi-Fi chip.Solution: check firmware compatibility with MT7628AN or MT7612EN. OpenWRT may require packet installation kmod-mt76.
  • πŸ”Œ Ports LAN not working: Reason: Switch settings are lost. Solution: OpenWRT check configuration in /etc/config/network (It should be an option type 'bridge' for lan).

If the router after firmware began to warm up a lot, check the load on the CPU with the top command in SSH. A common reason is background processes (for example, collectd or dnsmasq).

/etc/init.d/[service] stop


/etc/init.d/[service] disable

Can I return the stock firmware after installing OpenWRT?
Yes, but the process isn't always easy. miwifi_r4a_firmware_*.Bin, connect to the router on SSH and upload the file to temporary memory: scp miwifi.bin root@192.168.1.1:/tmp/ Switch it to mtd: mtd write /tmp/miwifi.bin firmware ⚠️ Risk: If the firmware partition has been changed (e.g., when you install OpenWRT with a different markup), you may need to restore it through the UART.
How to check if the bootloader is unlocked?
Connect to the router on SSH And then you run the command: nvram get. boot_wait If the answer is on, the bootloader is unlocked, you can also check for the U-Boot string in the boot logs (via the boot logs). UART).
Why is there no internet after Padavan?
A common problem is the wrong settings WAN. Check: Type of connection (DHCP/PPPoE/Static) Internet section β†’ WAN. MAC-Address: Some providers link access to the original MAC Cloning it in the Padavan settings. VLAN: Padavan can be enabled by default VLAN Tagging (unplug if you are not using it).
Can I use Xiaomi 4A without a soldering iron?
Yes, but with limitations: Official updates are always free of soldering iron (via web interface) and custom firmware (such as Padavan) can be installed via SSH without UART, If the bootloader is already unlocked, recover from a failure without UART remains TFTP-method (not working on all versions of the loader) If the router is "brickled" and does not respond to the TFTP, solderless UART-The adapter won't work.
Which firmware is better for gaming consoles (PS5/Xbox)?summary> To minimize ping and stable connection is recommended: Padavan with enabled SQM (Smart Queue Management and prioritizing traffic for consoles MAC-OpenWRT with luci-app-sqm and configuration piece_of_cake.qos To reduce buffering, both of which are: IPv6 (If not in use, set up static IP console-wise DHCP. Activate UPnP (in Padavan: Settings) LAN β†’ UPnP).