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

If anyone want to know, my RB01 has telnet enabled and the production date is 09/2021.
Telnet password calculated from SN is accepted by the router.
Is there any easy steps to flash openwrt by telnet?
On openwrt wiki there is:

3. Execute commands to prepare device

nvram set ssh_en=1
nvram set uart_en=1
nvram set boot_wait=on
nvram set flag_boot_success=1
nvram set flag_try_sys1_failed=0
nvram set flag_try_sys2_failed=0
nvram commit

4. Download and flash image

    On computer:

    python -m http.server

    On router:

    cd /tmp
    wget http://<IP>:8000/factory.bin
    mtd -r write factory.bin firmware

I send commands (instruction n.3) to prepare the router, but instruction n. 4 is not very clear...
Can you help?
Thank you

This would be better if posted under "Installing and Using OpenWrt">"Network and Wireless Configuration," since the question is not related to this topic.

That said, the fix should be simple. Do not make this change on your lan interface. You should only need to do this on wan and wan6 if the device is your gateway.

On wan, uncheck "Use DNS servers advertised by peers" just above network> interfaces> wan> advanced settings> use custom dns; and set the custom DNS to, e.g., 1.1.1.2.

On wan6, uncheck "Use DNS servers advertised by peers" just above network> interfaces> wan6> advanced settings> use custom dns; and set the custom DNS to, e.g., 2606:4700:4700::1112.

You need to download an openwrt image either snapshot/official (no luci/gui or any other packages) or one of the prebuilt binaries that folks have listed in this thread.

Rename the download to factory.bin. In the same folder as the download run python -m http.server. This starts a webserver on port 8000 using the current folder. Login to your router... cd /tmp and then wget http://:8000/factory.bin. Then write the image using the mtd command.

If you do not have python installed, you can secure copy the factory.bin file to the router...
from your PC, scp factory.bin root@192.168.31.1:/tmp/
Then do the mtd -r write factory.bin firmware.

1 Like

For that one person who had the BMT exhausted issue earlier (Presumably they tried to dd an image onto the device or some other raw operation): https://github.com/openwrt/openwrt/commit/2a8a333ee96fb0c8d9875abf9fcd5c412f4b19ae

I imagine that would be much cleaner than blowing away the entire table at the end of nand, but you'd probably have to write your own little script to map out what blocks were remapped first so you can pick out the most obvious section to "repair"

Any updates on 160MHz support? Will it ever work?

That should be wget http://`<IP of your PC`>:8000/factory.bin

1 Like

Thank you @Timbo
Instaled latest snapshot, and had no problems.
Instaled then Luci, and it is working fine.

Hi.
Trying first update: package base-files, but got this error:


Is there any problem with the firmware?
Thank you.

Why would anyone want to waste 160Mhz bandwidth with this device? I can even achieve max out the 1GBit Ethernet connection with 40 MHz. Am I missing something? I haven't even thought about trying.

1 Like

Which package should I install so that the LEDs work? Anyone know which kmod is for these leds?

I can't seem to be able to flash this firmware for some reason (RB03). I managed to flash the closed beta image and booted into it, but any attempt to update the firmware through SSH used aiden_long's binary didn't seem to have any effect. The file transferred without issues using wget, and flashed successfully with mtd. But when rebooting, it still boots into the beta image, SSIDs and everything still configured. What am I missing here?

Hi, I just purchased one AX6S with the goal to install OpenWRT, and while I wait it to be delivered I am taking some time to read this topic.

I have one first question: reading the messages here (and also the OpenWRT website) it seems that I should use the OpenWRT sysupgrade image for the initial flash via telnet that should be renamed to "factory.bin" per previous comments (actually I understand that renaming it is not really needed - see below).

So renaming OpenWRT sysupgrade.bin to factory.bin before flashing it via mtd seems a little confuse considering that there is also a factory.bin image available in the OpenWRT website for downloading:

  1. xiaomi_redmi-router-ax6s-squashfs-sysupgrade.bin
  2. xiaomi_redmi-router-ax6s-squashfs-factory.bin

So, just double-checking: differently from other routers, the first flash (from stock firmware to OpenWRT) should use the sysupgrade OpenWRT image (and not the OpenWRT factory image), correct? (EDITED: INCORRECT, see below).

Thanks!

EDITED: updating for future reference per discussion below. As expected the xiaomi_redmi-router-ax6s-squashfs-FACTORY.bin must be used for the first flash from stock firmware via telnet

Last modified: 2022/03/25 07:23 by cewbdex

And it states the same as the commit:
Download and flash image

On computer:

python -m http.server

On router:

cd /tmp
wget http://<IP>:8000/factory.bin
mtd -r write factory.bin firmware

Checking the image recipe:

  IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi
  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata

The factory.bin has a padding and is in UBI format.
The sysupgrade.bin is just a tar file.

You have to use the factory.bin for initial flashing!


Where did you got your assumption from?

1 Like

Try adding...

nvram set "boot_fw1=run boot_rd_img;bootm"

to the list of nvram commands before doing nvram commit.

The RB03 from my experience will typically boot from the 2nd firmware partition, which we don't touch during the initial mtd write operation.

It should be the factory image the first time you go from xiaomi firmware to openwrt.

Sysupgrade is if you are already running openwrt.

1 Like

Thanks! I've got this from comments like the one below. Anyway, it's clear now that factory image should be used in the first flash via telnet as expected. I will update my post above with this clarification for future reference.

1 Like

Hello.
I can't install any package. I get errors of "read-only file system".
Firmware is a recent snapshot.

Status

System

Hostname OpenWrt
Model Xiaomi Redmi Router AX6S
Architecture ARMv8 Processor rev 4
Target Platform mediatek/mt7622
Firmware Version OpenWrt SNAPSHOT r19293-1c7e146f7e / LuCI Master git-22.083.68981-15bbe69
Kernel Version 5.10.108
Local Time 2022-03-30 21:06:28
Uptime 1d 2h 29m 4s
Load Average 0.07, 0.05, 0.00

Any help?
Thanks

your build with sqm (7 march) can handle led on RB03 out of box. it even can change its color with 3 selection: red, orange, and blue. btw, I can't update anything with kernel dependency on that firmware as it ask a different kernel version. there must be something broken if I attempt to update anything.
older device with wifi4 (my xiaomi redmi note 5 pro) is having a hard time to connect to wifi (either combined 2.4Ghz/5Ghz or in 2.4Ghz). is it just me with incorrect configuration, or anyone else having this bug?

@Timbo is right. I executed this command and it success every time.

nvram set ssh_en=1 & nvram set uart_en=1 & nvram set boot_wait=on & nvram set bootdelay=3 & nvram set flag_try_sys1_failed=0 & nvram set flag_try_sys2_failed=1
nvram set flag_boot_rootfs=0 & nvram set "boot_fw1=run boot_rd_img;bootm"
nvram set flag_boot_success=1 & nvram commit & /etc/init.d/dropbear enable & /etc/init.d/dropbear start

Taken from a chinese youtuber that attempted to flash RB03.

That worked, thanks.

Looks like there's an issue with wlan1 not joining the br-lan bridge sometimes, I had to run "brctl addif br-lan wlan1" manually to get it done.