Add OpenWrt support for Xiaomi "Redmi AX6000"

Thank you for your guide, I've got OpenWrt up and running and LuCI is installed. Much appreciated.

That would have been when you flashed ubi. You should have been connected to one of the three Lan ports, not the Wan port. The Chinese instructions actually tell you to connect to the Lan port but everything seems to work with the Wan port from the stock firmware.

The IP change could catch some people, it took me a few minutes to remember my IP was static on the 192.168.31.1/24 network. I would think most Windows users attempting this would be familiar with Wireshark and eventually work out what was wrong.

I used Putty and didn't have an issue with SSH or Telnet. I'm using Putty Release 0.76 which is a bit old.

I skipped that section myself, uboot mod isn't necessary so I'd recommend noobs skipping it. All it does is free up extra space from what I understand and doesn't add any extra functionality. Can always do the upgrade later if you decide you want the extra space, just remember to save your OpenWrt settings like the instructions mention.

Personally I think the text editing to enable SSH would be the hardest for a noob. All I could see was 'vi' installed which is notorious for being challenging for noobs. Most Linux noobs wouldn't know to press 'dd' to delete the selected lines, then ':wq' to save. Don't get me wrong, I like 'vi', but it has a learning curve. I guess they could have copied the file contents to the local PC and then use SCP to copy it back on but I wasn't that smart.

Also the snapshot version of OpenWrt isn't very noob friendly, firstly you have to install LuCI yourself, and secondly you won't have internet access to even install LuCI unless you have your Wan setup and running through the router (mine was going through a separate gateway, no Wan). It isn't too hard to get up and running but might be better for noobs to wait until the AX6000 image is properly released unless they are familiar with Linux and have some network knowledge.

@jav has done a great job with the instructions, it made the process very easy even for someone as hopeless as me (don't know how I stuffed up the first time)!

Apart from the extra space, benefits for the u-boot mod layout are:

  • Multiple recovery mechanisms available in case of failed update (serial, tftp, initramfs). With stock layout a failed update can leave the system stuck as in some circumstances bootloader starts with UART disabled. In that case, flash may have to be unsoldered to recover.
  • Full open-source software, from bootloader. While uncommon, there's a possibility that stock bootloader calls home.

Those may or may not be of interest to everyone. Of course, fiddling with the bootloader is riskier, so you should be very sure what you're doing.

2 Likes

@jav is right, there is a reason why they created new uboot layout, not only because of extra space.

Me, I encoutered AX6000 bricked & recover to OEM firmware after I did a Openwrt hardreset due to some misconfiguration, lost URT & telnet access. Had to redo the flash procedure from the scratch.

If you don't want headache in the long run & don't plan to go back to OEM firmware, you should flash & change to new uboot which is more easy accessible and provide all common recovery functions on the boot menu.

1 Like

The uboot layout includes TFTP Recovery over Ethernet,
This feature can effectively help recover a "bricked" device.

openwrt ip = 192.168.1.1
tftp server ip = 192.168.1.254
bootfile = openwrt-mediatek-filogic-xiaomi_redmi-router-ax6000-ubootmod-initramfs-recovery.itb

https://openwrt.org/docs/guide-user/troubleshooting/tftpserver#setting_up_tftp_server

Is it possible to add a description of the uboot layout automatic tftp recovery feature on the wiki?

1 Like

Can you give a tutorial or a link? Preferably on a Wiki page about the OpenWrt U-Boot recovery system.

I've added @daiyeqi suggestion to the AX6000 wiki page.

This is the generic page about it:

Apart from that, in case of failure U-Boot will try to boot from the initramfs image, if present.

3 Likes

I see. Thank you for your answer!

Sorry, if I want to update or reinstall the U-Boot, can I only start from scratch after tftp boot? Or change to the original factory layout and start from scratch? Can it be upgraded based on existing ubootmod-squashfs-sysupgrade?

If you're already in u-boot mod layout, you can just do:

mtd write /tmp/ax6000-ubootmod-preloader.bin BL2
mtd write /tmp/ax6000-ubootmod-bl31-uboot.fip FIP

You may need to make those partitions writable.

Be very careful. That's a great way of bricking the router.

1 Like

That's right, it says the partition is not writable, so what about rewriting the recovery partition? thank you!

You need to load the kmod-mtd-rw module to make it writable.

I've been using the router with OpenWRT for about 3 weeks now following directions from this thread (thank you!).

I'm having issues with 160Mhz. Whenever I set it, my devices are unable to see the SSID, so I've had it set to 80Mhz instead. I've tried different channels and encryption combinations without success. Are there optimal settings to set to maximize features of the wifi chip? I understand this seems to still early stages of development for this chip, but are there a list of features that are still in development or hope to resolve?

This works for me:

config wifi-device 'radio0'
  option type 'mac80211'
  option path 'platform/soc/18000000.wmac'
  option channel '1'
  option band '2g'
  option cell_density '0'
  option txpower '14'
  option htmode 'HE20'

config wifi-device 'radio1'
  option type 'mac80211'
  option path 'platform/soc/18000000.wmac+1'
  option band '5g'
  option country 'US'
  option cell_density '2'
  option he_bss_color '8'
  option he_su_beamformee '1'
  option txpower '24'
  option beacon_int '100'
  option channel '100'
  option htmode 'HE160'

config wifi-iface 'wifinet2'
  option device 'radio1'
  option mode 'ap'
  option network 'lan'
  option ssid 'myssidname'
  option encryption 'sae-mixed'
  option key 'mygoodpassword'
  option dtim_period '3'
  option wpa_disable_eapol_key_retries '1'
  option ieee80211w '2'

...

<< repeat for other SSIDs >>
1 Like

Thank you! Those settings seem to work, but I've noticed an odd behavior: After making the changes, the 5Ghz SSID doesn't appear to be broadcasted until about 5 minutes later. This probably happened to me which led me to believe it didn't work; i just needed to wait...

For the he_su_beamformee, and other wifi, options, are there a luci package to install to show those options on the web ui, or even another wiki with possible options? I've used https://openwrt.org/docs/guide-user/network/wifi/basic but it's lacking.

Looks like radar detection in progress. Until it has checked for possible radars, it won't activate the radio.

1 Like

5 min? For me it is 1 min. Are you using a different country code/region? In any case, this specific set of settings circumvents the mt76 bug affecting throughput through multiple walls/objections for the AX6000.

1 Like

Should he_bss_color be set to a different value across multiple access points broadcasting the same SSID or same across them all? All APs are set to auto so there is a chance they may choose the same channel.

I'm curious about this as well, in the context of WDS.

5 minutes may be an exaggeration but longer than what I'm used to. I'm using US as country code. I'm in a dense city, in a relative small space, so objections aren't a concern but cell/wifi density is.

With the settings you posted, my TV is unable to see the 5G SSID but other devices seem ok.