Add OpenWrt support for Xiaomi "Redmi AX6000"

Looks great! As the former layout has been dropped in the latest patch of the OpenWrt tree, I’ll be migrating the only remaining device I have with it ASAP.

Has anyone seen spontaneous connectivity loss on this (Redmi AX6000) hardware?

This coincidentally happened for the first time ever after changing the partition scheme. All all wireless clients were dropped and could not reconnect. When I tried to reconnect on an iPhone for example, iOS gave the non-descriptive, "cannot join this network."

When I look at dmesg on the AX6000, I found this:

[19682.404478] mt7986-wmac 18000000.wmac: Message 00005aed (seq 6) timeout
[19702.884459] mt7986-wmac 18000000.wmac: Message 00005aed (seq 7) timeout
[19723.364467] mt7986-wmac 18000000.wmac: Message 00005aed (seq 8) timeout
[19743.844461] mt7986-wmac 18000000.wmac: Message 000026ed (seq 9) timeout
[19764.324459] mt7986-wmac 18000000.wmac: Message 00005aed (seq 10) timeout
[19784.804459] mt7986-wmac 18000000.wmac: Message 00005aed (seq 11) timeout
[19805.284462] mt7986-wmac 18000000.wmac: Message 00005aed (seq 12) timeout
[19825.764459] mt7986-wmac 18000000.wmac: Message 000026ed (seq 13) timeout
[19846.244462] mt7986-wmac 18000000.wmac: Message 00005aed (seq 14) timeout
[19866.724461] mt7986-wmac 18000000.wmac: Message 00005aed (seq 15) timeout
[19887.204462] mt7986-wmac 18000000.wmac: Message 00005aed (seq 1) timeout
[19907.684460] mt7986-wmac 18000000.wmac: Message 000026ed (seq 2) timeout
[19928.164462] mt7986-wmac 18000000.wmac: Message 00005aed (seq 3) timeout
[19948.644458] mt7986-wmac 18000000.wmac: Message 00005aed (seq 4) timeout
[19969.124458] mt7986-wmac 18000000.wmac: Message 00005aed (seq 5) timeout
[19989.604462] mt7986-wmac 18000000.wmac: Message 000026ed (seq 6) timeout
[20010.084462] mt7986-wmac 18000000.wmac: Message 00005aed (seq 7) timeout
[20030.564461] mt7986-wmac 18000000.wmac: Message 00005aed (seq 8) timeout
[20051.044461] mt7986-wmac 18000000.wmac: Message 00005aed (seq 9) timeout
[20071.524459] mt7986-wmac 18000000.wmac: Message 000026ed (seq 10) timeout
[20092.004460] mt7986-wmac 18000000.wmac: Message 00005aed (seq 11) timeout
[20112.484461] mt7986-wmac 18000000.wmac: Message 00005aed (seq 12) timeout
[20132.964459] mt7986-wmac 18000000.wmac: Message 00005aed (seq 13) timeout
[20153.444460] mt7986-wmac 18000000.wmac: Message 000026ed (seq 14) timeout
[20173.924462] mt7986-wmac 18000000.wmac: Message 00005aed (seq 15) timeout
[20194.404460] mt7986-wmac 18000000.wmac: Message 00005aed (seq 1) timeout
[20214.884459] mt7986-wmac 18000000.wmac: Message 00005aed (seq 2) timeout
[20235.364463] mt7986-wmac 18000000.wmac: Message 000026ed (seq 3) timeout
[20255.844461] mt7986-wmac 18000000.wmac: Message 00005aed (seq 4) timeout
[20276.324462] mt7986-wmac 18000000.wmac: Message 000025ed (seq 5) timeout
[20276.331339] phy1-ap2: failed to remove key (0, xx:xx:xx:xx:xx:x) from hardware (-110)

A reboot fixed the issue. Has anyone else experienced this? Again, the device has never done this before.

I have maybe a month or two ago. I never looked at the logs to see what was up because I was in a rush, but all my clients at one point were unable to connect. Reboot also fixed it for me.

I've noticed that some of my clients (an Intel AX210 and 9260) occasionally enter some sort of low Tx mode that requires a ifdown/ifup (on the client) to restore proper throughput. Never had this issue on other APs before installing the AX6000 so it's definitely a quirk of this hardware.

Did you flash this new ubootmod via SSH with OpenWRT already installed or you did this via serial? I flashed OpenWRT originally via UART so wanted to confirm before i attempt with the Step 3 adjustment you mentioned as i will use SSH if possible.

I realize you did not ask this question of me, but following the commit instructions, I did it entirely over ssh.

All good, i have flashed the initramfs image now after building it from OpenWRT on my Ubuntu system via SSH, unfortunately i am stuck at the kmod-mtd-rw module install and loading, i am getting an error

Collected errors:

  • pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.85-1-9548efd7b7ab6663c8f4a0918160b6cb) for kmod-mtd-rw
  • pkg_hash_fetch_best_installation_candidate: Packages for kmod-mtd-rw found, but incompatible with the architectures configured
  • opkg_install_cmd: Cannot install package kmod-mtd-rw.

Do you know if you can include this specific module in make menuconfig options? I couldn't seem to see it.

I built that module into my image since they need to match. Recommend you enable it in your .config and build the image again. Note that I believe you will brick your device if you flash the image, so just build it then copy over the module so you can load it manually. Someone else might have a better suggestion.

That's what i am meaning, i am in the menuconfig now but can't find that specific module under Kernel modules section etc, do you know possibly where in the menuconfig GUI this module is? As i will rebuild the images and packages. Cheers.

Use make nconfig not make menuconfig then hit F8 and search for "kmod-mtd-rw" to find it.

1 Like

Thanks just did this and F8 for search no match for "kmod-mtd-rw" though, i will keep digging.

Sorry away from my home now cannot try. I found it on a search.

1 Like

I have worked it out, i made a rookie error and didn't download the feeds in my build environment and add the package to the menoconfig file. It's now added and the package has been compiled but unfortunately same error

> root@OpenWrt:~# opkg install /tmp/kmod-mtd-rw_5.15.85+git-20160214-2_aarch64_cor
> tex-a53.ipk
> Unknown package 'kmod-mtd-rw'.
> Collected errors:
>  * pkg_hash_check_unresolved: cannot find dependency kernel (= 5.15.85-1-d0825b3f0e4f7b22cdec52d583615147) for kmod-mtd-rw
>  * pkg_hash_fetch_best_installation_candidate: Packages for kmod-mtd-rw found, but incompatible with the architectures configured
>  * opkg_install_cmd: Cannot install package kmod-mtd-rw.

I am noob at all this but i suspect where i went wrong was when i SSH'd into my ubootmod-initfamfs image i ran opkg update && opkg install kmod-mtd-rw as per instructions in PR11565 which has maybe put this completely out of sync.

Is there a way i can reboot into a newly rebuilt initfamfs image which i will ensure has the kmod-mtd-rw package from the current initramfs i have running?

I am up to step 9 where i am flashing the OpenWRT U-Boot but do not want to reboot router as it will surely become bricked.

1 Like

https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/
Current snapshots are there as the code has been merged...

I successfully migrated from the original layout target (not stock) to uboot last night. I somehow got stuck in initramfs recovery but running step 6 again got me up and running. Not sure how I ended up with a log in there...

I've done a bit more digging and I can reproduce the low Tx issue (@160Mhz, channel 100) using my Totolink X5000R (MT7915E) as a WDS client. When I switch to 160Mhz width, the AX6000 reports 6.0 Mbps/20Mhz Tx to the X5000R (other clients are unaffected and the AX6000 reports HE160 Tx/Rx to them, so it appears to be client-specific), and online speed tests report about 3 Mbps download. Upload speeds are fine, Tx on the Totolink and Rx on the AX6000 reports using HE160 and I can get about 20 MB/s upload in the online speed test. Even more strangely, if I do an internal iperf using 160mhz channels, I get an average bitrate of 300 Mbits/sec, which far exceeds the internet speed test, so maybe iperf is kicking it into a higher performance mode while the external speed test does not? When I switch back to 80Mhz channels, iperf averages about 650 Mbps and I can max my internet speed at 400 Mbps download.

So in sum I'm getting half of the Tx performance internally from the AX6000 when using 160mhz channels (vs 80 mhz) and about 1/100 the speed when accessing the internet. Upload speeds are unaffected. So it's definitely a client-specific Tx issue on the AX6000, seemingly unrelated to distance or interference, rather the AX6000 Tx cannot use HE160 w/ this particular client.

Thought this would be an interesting data point since the client is also running mt76.

I do think you should reboot until completing the steps based on the warning in the commit message:

During the whole flash procedure, please do not reboot or power off unless requested explicitly, or you will break your device.

It's been a long time since I did something similar to this... I cannot remember exactly how I got the module to load. Is there a switch you can apply to opkg in order to force things? Alternatively, you can try to manually decompress the ipk which should only contain a single file in data.tar.gz: /lib/modules/5.15.85/mtd-rw.ko ... I think you can place it on the filesystem. You might need to run depmod -a before attempting to load it. As I said, it's been a long time since I messed with this. Maybe someone more experienced can help.

@hnyman @daniel

1 Like

I got there eventually, can't remember exactly what i did, but had to resort to serial UART a couple of times and rebuild firmware from source using new OpenWrt U-Boot layout. Thanks for your help.

Glad you're up and running.

Hey, I am following the thread since its beginning and finally got my ax6000 lately.
Just one question for me to confirm about the partitions layouts:

  1. previously the Openwrt support had a different layout compared to the stock one, therefore Xiaomi's recovery TFTP would not work after installing Openwrt
  2. nowdays, if I'll flash my router from snapshots, it will still keep the stock layout meaning that the xiaomi's TFTP recovery will still work (and no need of UART in case of a soft brick)
  3. after flashing Openwrt with stock layout, there is now a support for Openwrt's U-Boot bootloader that have alternative (and probably better) recovery compared to stock one. this is an optional step that could bring more memory to use, but it would break xiaomi's TFTP recovery (offering a different one instead).

I still want the ability to revert to stock firmware easily, so I wanted to make sure that I can compile Openwrt and flash without affecting the ability to revert to stock firmware.
Can anyone confirm that? Thank you

If you stay with the stock image & layout (you don't change the u-boot), you can go back to stock firmware and even use Xiaomi recovery tools.

1 Like