Skip to content

Commit bdd6e91

Browse files
committed
Add Readme
1 parent 8cb516f commit bdd6e91

File tree

1 file changed

+186
-0
lines changed

1 file changed

+186
-0
lines changed

README.md

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

0 commit comments

Comments
 (0)