====== Xiaomi AX3600 wifi 6 ======
https://openwrt.org/toh/xiaomi/ax3600 https://openwrt.admincomps.ru/nss-wifi/ \\
Interesting :!: \\
google bbr \\
luci-app-sqm\\
nlbwmon \\
btop
\\
banip (77K+)
adblock-fast (100K+)
nginx (replaced uhttpd)
unbound (medium mem)
collectd
{{:hardware:hardware:ax3600:pasted:20240420-044630.png?600}}
[03/13/24 18:14:55] macbook@Macbook-Pro-M1 ~ 14s
> gdd if=/dev/urandom bs=1MB count=500 2> /dev/null | ssh -o 'Compression no' -c chacha20-poly1305@openssh.com root@r 'pv -f > /dev/null'
476MiB 0:00:13 [36.2MiB/s] []
[03/13/24 18:15:14] magbook@Macbook-Pro-M1 ~ 13s
> gdd if=/dev/urandom bs=1MB count=500 2> /dev/null | ssh -o 'Compression no' -c aes256-ctr root@r 'pv -f > /dev/null'
476MiB 0:00:30 [15.7MiB/s] [ ]
[03/13/24 18:16:04] macbook@Macbook-Pro-M1 ~ 30s
> gdd if=/dev/urandom bs=1MB count=500 2> /dev/null | ssh -o 'Compression no' -c aes128-ctr root@r 'pv -f > /dev/null'
476MiB 0:00:26 [18.3MiB/s] [ ] ]
===== Firmware =====
Journal of update
^ date ^ version ^ Comment ^
| 20240420 | OpenWrt SNAPSHOT r26231-0b72cb3f3c / LuCI Master 24.100.29615~1181915 | https://openwrt.admincomps.ru/nss-wifi/ - working |
| 20240214 | OpenWrt SNAPSHOT r25109-4a3522b9e1 / LuCI Master git-24.031.09542-8a0ee66 | https://openwrt.admincomps.ru/nss-wifi/20240201/ working |
| 20240212 | OpenWrt SNAPSHOT r22827-6d9aab3e4e / LuCI Master git-23.118.79121-6fb185f | stable |
++++ 1.Backup|
# Generate backup
umask go=
sysupgrade -b /tmp/backup-${HOSTNAME}-$(date +%F).tar.gz
ls /tmp/backup-*.tar.gz
# copy backup
scp /tmp/backup-*.tar.gz eam@192.168.114.124:/volume1/backup/my_backup/dev_ax3600/
++++
++++ 2.Upgrade firmware|
# get firmware
cd /tmp
wget https://openwrt.admincomps.ru/nss-wifi/20240415/openwrt-qualcommax-ipq807x-xiaomi_ax3600-squashfs-sysupgrade.bin
#check summ
sha256sum *sysupgrade*
#upgrade
sysupgrade -n /tmp/openwrt-qualcommax-ipq807x-xiaomi_ax3600-squashfs-sysupgrade.bin
++++
===== XIAOM 3600 working NSS =====
# thermal
for i in /sys/devices/virtual/thermal/ther*/type; do awk -v temp="$(cat ${i%/*}/temp)" '{gsub(/(wcss-|-thermal)/,"");printf("%8s %.1f°C \n", $1, temp / 1000)}' $i; done|sort
++++ Shell command for work with nss|
#I've disabled sw/hw offload and packet steering
#and added options mac80211 nss_redirect=1 to /etc/modules.conf. Other experiments:
root@ax3600:~# cat /sys/kernel/debug/qca-nss-drv/stats/cpu_load_ubi
CPU Utilization:
Note: Averaged over 1 second
Core 0:
Min Avg Max
3% 3% 52%
# ns stats
nss_stats
# info for drivers
grep -Ev "^$" /sys/kernel/debug/qca-nss-drv/stats/wifili
root@ax3600:~# for a in /sys/m*/ath11k/p*/*; do echo "${a##*/}=$(cat $a)"; done
cold_boot_cal=Y
crypto_mode=0
debug_mask=0
frame_mode=2
ftm_mode=N
# !!! monitor IRQs in a poor man's htop.
#For Busybox version of watch the flags will be (remove -d and -x)
watch -n .5 -t awk -F'[: ]+' '
NR==1 {print; next}
$2==18 || ($2 > 37 && $0 !~ /IPI/) {
sum1 += $3; sum2 += $4; sum3 += $5; sum4 += $6;
if ($3 + $4 + $5 + $6 != 0) {
print $0
}
}
END {
printf "TOTAL: %-10s %-10s %-10s %-10s\n", sum1, sum2, sum3, sum4
}
' /proc/interrupts
#Otherwise for procps-ng
watch -n .5 -d -t -x awk -F'[: ]+' '
NR==1 {print; next}
$2==18 || ($2 > 37 && $0 !~ /IPI/) {
sum1 += $3; sum2 += $4; sum3 += $5; sum4 += $6;
if ($3 + $4 + $5 + $6 != 0) {
print $0
}
}
END {
printf "TOTAL: %-10s %-10s %-10s %-10s\n", sum1, sum2, sum3, sum4
}
' /proc/interrupts
++++
++++ SQM config|
#qosmio sqm https://forum.openwrt.org/t/ipq807x-nss-build/148529/1578?u=tttest25
config queue 'wan'
option interface 'wan'
option linklayer 'none'
option qdisc_advanced '1'
option squash_dscp '0'
option squash_ingress '1'
option ingress_ecn 'ECN'
option egress_ecn 'ECN'
option qdisc 'fq_codel'
option verbosity '5'
option script 'nss-zk.qos'
option debug_logging '1'
option enabled '1'
option qdisc_really_really_advanced '1'
option iqdisc_opts 'interval 25ms quantum 304'
option eqdisc_opts 'interval 25ms quantum 304'
option upload '969220'
option download '969220'
option itarget '2.5ms'
option etarget '2.5ms'
++++
===== xiaomi 3600 cmd openwrt =====
iw list # info about adapters
iw dev # about devices
iw dev phy1-ap0 station dump # about assoc station
# reload config of wifi without reboot
$ vi /etc/config/wireless
Add those options under config wifi-device 'radio1'
$ wifi reload radio1 #reload that radio without reboot
# public test speed
$ iperf3 -c speedtest.fra1.de.leaseweb.net -p 5201-5210 -R -i 1
btop
==== Compilng firmware ====
https://github.com/JuliusBairaktaris/Qualcommax_NSS_Builder \\
===== Compile openwrt =====
#!/bin/bash
#remove old folder
rm -rf openwrt
#get the sources
git clone https://github.com/bitthief/openwrt.git
#copy the config
cp config_dynalink_dl-wrx36 openwrt/.config
cd openwrt
# delete the patches that cause the boot loop on the dynalink
rm target/linux/ipq807x/patches-5.15/0100-*
#update and install the feeds
./scripts/feeds update -a
./scripts/feeds install -a
#build
make defconfig
make download
make -j5
Sources:
https://github.com/AgustinLorenzo/openwrt 5
https://github.com/AgustinLorenzo/nss-packages 1
BUILDING (UPDATED): https://github.com/AgustinLorenzo/openwrt/actions/runs/4790246215/jobs/8519106488 1
BUILDED: https://github.com/AgustinLorenzo/openwrt/releases/tag/ipq807x-2023-04-24-2213 5
Regards, Agustin
===== API =====
Получить логи и системную информацию:\\
http://192.168.31.1/cgi-bin/luci/;stok= 22 /api/xqsystem/init_info\\
http://192.168.31.1/cgi-bin/luci/;stok= 22 /api/misystem/sys_log\\
запросить Последнюю версии прошивки\\
http://api.miwifi.com/upgrade/log/list?typeList=R3600STA\\
===== Debrick =====
++++ open |
Well, I'm not the Windows guy. But I will try to write it up for Linux. Give me bit time. I will edit in parts.
1.) Download an Ubuntu ISO and put it onto a USB stick and boot into it.
a) Ubuntu ISO: https://ubuntu.com/download/desktop/thank-you?version=22.10&architecture=amd64 16
b) Tool for writing ISO to USB e. g.: https://www.balena.io/etcher/ 4
c) Reboot your PC into Ubuntu.
2.) Connect your system to the internet (if its not the case already).
3.) Open a terminal with: "CRTL + ATL + T" or by pressing the Windows key typing in "terminal" (without quotes " ")
4.) Install dnsmasq with the following command:
sudo apt update & sudo apt -y install dnsmasq
5.) Download firmware:
mkdir /tmp/tftp
chown -R ubuntu:ubuntu /tmp/tftp
cd /tmp/tftp
wget https://cdn.awsde0-fusion.fds.api.mi-img.com/xiaoqiang/rom/r3600/miwifi_r3600_all_6510e_3.0.22_INT.bin
mv miwifi_r3600_all_6510e_3.0.22_INT.bin C0A81F02.img
6.) Disconnect your PC from internet and connect it into the first lan port of your bricked router. Do not use any other port like wan or lan port 2, 3. Do not power up the unit yet.
7.) Copy and paste the following commands into the shell (block by block):
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
sudo mv /etc/dnsmasq.d/ /etc/dnsmasq.d.bak/
sudo systemctl stop dnsmasq
sudo systemctl stop systemd-resolved
sudo systemctl stop systemd-networkd
sudo systemctl stop NetworkManager
sudo sed -i d /etc/resolv.conf
echo 'nameserver 127.0.0.1' | sudo tee -a /etc/resolv.conf
IPT4="/usr/sbin/iptables"
netdevname=$(ls /sys/class/net | grep enp)
sudo ${IPT4} -I INPUT 1 -m conntrack --ctstate NEW,ESTABLISHED -p tcp --dport 69 -j ACCEPT
sudo ${IPT4} -I INPUT 2 -m conntrack --ctstate NEW,ESTABLISHED -p udp --dport 69 -j ACCEPT
sudo ${IPT4} -I INPUT 3 -m conntrack --ctstate NEW,ESTABLISHED -p udp -m multiport --dport 67:68 -j ACCEPT
sudo ip address flush dev ${netdevname}
sudo ip address add 192.168.31.100/24 dev ${netdevname}
sudo ip link set ${netdevname} up
sudo dnsmasq --no-daemon --listen-address=192.168.31.100 --bind-interfaces --dhcp-range=192.168.31.2,192.168.31.2 --enable-tftp --tftp-root=/tmp/tftp
8.) Follow the usual procedure:
Hold the reset button pressed and plug in the power cable. Keep the reset button pressed until the orange system light starts blinking. You can release the reset button after blinking has started.
Output should look like:
sudo dnsmasq --no-daemon --listen-address=192.168.31.100 --bind-interfaces --dhcp-range=192.168.31.2,192.168.31.2 --enable-tftp --tftp-root=/tmp/tftp
dnsmasq: gestartet, Version 2.87, Zwischenspeichergröße 150
dnsmasq: Optionen bei Übersetzung: IPv6 GNU-getopt DBus no-UBus i18n IDN2 DHCP DHCPv6 no-Lua TFTP conntrack ipset nftset auth cryptohash DNSSEC loop-detect inotify dumpfile
dnsmasq-dhcp: DHCP, IP-Bereich 192.168.31.2 -- 192.168.31.2, Leasezeit 1h
dnsmasq-tftp: TFTP Wurzel ist /tmp/tftp
dnsmasq: lese /etc/resolv.conf
dnsmasq: Benutze Namensserver 127.0.0.1#53
dnsmasq: /etc/hosts gelesen - 10 Adressen
dnsmasq-dhcp: DHCPDISCOVER(eth0) 02:68:b3:29:da:98
dnsmasq-dhcp: DHCPOFFER(eth0) 192.168.31.2 02:68:b3:29:da:98
dnsmasq-dhcp: DHCPREQUEST(eth0) 192.168.31.2 02:68:b3:29:da:98
dnsmasq-dhcp: DHCPACK(eth0) 192.168.31.2 02:68:b3:29:da:98
dnsmasq-tftp: /tmp/atftp/C0A81F02.img an 192.168.31.2 verschickt
9.) Wait until the system light starts blinking blue. Now you can remove the power plug and restart the router.
EDIT: Reorganized. Now final.
++++
===== Xiaomi3600 old =====
* get ssh access
* 4pda main tread
* https://irq5.io/2020/08/10/custom-firmware-for-the-xiaomi-ax3600-wireless-router/ - how to bake firmare
* patch web ui for set power from web ui
* https://github.com/galeksandrp/xqrepack/tree/txpwr - patch for UI
* https://github.com/galeksandrp/xqrepack/tree/stock-rootfs - files of firmware
* https://4pda.to/forum/index.php?showtopic=983152&st=7780#entry115083527 - configure channel
* AX worse than AC with theory - https://forum.openwrt.org/t/802-11ax-worse-than-802-11ac-with-mt76-driver/126466/2?page=5
* power supply блок питания https://tdtorus.ru/product/blok_pitaniya_bgp_123_1
====== Xiaomi wifi 4a ======
* https://4pda.to/forum/index.php?showtopic=988197&st=0#entry95240419