Skip to content

Commit 9639dcf

Browse files
committed
Add Readme
1 parent de95ab4 commit 9639dcf

File tree

1 file changed

+187
-0
lines changed

1 file changed

+187
-0
lines changed

README.md

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
# openwrt-redmi-ax3000
2+
3+
`Openwrt` for `Redmi AX3000` / `Xiaomi CR880x` / `Xiaomi CR881x`
4+
5+
**!!! NOTE: This is the main development branch which using mainline `Linux LTS 5.4` !!!**
6+
7+
If you need more stable versions, please checkout the following branches which using QSDK kernel
8+
- [`ipq50xx-qsdk-kernel-5.4-openwrt-21.02-qsdk-11.5.05.841.1029`](https://github.com/hzyitc/openwrt-redmi-ax3000/tree/ipq50xx-qsdk-kernel-5.4-openwrt-21.02-qsdk-11.5.05.841.1029)
9+
- [`ipq50xx-qsdk-kernel-4.4-openwrt-21.02-qsdk-11.4.0.5.7418`](https://github.com/hzyitc/openwrt-redmi-ax3000/tree/ipq50xx-qsdk-kernel-4.4-openwrt-21.02-qsdk-11.4.0.5.7418)
10+
11+
| Device | Boot | Switch | CPU Ethernet | NSS NAT | 2.4G WiFi | 5G WiFi |
12+
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
13+
| Xiaomi CR880x <br /> (M79 version) | ✔️ | ✔️ | ✔️ || ✔️ | ✔️¹ |
14+
| Redmi AX3000 <br /> Xiaomi CR880x <br /> (M81 version) | ✔️ | ✔️ | ✔️ || ✔️ | ✔️¹ |
15+
| Xiaomi CR881x | ✔️ | ✔️ | ✔️ || ✔️ | ✔️¹ |
16+
>
17+
> NOTE¹: For 160MHz, `Country Code`, `Width` and `Channel` need to be set correctly. And wait 1 minute for radar detection, then the WiFi will be appeareed.
18+
>
19+
> ```
20+
> uci -q batch <<-EOF
21+
> wireless.radio1.country='CN'
22+
> wireless.radio1.htmode='HE160'
23+
> wireless.radio1.channel='64'
24+
> EOF
25+
> ```
26+
27+
## How to build
28+
29+
OS: `Ubuntu 20.04 (focal)`
30+
31+
```bash
32+
# Install dependencies
33+
sudo apt update
34+
sudo apt install build-essential clang flex g++ gawk gcc-multilib gettext \
35+
git libncurses5-dev libssl-dev python3-distutils rsync unzip zlib1g-dev
36+
37+
# Clone this repo
38+
git clone https://github.com/hzyitc/openwrt-redmi-ax3000
39+
cd openwrt-redmi-ax3000
40+
41+
# Update and install feeds
42+
./scripts/feeds update -a
43+
./scripts/feeds install -a
44+
45+
# Configure
46+
make menuconfig
47+
48+
# Download
49+
make -j16 download
50+
51+
# Build
52+
make -j$(nproc)
53+
```
54+
55+
## How to install
56+
57+
### Get `UART` access
58+
59+
> Input from `UART` will be allowed after a successful `TFTP recovery`.
60+
61+
1. Connect `UART` and `LAN`.
62+
63+
2. Download the vendor firmware:
64+
65+
Offical website: https://www.miwifi.com/miwifi_download.html
66+
67+
| Device | URL |
68+
| :-: | :-: |
69+
| Redmi AX3000 | https://cdn.cnbj1.fds.api.mi-img.com/xiaoqiang/rom/ra81/miwifi_ra81_firmware_1dd69c_1.0.33.bin |
70+
| Xiaomi CR8806 | https://cdn.cnbj1.fds.api.mi-img.com/xiaoqiang/rom/cr8806/miwifi_cr8806_firmware_fe70b_6.2.14.bin |
71+
| Xiaomi CR8808 | https://cdn.cnbj1.fds.api.mi-img.com/xiaoqiang/rom/cr8808/miwifi_cr8808_firmware_9d216_6.2.11.bin |
72+
| Xiaomi CR8809 | https://cdn.cnbj1.fds.api.mi-img.com/xiaoqiang/rom/cr8809/miwifi_cr8809_firmware_b814a_6.2.102.bin |
73+
74+
3. Use [`MIWIFIRepairTool`](https://bigota.miwifi.com/xiaoqiang/tools/MIWIFIRepairTool.x86.zip) to recover the device's firmware.
75+
76+
Offical tutorial: https://www.xiaomi.cn/post/19134127
77+
78+
> This tool simply does `TFTP recovery`. You can use other `DHCP` and `TFTP` server as well.
79+
>
80+
> Here are some useful links:
81+
>
82+
>> https://forum.openwrt.org/t/adding-openwrt-support-for-xiaomi-redmi-router-ax6s-xiaomi-router-ax3200/111085/513
83+
>>
84+
>> https://github.com/mikeeq/xiaomi_ax3200_openwrt#uart-flash
85+
>>
86+
>> https://openwrt.org/inbox/toh/xiaomi/xiaomi_ax3600#tftp_recovery
87+
88+
4. Hold the `reset` button and reboot the router until the `system` LED blink.
89+
90+
5. Wait until the firmware being flashed.
91+
92+
6. Unplug then plug back in the power.
93+
94+
7. Send any key stroke to `UART` to interrupt the `U-boot`.
95+
96+
8. Run the following command inside `U-boot`:
97+
98+
```shell
99+
setenv boot_wait on
100+
setenv uart_en 1
101+
saveenv
102+
```
103+
104+
Now we have enabled `UART`.
105+
106+
### Flash Openwrt
107+
108+
#### a. Use `U-boot` to flash
109+
110+
Download [`openwrt-ipq50xx-arm-redmi_ax3000-squashfs-nand-factory.ubi`](https://github.com/hzyitc/openwrt-redmi-ax3000/releases/latest/download/openwrt-ipq50xx-arm-redmi_ax3000-squashfs-nand-factory.ubi) and put it into TFTP root.
111+
112+
Then run the following command inside `U-boot`:
113+
114+
```shell
115+
# This router ip
116+
setenv ipaddr 192.168.1.2
117+
# TFTP server ip
118+
setenv serverip 192.168.1.1
119+
120+
# Download the firmware to the RAM
121+
tftpboot openwrt-ipq50xx-arm-redmi_ax3000-squashfs-nand-factory.ubi
122+
123+
# Flash it as system 2
124+
flash rootfs_1
125+
setenv flag_try_sys2_failed 0
126+
setenv flag_boot_rootfs 1
127+
setenv flag_last_success 1
128+
saveenv
129+
130+
# Flash it as system 1
131+
# flash rootfs
132+
# setenv flag_try_sys1_failed 0
133+
# setenv flag_boot_rootfs 0
134+
# setenv flag_last_success 0
135+
# saveenv
136+
137+
# Reboot
138+
reset
139+
```
140+
141+
#### b. Use `miwifi` (the vendor firmware) to flash
142+
143+
```bash
144+
cd /tmp
145+
wget https://github.com/hzyitc/openwrt-redmi-ax3000/releases/latest/download/openwrt-ipq50xx-arm-redmi_ax3000-squashfs-nand-factory.ubi
146+
147+
# Check your partition table
148+
# cat /proc/mtd
149+
[[ "$(grep '"rootfs"' /proc/mtd | cut -d':' -f1)" == "mtd18" ]] || exit
150+
[[ "$(grep '"rootfs_1"' /proc/mtd | cut -d':' -f1)" == "mtd19" ]] || exit
151+
152+
# Detect the current system slot and flash into the other one
153+
# cat /proc/cmdline
154+
mtd="$(grep -oE 'ubi.mtd=[a-zA-Z0-9\-\_]*' /proc/cmdline | cut -d'=' -f2)"
155+
if [[ "$mtd" == "rootfs" ]]; then
156+
# Flash it as system 2
157+
ubiformat /dev/mtd19 -f openwrt-ipq50xx-arm-redmi_ax3000-squashfs-nand-factory.ubi
158+
nvram set flag_try_sys2_failed=0
159+
nvram set flag_boot_rootfs=1
160+
nvram set flag_last_success=1
161+
nvram commit
162+
elif [[ "$mtd" == "rootfs_1" ]]; then
163+
# Flash it as system 1
164+
ubiformat /dev/mtd18 -f openwrt-ipq50xx-arm-redmi_ax3000-squashfs-nand-factory.ubi
165+
nvram set flag_try_sys1_failed=0
166+
nvram set flag_boot_rootfs=0
167+
nvram set flag_last_success=0
168+
nvram commit
169+
fi
170+
171+
# Reboot
172+
reboot
173+
```
174+
175+
## Related links
176+
177+
[`openwrt/openwrt`](https://github.com/openwrt/openwrt) - Openwrt official repository
178+
179+
[`qsdk`](https://git.codelinaro.org/clo/qsdk) - QSDK official repository
180+
181+
[`quic/qca-sdk-nss-fw`](https://github.com/quic/qca-sdk-nss-fw) - NSS firmware
182+
183+
[`quic/upstream-wifi-fw`](https://github.com/quic/upstream-wifi-fw) - WiFi firmware
184+
185+
[`qca/qca-swiss-army-knife`](https://github.com/qca/qca-swiss-army-knife) - BDF tools
186+
187+
[`Telecominfraproject/wlan-ap`](https://github.com/Telecominfraproject/wlan-ap) - another Openwrt which support `ipq50xx`

0 commit comments

Comments
 (0)