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

No problem and Iā€˜m using it now.

You forgot to add the 22.03.0 download links.

1 Like

Thanks. I also forgot to edit the AX6S tech data as well. (Since they're basically identical...)

1 Like

MTK and mt76 drivers do not conflict. MTK has priority for some reason. Nothing need to be changed in stock environment.
Install MTK to use MTK. Remove MTK to use mt76.
/etc/modules.d/ can be used for drivers management.

after doing stupid things i bricked the router, i recovered with official image, i m able to boot initram via dnsmasq but nothing can be flashed no factory no sysupgrade.
any advice?

Erasing NAND...
[mtk_nand_erase_hw] mtk_nand_erase_hw @4249, ret:0x40. page:0x280 
Erasing at 0x140000 -- 100% complete.
Writing to NAND... OK
Booting System 1

NAND read: device 0 offset 0x20c0000, size 0x2000
 8192 bytes read: OK
[do_read_image_blks] Image format error,neither FIT image nor old image.
Bad Magic Number.

NAND read: device 0 offset 0x20c0000, size 0x0
 0 bytes read: OK
bootm flag=0, states=70f
Wrong Image Format for bootm command
ERROR: can't get kernel image!

dev:    size   erasesize  name
mtd0: 00080000 00020000 "Preloader"
mtd1: 00040000 00020000 "ATF"
mtd2: 00080000 00020000 "u-boot"
mtd3: 00040000 00020000 "u-boot-env"
mtd4: 00040000 00020000 "bdata"
mtd5: 00080000 00020000 "factory"
mtd6: 00040000 00020000 "crash"
mtd7: 00040000 00020000 "crash_log"
mtd8: 00400000 00020000 "kernel"
mtd9: 06f00000 00020000 "ubi"

how fix that?

edit fixed .

I ask the owners of RB01 devices to check this method: Add OpenWrt support for Xiaomi "Redmi AX6000" - #132 by remittor

This will not work on RB03 device!!!

I noticed this place back in December 2021, but for some reason I thought that this code was never executed.

2 Likes

Hi! I upgraded yesterday my AX3200 RB01 from RC6 to OpenWrt 22.03.0 stable. No issues so far.

While checking kernel and system logs I pleasantly noticed the ethernet uplink speed to my ISP router was 2.5 Gbps.
To make sure I installed ethtool and confirmed it. I have no other multi gigabit device so I was not able to perform real speed tests to check this superb feature but it puzzles me that it isn't advertised in Xiaomi documentation (at least I haven't found anything). Can anybody confirm this is a 2.5 Gbps ehernet capable router?

Thanks

 OpenWrt 22.03.0, r19685-512e76967f
 -----------------------------------------------------
root@AX3200:~# ethtool eth0
Settings for eth0:
        Supported ports: [ MII ]
        Supported link modes:   2500baseX/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  2500baseX/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  2500baseX/Full
        Link partner advertised pause frame use: Symmetric
        Link partner advertised auto-negotiation: No
        Link partner advertised FEC modes: Not reported
        Speed: 2500Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
        Link detected: yes

It's not. I believe that's just the RGMII between the switch and the CPU.

1 Like

I think you're right. eth0 is the internal interface. What a pity :frowning: . Thanks for your quick reply!

Do you guys manage to use 160Mhz on any channel other than 100? it simply won't start radio1 on any other DFS channel..
The reason I want to change channel is that I started getting radar detections on that channel and radio1 dies and needs to be restarted every time. (maybe because it has only 1 available channel)

Mine will only startup on 36, as that's the only place where it can legally for my locale.

That may not be possible based on your region. In addition, it drops down to 2x2 when in 160mhz. I imagine you could lose throughput with many clients because of mu-mimo groups and the such.

I actually get much better results on 160Mhz, but I rather have a stable wifi instead. shouldn't the driver wait for the radar detection event to end and restore the channel connection in case only 1 channel available? killing the AP entirely looks like a bug

I just installed OpenWrt on my AX6S, but getting issue when device connect to Wireless
the device didn't get any dhcp IP, I should edit bridge LAN (re-adding WLAN port to this bridge)

error log below

Sun Sep 11 11:40:44 2022 daemon.notice hostapd: wlan1: ACS-COMPLETED freq=5260 channel=52
Sun Sep 11 11:40:44 2022 daemon.notice hostapd: wlan1: interface state ACS->HT_SCAN
Sun Sep 11 11:40:44 2022 daemon.err odhcpd[1813]: Failed to send to ff02::1%lan@br-lan (Address not available)
Sun Sep 11 11:40:45 2022 daemon.notice netifd: Network device 'wlan1' link is up
Sun Sep 11 11:40:45 2022 daemon.notice netifd: Interface 'wlan1' has link connectivity
Sun Sep 11 11:40:45 2022 kern.info kernel: [   25.201863] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
Sun Sep 11 11:40:45 2022 daemon.notice hostapd: wlan1: interface state HT_SCAN->ENABLED
Sun Sep 11 11:40:45 2022 daemon.notice hostapd: wlan1: AP-ENABLED
Sun Sep 11 11:40:46 2022 daemon.err odhcpd[1813]: Failed to send to ff02::1%lan@br-lan (Address not available)
Sun Sep 11 11:40:53 2022 daemon.info hostapd: wlan0: STA 62:7d:f9:c2:f5:29 IEEE 802.11: authenticated
Sun Sep 11 11:40:53 2022 daemon.info hostapd: wlan0: STA 62:7d:f9:c2:f5:29 IEEE 802.11: associated (aid 1)
Sun Sep 11 11:40:53 2022 daemon.notice hostapd: wlan0: AP-STA-CONNECTED 62:7d:f9:c2:f5:29
Sun Sep 11 11:40:53 2022 daemon.info hostapd: wlan0: STA 62:7d:f9:c2:f5:29 RADIUS: starting accounting session E46669CA08095D89
Sun Sep 11 11:40:53 2022 daemon.info hostapd: wlan0: STA 62:7d:f9:c2:f5:29 WPA: pairwise key handshake completed (RSN)
Sun Sep 11 11:40:53 2022 daemon.notice hostapd: wlan0: EAPOL-4WAY-HS-COMPLETED 62:7d:f9:c2:f5:29
Sun Sep 11 11:40:53 2022 daemon.warn dnsmasq-dhcp[1]: DHCP packet received on wlan0 which has no address
Sun Sep 11 11:40:54 2022 daemon.warn dnsmasq-dhcp[1]: DHCP packet received on wlan0 which has no address
Sun Sep 11 11:40:56 2022 daemon.warn dnsmasq-dhcp[1]: DHCP packet received on wlan0 which has no address
Sun Sep 11 11:41:00 2022 daemon.warn dnsmasq-dhcp[1]: DHCP packet received on wlan0 which has no address
Sun Sep 11 11:41:02 2022 daemon.err odhcpd[1813]: Failed to send to ff02::1%lan@br-lan (Address not available)
Sun Sep 11 11:41:02 2022 daemon.warn dnsmasq-dhcp[1]: DHCP packet received on wlan0 which has no address
Sun Sep 11 11:41:03 2022 daemon.warn dnsmasq-dhcp[1]: DHCP packet received on wlan0 which has no address
Sun Sep 11 11:41:05 2022 daemon.warn dnsmasq-dhcp[1]: DHCP packet received on wlan0 which has no address
Sun Sep 11 11:41:09 2022 daemon.warn dnsmasq-dhcp[1]: DHCP packet received on wlan0 which has no address
Sun Sep 11 11:41:18 2022 daemon.err odhcpd[1813]: Failed to send to ff02::1%lan@br-lan (Address not available)

Hmm, is implicit beamforming not enabled for 11ac clients right now?

root@Old-Sharlayan:~# cat /sys/kernel/debug/ieee80211/phy1/mt76/implicit_txbf
0

That, and it looks like you would need to set it before bringing the phy up unless you pulled this in.

https://patchwork.kernel.org/project/linux-wireless/patch/20220818024407.4778-1-howard-yh.hsu@mediatek.com/

I may have to perform some throughput testing with old phones behind a few walls...

(Obviously you'd get roughly the same performance with clients that are eBF capable, but I believe it required client support for feedback. Again, it's mandatory for 11ax so don't worry about those.)

2 Likes
Sun Sep 11 05:40:54 2022 daemon.err odhcpd[1769]: Failed to send to ff02::1%lan@br-lan (Bad file descriptor)
Sun Sep 11 05:41:10 2022 daemon.err odhcpd[1769]: Failed to send to ff02::1%lan@br-lan (Bad file descriptor)

Sun Sep 11 07:16:00 2022 daemon.notice netifd: Network device 'wan' link is up
Sun Sep 11 07:16:00 2022 daemon.notice netifd: Interface 'wan' has link connectivity
Sun Sep 11 07:16:00 2022 daemon.notice netifd: Interface 'wan' is setting up now
Sun Sep 11 07:16:00 2022 daemon.notice netifd: Interface 'wan6' has link connectivity
Sun Sep 11 07:16:00 2022 daemon.notice netifd: Interface 'wan6' is setting up now
Sun Sep 11 07:16:00 2022 kern.info kernel: [52972.102362] mt7530 mdio-bus:00 wan: Link is Up - 1Gbps/Full - flow control rx/tx
Sun Sep 11 07:16:00 2022 daemon.notice netifd: wan (5950): udhcpc: started, v1.35.0
Sun Sep 11 07:16:00 2022 daemon.notice netifd: wan (5950): udhcpc: broadcasting discover
Sun Sep 11 07:16:04 2022 daemon.notice netifd: wan (5950): udhcpc: broadcasting discover
Sun Sep 11 07:16:07 2022 daemon.notice netifd: wan (5950): udhcpc: broadcasting discover
Sun Sep 11 07:17:21 2022 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 66:3d:49:bd:b9:2e
Sun Sep 11 07:17:21 2022 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.176 66:3d:49:bd:b9:2e
Sun Sep 11 07:17:21 2022 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 66:3d:49:bd:b9:2e
Sun Sep 11 07:17:21 2022 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.176 66:3d:49:bd:b9:2e
Sun Sep 11 07:17:57 2022 kern.err kernel: [53088.923777] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
Sun Sep 11 07:17:57 2022 kern.info kernel: [53088.930279] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
Sun Sep 11 07:17:57 2022 kern.info kernel: [53088.959682] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
Sun Sep 11 07:17:57 2022 kern.info kernel: [53088.968400] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
Sun Sep 11 07:19:16 2022 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 66:3d:49:bd:b9:2e
Sun Sep 11 07:19:16 2022 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.176 66:3d:49:bd:b9:2e
Sun Sep 11 07:19:16 2022 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 66:3d:49:bd:b9:2e
Sun Sep 11 07:19:16 2022 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.176 66:3d:49:bd:b9:2e
Sun Sep 11 07:19:18 2022 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.1.176 66:3d:49:bd:b9:2e
Sun Sep 11 07:19:18 2022 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.1.176 66:3d:49:bd:b9:2e
Sun Sep 11 07:19:32 2022 kern.err kernel: [53183.963534] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
Sun Sep 11 07:19:32 2022 kern.info kernel: [53183.970068] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
Sun Sep 11 07:19:32 2022 kern.info kernel: [53183.999443] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
Sun Sep 11 07:19:32 2022 kern.info kernel: [53184.007746] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
Sun Sep 11 07:21:28 2022 daemon.notice hostapd: wlan0: AP-STA-DISCONNECTED 66:3d:49:bd:b9:2e
Sun Sep 11 07:21:28 2022 daemon.info hostapd: wlan0: STA 66:3d:49:bd:b9:2e IEEE 802.11: disassociated
Sun Sep 11 07:21:29 2022 daemon.info hostapd: wlan0: STA 66:3d:49:bd:b9:2e IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
Sun Sep 11 07:21:32 2022 kern.err kernel: [53303.963246] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
Sun Sep 11 07:21:32 2022 kern.info kernel: [53303.969761] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
Sun Sep 11 07:21:32 2022 kern.info kernel: [53303.999268] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
Sun Sep 11 07:21:32 2022 kern.info kernel: [53304.007582] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
Sun Sep 11 07:22:37 2022 kern.err kernel: [53369.003050] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
Sun Sep 11 07:22:37 2022 kern.info kernel: [53369.009274] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
Sun Sep 11 07:22:37 2022 kern.info kernel: [53369.039034] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
Sun Sep 11 07:22:37 2022 kern.info kernel: [53369.047344] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
Sun Sep 11 07:26:07 2022 kern.err kernel: [53579.002509] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
Sun Sep 11 07:26:07 2022 kern.info kernel: [53579.008732] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
Sun Sep 11 07:26:07 2022 kern.info kernel: [53579.038482] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
Sun Sep 11 07:26:07 2022 kern.info kernel: [53579.047244] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
Sun Sep 11 07:28:39 2022 daemon.info dnsmasq-dhcp[1]: DHCPDISCOVER(br-lan) 52:6f:e3:ce:8d:7c
Sun Sep 11 07:28:39 2022 daemon.info dnsmasq-dhcp[1]: DHCPOFFER(br-lan) 192.168.1.219 52:6f:e3:ce:8d:7c
Sun Sep 11 07:28:40 2022 daemon.info dnsmasq-dhcp[1]: DHCPREQUEST(br-lan) 192.168.1.219 52:6f:e3:ce:8d:7c
Sun Sep 11 07:28:40 2022 daemon.info dnsmasq-dhcp[1]: DHCPACK(br-lan) 192.168.1.219 52:6f:e3:ce:8d:7c
Sun Sep 11 07:28:47 2022 kern.err kernel: [53738.922104] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
Sun Sep 11 07:28:47 2022 kern.info kernel: [53738.928447] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
Sun Sep 11 07:28:47 2022 kern.info kernel: [53738.957853] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
Sun Sep 11 07:28:47 2022 kern.info kernel: [53738.966233] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
Sun Sep 11 07:31:22 2022 kern.err kernel: [53893.961706] mtk_soc_eth 1b100000.ethernet eth0: transmit timed out
Sun Sep 11 07:31:22 2022 kern.info kernel: [53893.967924] mtk_soc_eth 1b100000.ethernet eth0: Link is Down
Sun Sep 11 07:31:22 2022 kern.info kernel: [53893.997351] mtk_soc_eth 1b100000.ethernet eth0: configuring for fixed/2500base-x link mode
Sun Sep 11 07:31:22 2022 kern.info kernel: [53894.005663] mtk_soc_eth 1b100000.ethernet eth0: Link is Up - 2.5Gbps/Full - flow control rx/tx
Sun Sep 11 07:32:49 2022 user.info : luci: accepted login on / for root from 192.168.1.133

devices get connected to router, but the router cannot provide internet, i am able to access admin page, but need to restart the router to get internet access, on the latest stable version.
Screenshot from 2022-09-11 13-03-03

anyone facing the same issue?
or did anyone find a solution?

On what type of devices do you encounter this issue ? Android devices ?

i encounter this issue on windows,android,and linux machines too, i have to restart the router, and works for some time and bam, not able to provide internet again. this router is connected to other router for getting internet relayed.internet comes to my huawei router via rj45,my mi router is connected to the huawei router for internet, wifi works fine on my huawei router, and most of the times mi router goes to this mode, any logs which can help why this is happening?

Has anyone attempted this exploit on their device?

This exploit will not work on RB03, because there is an additional check for the region:

function setSysTime(time, tzone, index)
    local ccode = XQCountryCode.getCurrentCountryCode()
    local tz = nil
    if TIME_ZONE[tzone] then
        tz = TIME_ZONE[tzone][index + 1]
    end
    if "CN" ~= ccode then
        tz = tzone
    end
    
    if tz and not XQFunction.isStrNil(tzone) then
        .... 
        local isMeshCap = XQFunction.isMeshCap()
        if isMeshCap then
            ...
            XQFunction.forkExec("/sbin/whc_to_re_common_api.sh action \'" .. j_msg .. "\'")
        end
    end
end

But on router RB01, this exploit can work, but you must set whc_cap mode.
I do not know how to achieve this, since I do not have a second device that supports the Xiaomi-Mesh.

P.S.: Device RB06 is in whc_cap mode by default. I even found a place in the code where this is set.

2 Likes

Can someone help me figure out how I can give my router internet access so that I can download packages etc?

Currently I have setup with 2 vlan on the AX6S and Wifi for different vlan. No WAN port. All ports have been group into brlan. The vlan and internet is managed on firewalla. There is another management vlan, vlan 1 on firewalla. Any help would be appreciated. Thanks.

root@AX6S-2:~# cat /etc/config/network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fdf9:4f9e:92fc::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'wan'

config interface 'lan'
        option device 'br-lan'
        option proto 'none'

config bridge-vlan
        option device 'br-lan'
        option vlan '8'
        list ports 'lan2:t'
        list ports 'wan:t'

config bridge-vlan
        option device 'br-lan'
        option vlan '99'
        list ports 'lan1'
        list ports 'lan2:t'
        list ports 'lan3'
        list ports 'wan:t'

config interface 'securelan'
        option device 'br-lan.8'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.8.2'
        option netmask '255.255.255.0'
        option gateway '192.168.8.1'

config interface 'iot'
        option proto 'static'
        option device 'br-lan.99'
        option ipaddr '192.168.99.2'
        option netmask '255.255.255.0'
        option gateway '192.168.99.1'

config interface 'wan'
        option proto 'dhcp'
        option auto '0'

config interface 'wan6'
        option proto 'dhcpv6'
        option auto '0'
        option reqaddress 'try'
        option reqprefix 'auto'

root@AX6S-2:~# cat /etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/18000000.wmac'
        option band '2g'
        option htmode 'HT20'
        option cell_density '0'
        option country 'AU'
        option channel '1'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option mode 'ap'
        option ssid 'WiFi2'
        option key 'xxx'
        option network 'iot'
        option max_inactivity '3600'
        option disassoc_low_ack '0'
        option ieee80211w '0'
        option encryption 'psk2'
        option wmm '0'

config wifi-device 'radio1'
        option type 'mac80211'
        option path '1a143000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
        option band '5g'
        option cell_density '0'
        option channel '36'
        option txpower '23'
        option htmode 'HE80'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option mode 'ap'
        option key 'xxx'
        option network 'securelan'
        option ssid 'Wifi1'
        option encryption 'psk2+ccmp'

config wifi-iface 'wifinet2'
        option device 'radio1'
        option mode 'ap'
        option ssid 'WiFi2'
        option key 'xxx'
        option network 'iot'
        option hidden '1'
        option encryption 'psk2+ccmp'

config wifi-iface 'wifinet3'
        option device 'radio0'
        option mode 'ap'
        option ssid 'Wifi3'
        option key 'xxx'
        option network 'securelan'
        option encryption 'psk2+ccmp'