Skip to content

Commit 5b10c50

Browse files
committed
Add Readme
1 parent 0a48a91 commit 5b10c50

File tree

1 file changed

+183
-0
lines changed

1 file changed

+183
-0
lines changed

README.md

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

0 commit comments

Comments
 (0)