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

Don't reinvent the wheel. Use xmir-patcher-main. It can flash the 24.X version directly, bypassing all these instructions. Finally, if you want, you can save the bootloader from a working router and install it on a non-working one.

I’ve of course already earlier tried with many firmwares through xmirs patcher (including RC versions of 25.12), with same bad result (that not allows reboot).

Which mtd devs should/could I clone (with dd) from my working device do you say?
And which version of OpenWRT should I be at (after Debrick), when I try to write stuff (do you think is best, and I only get it to work before 24.10 and my working router is already above 24.10)?

And for Info:
Nothing positive happened when I now also tried to the ā€œlayout changeā€ using method 2 with tftp from 23.05.6 (running in memory) to 24.10.5!
And it downloaded the sysupgrade itb file over tftp after I flashed the ubi-loader as the instruction said…

If your router's flash memory is intact, you can create backups either via SSH (described in the wiki) or via Luci. All important settings are located in the "factory" partition. If you have a copy of your router's "factory" partition, you can flash a backup from any router to your router. Even if you physically replace its flash memory with a clean one and restore the factory partition, you'll get a router with the original data from your router, as it was when it was manufactured.

If you are interested, read about the use of UART.

I’ve had these routers since before there was any XMIR, and had to use the serial console way initally (some years ago).
Both of my serial USB cables doesn’t work anymore (Chinese crap!).. and I need to build or buy something new…

Should I follow the ā€œFlash layout running OpenWRT (22.03-SNAPSHOT)ā€ from the documentation?
Is it anything else to think of about these parts of the flash (except the factory partition), and the order to write to them?

I’ll debrick my bad router again, and try the latest version of OpenWRT, I could get up and running, then I will compare them with: cat /proc/mtd

WITHOUT PRELIMINARY PREPARATION, no higher than 23.X

If you didn't read carefully, or didn't do something from this on the bootloader of that router, it's dying.

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
reboot

fw_setenv flag_try_sys1_failed 8
fw_setenv flag_try_sys2_failed 8

If you don't do this, then on the 6th reboot - a corpse!

If anything, it's

SSH

I did a Rebrick and flashed 24.05.1 through Xmir.
Executed your suggestion of fw_setenv and reboot commands…
Back to square one (of course).
There is something else that fails the boot up (wish I had the serial console)!

I’ll Rebrick and start to clone partions instead (with 24.05.1 running first, non rebootable).

Ok, I’ve following differing partions copied from the working router to /tmp on the problem router:
mtd3_clone.bin "u-boot-env"
mtd4_clone.bin "bdata"
mtd5_clone.bin ā€œfactory"
mtd8_clone.bin "ubi-loader"
mtd9_clone.bin "ubi"
And done backup of all ā€œpartionsā€ form both on my PC.

Should I then try to do following:
mtd write /tmp/mtd3_clone.bin u-boot-env
mtd write /tmp/mtd8_clone.bin ubi-loader
mtd write /tmp/mtd9_clone.bin ubi
I.e all ones that differs except factory and bdata, and in which order?
And maybe with -r (reboot) on last one?

I have serious doubts of your ability to follow simple instructions. I ask you one thing you do totally another. I tell you not to flash random partitions, you tell me "maybe I should do that"... What the hell? Just use xmir-patcher, you already have it! Take the latest stable firmware, put it in firmware folder and flash it. End of the story.

1 Like

I don’t want have a ā€œwarā€ here…
But when you don’t READ what I write (about what I’ve already done and tried… including trying flashing different firmwares through xmir and with different preparations of the environment, I’m not stupid and have sacrified many more hours on this, than is healthy)
I had of course already tested ALL combinations described in this thread and everything described in the OpenWRT page and all github pages I found about this router.

Last thing I tested was backing up all mtd partitions with nanddump from my working AX6, compared them with corresponding on my ā€œhostileā€ one, and tried to clone mtd 3, 8 and 9.
But I had errors when trying to write to mtd9/ā€ubiā€ with mtd…. (and could not work with this 24/7)
If I’m lucky, I would be able to debrick it again and flash with some version of OpenWRT, which hopefully not ā€œborksā€ after a reboot.
Otherwise I have to wait for some stuff from China, and fix an USB Serial Console (again), where I hopefully could see, what it gets stuck with.

I’ll report here later, if I get it to work (again, without reboot problems)

Can you grab a screecast so we can be sure of what you do? If you have it debricked, can you show dmesg output after having mtd errors?

mtd write [e]Failed to get erase block status

… I don’t have the router connected now, I’ll try once more later tonight (to see if it was a step forward or not).
But I beleive more and more, that I need to have the serial console to fetch info from.

If you have hardware problem with flash memory... well, cable will be of little help. You can see this kind of errors in dmesg output. Memory chip itself has self-reporting about bad blocks.

What is the normal behavior of these flags?

I have

flag_try_sys1_failed=10, then 11, … increases by 1 after each reboot.

flag_try_sys2_failed=8 - this always equals 8.

flag_try_sys2_failed=8 - you just never boot to second partition. No boot, no fail - no counter increased.

1 Like

For those who might be interested in testing 25.12.0-rc5: regular sysupgrade image worked without problems.

1 Like

anyone has achieved to bond 2 interfaces with lacp and receive more than 1gbit of data?

I have at the other side which is connected to ax6s, one mikrotik rb5009ug+s+ which is really capable of doing this.

Tried many combinations but with iperf3 i only receive about 940 mbits

You have one 2.5Gbit CPU port. What are you trying to milk of it? Bond 2x1Gbit connections and pump it where, /dev/null? That's beyond hardware capabilities. Find something with 2 CPU ports or 10Gbit class.

1 Like

Latest 25.12.0 image flashes via sysupgrade without problems.

1 Like