Adding OpenWrt support for Xiaomi "Redmi Router AX6S"/"Xiaomi Router AX3200"

Come on, there's 2000+ posts on this thread and recent posts are still debating best practices. I've made these notes - are they correct, or not?

  1. Use the XMIR Patcher to perform the standard install. Apparently it may be required to sidegrade to a beta version of the stock firmware to enable Telnet which will allow the XMIR patcher to function

  2. Once you have installed 24.10 factory, run the following command:

  3. Run the following commands via SSH:

  1. uci set system.@system[0].compat_version="2.0"
  2. nvram set ssh_en=1
  3. nvram set uart_en=1
  4. nvram set boot_wait=on
  5. nvram set flag_boot_success=1
  6. nvram set flag_try_sys1_failed=8
  7. nvram set flag_try_sys2_failed=8
  8. nvram commit

Reboot 7 times and see if a brick occurs.

Instead of nvram use fw_setenv.

OK, I finally got around to testing this last night. 20+ reboots and no issues. Here are my install notes:

  1. Assuming you are using a vulnerable stock firmware (such as 1.0.57), you can use the XMIR Patcher to perform the standard install. Simply add the OpenWrt factory install bin file to the “firmware” folder and run the .bat file. All you need to do is connect to the router and install firmware via XMIR Patcher, the other options are not needed.
  2. Once you have installed the OpenWrt factory install image, log in and ensure you have a working WAN connection (e.g. via WAN ethernet or Wi-Fi client)
  3. IMPORTANT: Connect to your router via SSH and run the following commands. These ensure that the router will not brick itself after 6 reboots:

uci set system.@system[0].compat_version="2.0" && opkg update && opkg install kmod-mtd-rw

insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1 && fw_setenv boot_fw1 "run boot_rd_img;bootm" && fw_setenv flag_try_sys1_failed 8 && fw_setenv flag_try_sys2_failed 8 && fw_setenv flag_boot_rootfs 0 && fw_setenv flag_boot_success 1 && fw_setenv flag_last_success 1

  1. Once rebooted, you should be done. Feel free to check your flags via the "fw_printenv", and make sure that “flag_try_sys1_failed=8”. This will ensure that your router will not brick itself. Done!
3 Likes

Just wanted to confirm, what are the steps for those of us currently 23.05.5, is it safe to force upgrade to 24.10.1?

No, do not use force upgrade from 23.05.x to 24.10.x. It will brick your router. You need to follow the instructions below:

But in summary, open an ssh connection to your router and execute the commands below:

cd /tmp
wget -O factory.bin https://downloads.openwrt.org/releases/24.10.1/targets/mediatek/mt7622/openwrt-24.10.1-mediatek-mt7622-xiaomi_redmi-router-ax6s-factory.bin
mount -o remount,ro /
mount -o remount,ro /overlay
cd /tmp
dd if=factory.bin bs=1M count=4 | mtd write - kernel
dd if=factory.bin bs=1M skip=4 | mtd -r write - ubi

After you reboot, edit the file /etc/config/system and change compat_version as follows:

option compat_version '2.0'

After you do this, going forward you will be able to upgrade from 24.10.1 to to future 24.10.2 and later releases normally.

6 Likes

Thank you for the help, worked great and it already had "option compat_version '2.0'" set. Not sure why I can't get 5Ghz/radio1 working, will keep trying.

Edit:
Nevermind, had to set the country code it looks like.

1 Like

I have "OpenWrt SNAPSHOT, r28821-9fb44638ba" and I have no idea what release it is, what main version is this or whatever, I got it like this.

does not work for me:

root@konnichiwa:~# cd /tmp
root@konnichiwa:/tmp# wget -O factory.bin https://downloads.openwrt.org/snapshots/targets/mediatek/mt7622/openwrt-mediat
ek-mt7622-xiaomi_redmi-router-ax6s-factory.bin
--2025-05-04 18:02:19--  https://downloads.openwrt.org/snapshots/targets/mediatek/mt7622/openwrt-mediatek-mt7622-xiaomi_redmi-router-ax6s-factory.bin
Resolving downloads.openwrt.org... 2a04:4e42::644, 2a04:4e42:600::644, 2a04:4e42:200::644, ...
Connecting to downloads.openwrt.org|2a04:4e42::644|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12582912 (12M) [application/octet-stream]
Saving to: 'factory.bin'

factory.bin                   100%[=================================================>]  12.00M  12.8MB/s    in 0.9s

2025-05-04 18:02:21 (12.8 MB/s) - 'factory.bin' saved [12582912/12582912]

root@konnichiwa:/tmp# mount -o remount,ro /
root@konnichiwa:/tmp# mount -o remount,ro /overlay
root@konnichiwa:/tmp# dd if=factory.bin bs=1M count=4 | mtd write - kernel
Could not open mtd device: kernel
Can't open device for writing!

Update: I couldn't find a way to check if the partition layout is already corrected or not. mtd failed every time I tried flashing as described. I found a post somewhere with a similar snapshot version/commit/whatever to mine that indicated it should be 24.10 so I just manually modified compat version to 2.0 from 1.0 then flashed sysupgrade file and now it works.

Thanks, I made it, just the compat_version was already there

1 Like

What is the correct procedure to downgrade from 24.10 to 23.05?

And what about all the previous talk regarding setting flag_try_sys1_failed=8 etc?