Add OpenWrt support for Xiaomi "Redmi AX6000"

Sad, one less on my list. Thanks!

Edit: bug that prevents some devices from being accepted on the 5G network still exists on my AX6000. Though it seems to happen less often.

Tested rc3, working proper...

1 Like

Hi all, I am trying to upgrade the firmware on the ax6000 using attended system upgrade but it does not load. When I manually download the image I am getting following error:

Currently running: SNAPSHOT - r23627-dcdcfc1511
Want to upgrade to: 23.05.0-rc3 - r23389-5deed175a5

Has anyone else faced this issue?

Did you select the correct image? E.g. OpenWrt ubootmod vs the vanilla partition image?

I should have ubootmod and that is what I have selected. Is there some place where I can double check I have ubootmod?

Login to luci:

1 Like

Ok, I have U-Boot so the issue have to be somewhere else.

Try a nightly snapshot.

Just flashed two AX6000's to UBootmod using the September 4th nightly build here: https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/

Been running for a few hours now. No issues, everything is working well.

Hi, I updated the SPL and uboot using mtd write, but it seems uboot env variables are not updated, is there a way to update the uboot envs in the ubi0_0 and ubi0_1 as well?

I have tried that, but still the same ... Do you think I should continue even though I get the warning?

Hello everyone,

I have this Redmi AX6000 running the -rc1 version (waiting on final release to upgrade and reinstall everything), and its working great!

I have a NAS connected to it (repurposed old macbook pro with broken screen and removed battery running ubuntu) with a bunch of usb3 disks, but throughput is limited to the single gigabit lan connection (thunderbolt lan adapter).

I was wondering if I could leverage the better wifi speed (and internal 2.5G switch connection) by bonding/aggregating gigabit links between the router and the (ubuntu) nas. Would you think this would be doable, and what I would need to setup? I found some documentation online but it dates back quite a bit so I'm not sure what would be current best-practices. Also I'm not sure if that's a good idea at all (I would not want to bypass some routing hardware acceleration that would be defeated by that, and crush the cpu).

Thanks a lot for any advice!

1 Like

Any advice please?

Can you have a look at the /lib/upgrade/platform.sh, especially line 43, to see what may be different from the regular file?

This is content of my platform.sh

REQUIRE_IMAGE_METADATA=1

xiaomi_initial_setup()
{
        # initialize UBI and setup uboot-env if it's running on initramfs
        [ "$(rootfs_type)" = "tmpfs" ] || return 0

        local mtdnum="$( find_mtd_index ubi )"
        if [ ! "$mtdnum" ]; then
                echo "unable to find mtd partition ubi"
                return 1
        fi

        local kern_mtdnum="$( find_mtd_index ubi_kernel )"
        if [ ! "$kern_mtdnum" ]; then
                echo "unable to find mtd partition ubi_kernel"
                return 1
        fi

        ubidetach -m "$mtdnum"
        ubiformat /dev/mtd$mtdnum -y

        ubidetach -m "$kern_mtdnum"
        ubiformat /dev/mtd$kern_mtdnum -y

        if ! fw_printenv -n flag_try_sys2_failed &>/dev/null; then
                echo "failed to access u-boot-env. skip env setup."
                return 0
        fi

        fw_setenv boot_wait on
        fw_setenv uart_en 1
        fw_setenv flag_boot_rootfs 0
        fw_setenv flag_last_success 1
        fw_setenv flag_boot_success 1
        fw_setenv flag_try_sys1_failed 8
        fw_setenv flag_try_sys2_failed 8

        local board=$(board_name)
        case "$board" in
        xiaomi,mi-router-wr30u-stock)
                fw_setenv mtdparts "nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),2048k(factory),2048k(fip),256k(crash),256k(crash_log),34816k(ubi),34816k(ubi1),32768k(overlay),12288k(data),256k(KF)"
        xiaomi,redmi-router-ax6000-stock)
                fw_setenv mtdparts "nmbm0:1024k(bl2),256k(Nvram),256k(Bdata),2048k(factory),2048k(fip),256k(crash),256k(crash_log),30720k(ubi),30720k(ubi1),51200k(overlay)"
                ;;
        esac
}

platform_do_upgrade() {
        local board=$(board_name)

        case "$board" in
        asus,tuf-ax4200)
                CI_UBIPART="UBI_DEV"
                CI_KERNPART="linux"
                nand_do_upgrade "$1"
                ;;
        bananapi,bpi-r3)
                local rootdev="$(cmdline_get_var root)"
                rootdev="${rootdev##*/}"
                rootdev="${rootdev%p[0-9]*}"
                case "$rootdev" in
                mmc*)
                        CI_ROOTDEV="$rootdev"
                        CI_KERNPART="production"
                        emmc_do_upgrade "$1"
                        ;;
                mtdblock*)
                        PART_NAME="fit"
                        default_do_upgrade "$1"
                        ;;
                ubiblock*)
                        CI_KERNPART="fit"
                        nand_do_upgrade "$1"
                        ;;
                esac
                ;;
        cudy,wr3000-v1)
                default_do_upgrade "$1"
                ;;
        mercusys,mr90x-v1)
                CI_UBIPART="ubi0"
                nand_do_upgrade "$1"
                ;;
        h3c,magic-nx30-pro|\
        qihoo,360t7|\
        tplink,tl-xdr4288|\
        tplink,tl-xdr6086|\
        tplink,tl-xdr6088|\
        xiaomi,mi-router-wr30u-112m-nmbm|\
        xiaomi,mi-router-wr30u-ubootmod|\
        xiaomi,redmi-router-ax6000-ubootmod)
                CI_KERNPART="fit"
                nand_do_upgrade "$1"
                ;;
        xiaomi,mi-router-wr30u-stock|\
        xiaomi,redmi-router-ax6000-stock)
                CI_KERN_UBIPART=ubi_kernel
                CI_ROOT_UBIPART=ubi
                nand_do_upgrade "$1"
                ;;
        *)
                nand_do_upgrade "$1"
                ;;
        esac
}

PART_NAME=firmware

platform_check_image() {
        local board=$(board_name)
        local magic="$(get_magic_long "$1")"

        [ "$#" -gt 1 ] && return 1

        case "$board" in
        bananapi,bpi-r3)
                [ "$magic" != "d00dfeed" ] && {
                        echo "Invalid image type."
                        return 1
                }
                return 0
                ;;
        *)
                nand_do_platform_check "$board" "$1"
                return $?
                ;;
        esac

        return 0
}

platform_copy_config() {
        case "$(board_name)" in
        bananapi,bpi-r3)
                case "$(cmdline_get_var root)" in
                /dev/mmc*)
                        emmc_copy_config
                        ;;
                esac
                ;;
        esac
}

platform_pre_upgrade() {
        local board=$(board_name)

        case "$board" in
        xiaomi,mi-router-wr30u-stock|\
        xiaomi,redmi-router-ax6000-stock)
                xiaomi_initial_setup
                ;;
        esac
}

Here is what I see on line 43:

Looking at the git repo, it seems this section was fixed with a commit https://github.com/openwrt/openwrt/commit/edd146c9202a5ef1195eafeb9e9e51f3de34c229
You might have installed a specific build that had the bug. You might replace the file with the new one and try an update

1 Like

Thanks a lot, that was really it, just added ;; to the file and than I was able tu upgrade.

I have been running an older build with stock layout for a while, with occasional hangs but not too bad, needed a reboot once a week or so.

I recently tried RC3 and the latest nightly. On both builds I keep getting hangs described in this issue:

Has anyone else been getting these hangups? It happens very often, especially during heavy usage, every 30 mins or so.

I'm currently running on RC3 with offloads disabled on eth0, using ethtool:
ethtool -K eth0 tso off gso off gro off rx off tx off txvlan off hw-tc-offload off

Not sure if it's the real fix but it's been 11 hours and so far so good.

Any advice is welcomed!

Mine is been rock solid running snapshots built ever few weeks. In the ~10 months that I have owned this device, I think I experienced 2 or 3 kernel oops that broke the WiFi requiring a reboot. It is been stable otherwise.