OpenWrt support for Xiaomi AX3000T

Xiaomi AX3000T RD23 (Global version): OpenWrt installation

  • guide for installing OpenWrt on the Xiaomi AX3000T RD23 (Global Version).
  • installation method: UART flash.
    ** the following OpenWrt installation method requires opening the device, connecting a UART cable, and following a specific set of steps. :warning: This process is recommended only for advanced users, and may soft-brick your device. Please do not forget to make a backup of original router partitions before performing any actions with the router.

1. Open the router case and connect the UART adapter to the router.

Opening the router case

Remove the sticker/label on the bottom of the device to reveal two screws (it might be a good idea to use a hot air from a hair dryer to soften the glue under the sticker/label). Unscrew these two screws and use a plastic spudger or pry-tool in order to remove the top cover.

UART adapter: CH340G-2

I used USB – UART RS232 TTL CH340G-2 adapter (this), and UART 4 pin strip (this).

Connection of UART adapter to the router

UART pins: insert the UART 4 pin strip into the router's UART slot (no soldering required):

:information_source: Important:

  • set the jumper on the UART adapter to operate at 3.3V.
  • the RX pin on the router shall be connected to the TX pin on the UART adapter.
  • the TX pin on the router shall be connected to the RX pin on the UART adapter.
  • the GND pin on the router shall be connected to the GND pin on the UART adapter.

2. Insert UART adapter into the USB port of your PC, open and configure PuTTY, and then plug in the power adapter of the router. You should start receiving uart-log output from the router, which will be displayed in PuTTY.

PuTTY configuration

Check the COM port to which your UART adapter is assigned in the operating system. For example, if it's assigned to COM5 according to Device Manager, then:
Open PuTTY => select "Connection type:" Serial => change Serial Line from COM1 to COM5 => set "Speed" to value 115200 => click "Open" button. PuTTY is now configured and waiting to receive information once the router is turned on.

Receiving information from the router through UART.

3. Close PuTTY and power off the router.
4. Download software for router flashing and prepare it. Also, Plug the Ethernet cable into one of the middle ports of the router (2nd or 3rd port on the router), and then connect the other end of the Ethernet cable to your PC. Disable the Windows firewall.

software list

5. Start Windows Command Prompt console. In the console, navigate to the folder containing the unzipped 'mtk_uartboot.exe' file. Then, execute the following command (* before executing the command below, ensure that you replace the COM port number in the command below with the port number assigned by your operating system, which you detected in step 2.):

mtk_uartboot -s COM5 --payload bl2-mt7981-bga-ddr3-ram.bin --aarch64 --fip openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-bl31-uboot.fip && putty.exe -serial COM5 -sercfg 115200,8,n,1,N

6. As soon as the "Handshake..." text appears in the windows command prompt console, turn on the power adapter on the router. If router successfully processes the 'mtk_uartboot' loading, additional information will appear in the Windows console. Following that, a new window with PuTTY will automatically appear, attempting to retrieve the 'openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb' file. (note: if an infinite loop ending with the message "NOTICE: Hello BL31!!!" appears in PuTTY, power off the router and start from step 5 again. Sometimes you may need to repeat it 6-10 times before the router attempts to retrieve the 'itb' file, instead of the loop ending with the 'NOTICE: Hello BL31!!!' message).

Windows console output with 'mtk_uartboot' loading, and PuTTY console output with attempts to retrieve the 'itb' file.

7. Double click on "tftpd64.exe" to start TFTP server, and select the Server Interface 192.168.1.1 in tftpd64. It should allow the 'openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-ubootmod-initramfs-recovery.itb' file to be transferred into the router's RAM, enabling OpenWrt to load from RAM (which will be displayed in PuTTY).

PuTTY output log with initramfs-recovery.itb loading
#################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###
         1.2 MiB/s
done
Bytes transferred = 7667712 (750000 hex)
## Loading kernel from FIT Image at 46000000 ...
   Using 'config-1' configuration
   Trying 'kernel-1' kernel subimage
     Description:  ARM64 OpenWrt Linux-6.6.29
......
......
......
BusyBox v1.36.1 (2024-05-05 09:27:18 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r26181-d1504a1e76
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/# 

8. Once OpenWrt from 'initramfs-recovery.itb' is loaded, open WinSCP tool, login to 192.168.1.1, and upload the 'openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi' file to the router's /tmp folder.

WinSCP configuration

Open WinSCP => select "Tabs", "New Tab" => "New Site" => select File Protocol: SCP => Host name: 192.168.1.1 => Port number: 22 => User name: root => click "Login" button.

9. In PuTTY, enter the following command:

ubidetach -p /dev/mtd8

After mtd8 is detached, enter the following command:

ubiformat /dev/mtd8 -y -f /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-initramfs-factory.ubi

After successfully completing the ubiformat, reboot the router by entering reboot. It should boot to the OpenWrt initramfs system now.

10. As soon as OpenWrt is reloaded, open WinSCP tool, login to 192.168.1.1, and upload the 'openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-squashfs-sysupgrade.bin' file to the router's /tmp folder.

11. In PuTTY, enter the following command:

sysupgrade -n /tmp/openwrt-mediatek-filogic-xiaomi_mi-router-ax3000t-squashfs-sysupgrade.bin

After successfully completing the sysupgrade, reboot the router by entering reboot.

12. As soon as OpenWrt is reloaded, enter the following commands in PuTTY:

fw_setenv boot_wait on
fw_setenv uart_en 1
fw_setenv ssh_en 1
fw_setenv boot_fw1 "run boot_rd_img;bootm"
fw_setenv flag_boot_rootfs 0
fw_setenv flag_last_success 1
fw_setenv flag_boot_success 1
fw_setenv flag_try_sys1_failed 0

13. Enter one more command in PuTTY that will reset flag_try_sys1_failed to always be equal to 0 (without this command, OpenWrt will be restored to default settings after 6 reboots, so it's worth adding it even after future clean OpenWrt sysupgrade installations).

sed -i '/exit 0/i fw_setenv flag_try_sys1_failed 0' /etc/rc.local

check that the flags from step 12 in fw_printenv are set correctly by entering the following command:

fw_printenv

If everything looks fine, reboot the router by entering reboot.

14. As soon as OpenWrt is reloaded, double-check once again that the value of flag_try_sys1_failed remains at value 0. Then, connect the internet cable to the WAN port of the router.
Congratulations, your router is now running under OpenWrt firmware!

15. Optional step (only if Snapshot of OpenWrt is installed).

enable wi-fi and install Luci

enable wi-fi from console:

uci set wireless.radio1.country='EU'
uci set wireless.radio1.disabled='0'
uci commit wireless
wifi reload

install Luci from console:

opkg update && opkg install luci

Now, you can open the OpenWrt web interface of the router by entering 192.168.1.1 in the browser's address bar.


:warning: Please pay attention that at the current moment (May 2024), Xiaomi has not published the original firmware version 1.0.31 for the international version of AX3000T RD23 model. So, restoring to the original Xiaomi firmware from OpenWrt might only be possible after the official firmware becomes available for download.
Also, the OpenWrt installation steps above were performed with keeping the default layout. Changing the layout to OpenWrt U-Boot has not been covered in this guide, and has not been tested.

18 Likes