Adding OpenWrt support for Xiaomi AX3600 (Part 1)

Hello,

i'm sorry to ask but i've a problem in SYSTEM LOG and on root_fs in SOFTWARE
i've around 100MB of free space and on rootfs_1 only 12MB.

root@AX3600:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "0:sbl1"
mtd1: 00100000 00020000 "0:mibib"
mtd2: 00300000 00020000 "0:qsee"
mtd3: 00080000 00020000 "0:devcfg"
mtd4: 00080000 00020000 "0:rpm"
mtd5: 00080000 00020000 "0:cdt"
mtd6: 00080000 00020000 "0:appsblenv"
mtd7: 00100000 00020000 "0:appsbl"
mtd8: 00080000 00020000 "0:art"
mtd9: 00080000 00020000 "bdata"
mtd10: 00080000 00020000 "crash"
mtd11: 00080000 00020000 "crash_syslog"
mtd12: 023c0000 00020000 "rootfs"
mtd13: 08000000 00020000 "rootfs_1"
mtd14: 01ec0000 00020000 "overlay"
mtd15: 00080000 00020000 "rsvd0"
mtd16: 00900000 00020000 "0:wififw"
root@AX3600:~#

SYSTEM LOG

Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.134095] 17 qcomsmem partitions found on MTD device qcom_nand.0
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.141400] Creating 17 MTD partitions on "qcom_nand.0":
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.147645] 0x000000000000-0x000000100000 : "0:sbl1"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.154321] 0x000000100000-0x000000200000 : "0:mibib"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.159213] 0x000000200000-0x000000500000 : "0:qsee"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.165596] 0x000000500000-0x000000580000 : "0:devcfg"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.168804] 0x000000580000-0x000000600000 : "0:rpm"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.173773] 0x000000600000-0x000000680000 : "0:cdt"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.178530] 0x000000680000-0x000000700000 : "0:appsblenv"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.183421] 0x000000700000-0x000000800000 : "0:appsbl"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.189314] 0x000000800000-0x000000880000 : "0:art"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.193989] 0x000000880000-0x000000900000 : "bdata"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.198778] 0x000000900000-0x000000980000 : "crash"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.203689] 0x000000980000-0x000000a00000 : "crash_syslog"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.208490] 0x000000a00000-0x000002dc0000 : "rootfs"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.217399] random: fast init done
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.240740] mtd: device 12 (rootfs) set to be root filesystem
Mon Jul 12 01:35:25 2021 kern.alert kernel: [    1.241019] mtdsplit: no squashfs found in "rootfs"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.245486] 0x000002dc0000-0x00000adc0000 : "rootfs_1"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.343994] 0x00000adc0000-0x00000cc80000 : "overlay"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.367049] 0x00000cc80000-0x00000cd00000 : "rsvd0"
Mon Jul 12 01:35:25 2021 kern.notice kernel: [    1.367829] 0x00000cd00000-0x00000d600000 : "0:wififw"

First i installed this firmware:
https://forum.openwrt.org/t/xiaomi-ax3600-install-guide/68273
Then i went back to original firmware (as described in the guide).

To install OWRT(AX3600-5.10-restart), i've done (don't know anymore if it was mtd12 or 13):

ubiformat /dev/mtd12 -y -f /tmp/openwrt-ipq807x-generic-xiaomi_ax3600-squashfs-nand-factory.ubi
nvram set flag_last_success=1 && nvram set flag_boot_rootfs=1 && nvram commit  && reboot
ubiformat /dev/mtd13 -y -f /tmp/openwrt-ipq807x-generic-xiaomi_ax3600-squashfs-nand-factory.ubi
nvram set flag_last_success=0 && nvram set flag_boot_rootfs=0 && nvram commit  && reboot

and OWRT was running.

What have i done wrong?

Many Thanks
Hans

Hi,

OK, no SYSTEM LOG error, seems normal.

Now i know the problem, root_fs is 35,7MB and root_fs1 is 128MB.

Don't think that's normal.

May someone can guide me to correct this?

Thanks

Hans

@Hans,

not entirely normal. Mine looked like this in the beginning (chinese firmware) as well. But now (after installing robimarkos firmware) it looks like this (not that I did anything about it willingly...):

mtd12: 023c0000 00020000 "rootfs"
mtd13: 023c0000 00020000 "rootfs_1"

FWIW:

I recompiled my firmware with ath10k small buffer and manually cut ath11k buffers in half (4096->2048).
Only two days, but so far running stable with 80-160MB free RAM.

1 Like

I have opened this topic about a roaming issue I have: moving clients hang with no apparent reason when roaming.
Maybe it is not a config issue but a "not implemented in this firmware" yet issue?

1 Like

Hey, Joba, you're getting Hans Schulze instead of Hans Werner
:wink:

I managed to get OpenWRT on the device after having some minor difficulties. But now I can't get WiFi to bridge with LAN if my life depends on it.

I can connect to the AP, but I can't get any traffic in or out. I do have VLAN enabled on the bridged interface, is that supported or is bridging WLAN to LAN in general unsupported?

root@ap2:/etc/config# 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 'fd61:056e:c75a::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth1'
	list ports 'eth2'
	list ports 'eth3'
	option igmp_snooping '1'

config interface 'lan'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option device 'br-lan.1'
	option metric '1'
	option ipaddr '10.0.0.7'
	option gateway '10.0.0.3'
	list dns '10.0.0.4'
	list dns_search 'xxx'

config device
	option name 'eth0'

config bridge-vlan
	option device 'br-lan'
	option vlan '1'
	list ports 'eth1'
	list ports 'eth2'
	list ports 'eth3'

config bridge-vlan
	option device 'br-lan'
	option vlan '10'
	list ports 'eth1:t'

config interface 'IOT'
	option proto 'static'
	option device 'br-lan.10'
	option ipaddr '10.0.10.4'
	option netmask '255.255.255.0'
	option gateway '10.0.10.2'
	option metric '2'
	option type 'bridge'

config device
	option name 'br-lan.1'
	option type '8021q'
	option ifname 'br-lan'
	option vid '1'
	option ipv6 '0'

config device
	option name 'br-lan.10'
	option type '8021q'
	option ifname 'br-lan'
	option vid '10'
	option ipv6 '0'
config wifi-device 'radio2'
	option type 'mac80211'
	option path 'platform/soc/c000000.wifi+1'
	option band '2g'
	option htmode 'HE40'
	option channel 'auto'
	option country 'NL'
	option cell_density '0'

config wifi-iface 'default_radio2'
	option device 'radio2'
	option network 'lan'
	option mode 'ap'
	option encryption 'psk2'
	option key 'xxx'
	option ssid 'YGGDRASIL_NN'

I dont know how to configure vlan in openwrt, but you can see a mostly working config of bridged lan/wlan without vlan in the link in my previous post. Maybe it helps?

my vlan setup for your reference

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth1'
	list ports 'eth2'
	list ports 'eth3'

config bridge-vlan
	option device 'br-lan'
	option vlan '1'
	list ports 'eth1:t'
	list ports 'eth2'
	list ports 'eth3'

config bridge-vlan
	option device 'br-lan'
	option vlan '3'
	list ports 'eth1:t'

config device
	option type 'bridge'
	option name 'brvlan1'
	list ports 'br-lan.1'

config device
	option type 'bridge'
	option name 'brvlan3'
	list ports 'br-lan.3'
	
config interface 'vif1'
	option proto 'static'
	option device 'brvlan1'
	option ipaddr '10.11.1.1/24'

config interface 'vif3'
	option proto 'static'
	option device 'brvlan3'
	option ipaddr '10.11.3.1/24'

Would you care to go a bit more into details about what you changed? Especially the ath11k modifications.

I'm starting to think it might not be me...

I reset to factory defaults, with a compiled version with only LuCi added:

root@78bc05602e73:/openwrt# ./scripts/diffconfig.sh
CONFIG_TARGET_ipq807x=y
CONFIG_TARGET_ipq807x_generic=y
CONFIG_TARGET_ipq807x_generic_DEVICE_xiaomi_ax3600=y
CONFIG_PACKAGE_cgi-io=y
CONFIG_PACKAGE_libiwinfo-lua=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_liblucihttp=y
CONFIG_PACKAGE_liblucihttp-lua=y
CONFIG_PACKAGE_libubus-lua=y
CONFIG_PACKAGE_lua=y
CONFIG_PACKAGE_luci=y
CONFIG_PACKAGE_luci-app-firewall=y
CONFIG_PACKAGE_luci-app-opkg=y
CONFIG_PACKAGE_luci-base=y
CONFIG_PACKAGE_luci-lib-base=y
CONFIG_PACKAGE_luci-lib-ip=y
CONFIG_PACKAGE_luci-lib-jsonc=y
CONFIG_PACKAGE_luci-lib-nixio=y
CONFIG_PACKAGE_luci-mod-admin-full=y
CONFIG_PACKAGE_luci-mod-network=y
CONFIG_PACKAGE_luci-mod-status=y
CONFIG_PACKAGE_luci-mod-system=y
CONFIG_PACKAGE_luci-proto-ipv6=y
CONFIG_PACKAGE_luci-proto-ppp=y
CONFIG_PACKAGE_luci-theme-bootstrap=y
CONFIG_PACKAGE_rpcd=y
CONFIG_PACKAGE_rpcd-mod-file=y
CONFIG_PACKAGE_rpcd-mod-iwinfo=y
CONFIG_PACKAGE_rpcd-mod-luci=y
CONFIG_PACKAGE_rpcd-mod-rrdns=y
CONFIG_PACKAGE_uhttpd=y
CONFIG_PACKAGE_uhttpd-mod-ubus=y

All I changed to the default settings was:

  • disable odhcpd
  • disable dnsmasq
  • change the lan-interface IP-settings:
root@OpenWrt:/etc/config# cat 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 'fd3b:6666:14b2::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth1'
	list ports 'eth2'
	list ports 'eth3'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option ip6assign '60'
	list ipaddr '10.0.0.7/24'
	option gateway '10.0.0.3'
	list dns '10.0.0.4'
	option metric '1'

config interface 'wan'
	option device 'eth0'
	option proto 'dhcp'

config interface 'wan6'
	option device 'eth0'
	option proto 'dhcpv6'

I then added a WiFi AP on radio2:

root@OpenWrt:/etc/config# cat wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option path 'soc/20000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0'
	option channel '36'
	option band '5g'
	option htmode 'VHT80'
	option disabled '1'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'none'

config wifi-device 'radio1'
	option type 'mac80211'
	option path 'platform/soc/c000000.wifi'
	option channel '36'
	option band '5g'
	option htmode 'HE80'
	option disabled '1'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'none'

config wifi-device 'radio2'
	option type 'mac80211'
	option path 'platform/soc/c000000.wifi+1'
	option band '2g'
	option htmode 'HE40'
	option channel 'auto'
	option cell_density '0'

config wifi-iface 'wifinet2'
	option device 'radio2'
	option mode 'ap'
	option ssid 'YGGDRASIL_NN'
	option encryption 'psk2+ccmp'
	option key 'bladiebla'
	option network 'lan'

I hooked it up to my network, and made a connection to the AP. Not getting a lease from my DHCP... Manually set my IP allowed me to connect to the AP directly via both the webUI and SSH. The AP itself is able to connect to the rest of the world:

root@OpenWrt:/etc/config# traceroute 1.1.1.1
traceroute to 1.1.1.1 (1.1.1.1), 30 hops max, 46 byte packets
 1  router.home.cannonfodder.nl (10.0.0.3)  0.522 ms  0.475 ms  0.410 ms
 2  192.168.1.1 (192.168.1.1)  1.321 ms  1.159 ms  1.042 ms
 3  1-200-201-31.ftth.glasoperator.nl (31.201.200.1)  5.949 ms  6.320 ms  8.158 ms
 4  one.one.one.one (1.1.1.1)  6.541 ms  6.722 ms  7.066 ms

Restarting the lan-interface using the webUI makes it magically work... Disconnecting and re-connecting to the WiFi AP breaks it again, until restarting the lan-interface... Once it does work it also at random breaks again.

❯ ping 10.0.0.3
PING 10.0.0.3 (10.0.0.3): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
# Restart of lan-interface
ping: sendto: No route to host
Request timeout for icmp_seq 4
ping: sendto: Host is down
Request timeout for icmp_seq 5
ping: sendto: Host is down
[...]
Request timeout for icmp_seq 21
ping: sendto: Host is down
Request timeout for icmp_seq 22
Request timeout for icmp_seq 23
64 bytes from 10.0.0.3: icmp_seq=24 ttl=64 time=3.227 ms
64 bytes from 10.0.0.3: icmp_seq=25 ttl=64 time=3.292 ms
ping: sendto: No route to host
ping: sendto: No route to host
Request timeout for icmp_seq 26
ping: sendto: No route to host

Am I going crazy?!

Does you disabled ax3600 dhcp-server ?

Yup, DHCP is provided by an OpenWRT instance running inside a container on my edge node.

The most frustrating part is, I'm not new to OpenWRT. I have 1 containerized instance, another Xiaomi AC2100 AP, and two Netgear switches with OpenWRT. Why can't I get this to work, ugh :stuck_out_tongue:

sure, here are my notes:

after first compile (to have a build_dir) ...

* menuconfig -> kernel modules -> wireless -> ath10k small buffers
* build_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/linux-5.10.46/drivers/net/wireless/ath/ath11k/hw.h(67): #define ATH11K_QUEUE_LEN 2048 (from 4096)

do you know (could you tell me) how to make a proper patch out of this #define?

FYI: I did not exactly verify in source what difference changing ATH11K_QUEUE_LEN makes for memory allocation. It just looked promising at first and second glance and my (not so statistically relevant) test on two devices looked promising.

Strange enough, the AP that does not run the DHCP/DNS and has less attached stations uses a bit more memory on average. Go figure...

Could this potentially be the same problem described in this thread?

It could... it appears to be relatively stable now all of a sudden, but especially:

the AX3600 configured as a dumb AP where sometimes WLAN clients can't get any access to LAN for the first few minutes after they associate

Sounds highly plausible. Once I experience it again, I'll use my Android phone with ever changing MAC-address to connect to the AP and check if it's able to connect right away.

Guys i have an importand question, i have this Router and i am totally dissapointed by its firmware which seems to have been stucked for 10 months in this 3.0.22 buggy as hell version (no port forwarding on lan, pihole is not working at all with it i, FTL service shut down due to huge trafic caused by the buggy xiaomi factory firmware!) and i am sure Xiaomi will not ever fix them, especially the pihole issues (i am sure they want eliminate pihole usability) So i am asking : will it ever get a custom firmware like any other Router loaded by the web interface without all those downgrades and extreme dangerous solutions? or to sell it to someone who want it for just simple jobs? Thank you

Don't think it will ever get a easy flash method.
Besides we are still far from making it upstream.

1 Like

I've seen some odd temporary blockages too, but didn't imagine they were AX3600-specific - rather maybe a bug in SNAPSHOT, my setup, or ath11k driver snapshot in general.

I have AX3600 #1 in a cupboard acting as a WAN router, DHCP server, plugged into a wired NAS and having a 5GHz (ath11k) WDS master linking to AX3600 #2 in the living area with all the actual wireless clients. This setup worked OK on Archer C7s for years.

All LAN & WLAN segments are simply bridged in br-lan.

I've definitely seen situations where a wireless client on AP #2 can't ping the NAS, but can ping the AP #1 and access the WAN OK. In this situation, remaining connected to AP #2, I've ssh'd to AP #1, then ssh'd to the NAS and the instant I ping the wireless client from the NAS everything starts working and remains good. I'm no expert, but it seems that ARP broadcast/response is failing.

Most of the time it all works OK even from cold boot. This doesn't seem to be a static trunking/bridge configuration issue.

1 Like

can you find where the info about the firmware was mentioned ?