Skip to content

Commit 417d341

Browse files
committed
Add Readme
1 parent 167645a commit 417d341

File tree

1 file changed

+184
-0
lines changed

1 file changed

+184
-0
lines changed

README.md

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

0 commit comments

Comments
 (0)