一、官方刷机

  1. 下载 ROM
  2. 准备一个系统格式为 FAT 或 FAT32 的 U 盘
  3. 将下载好的 ROM 包放到 U 盘的根目录下,并命名为 miwifi.bin
  4. 对于指示灯为红色闪烁或者红色常亮的情况,直接将 U 盘插入路由器的 USB 接口,用细长的工具按住 reset,待路由器指示灯变为黄灯闪烁时,松开 reset;对于指示灯为其他状态的情况,需要先断开路由器的电源后,将 U 盘插入路由器的 USB 接口,用细长的工具按住 reset,接通电源,待路由器指示灯变为黄灯闪烁时,松开 reset
  5. 大约 3-5 分钟后,指示灯变成黄色常亮状态时可以拔掉 U 盘,此时刷机已经完成正在重启,稍等片刻路由器指示灯变蓝就可以正常使用了

如果在刷机过程中,指示灯黄灯闪烁几秒后变为黄灯常亮状态,说明此次 U 盘刷机过程失败,请检查以上的刷机过程并重新进行刷机操作

二、开启 SSH

  1. 下载 工具包
  2. 请将下载的工具包 bin 文件复制到 U 盘(FAT/FAT32 格式)的根目录下,保证文件名为 miwifi_ssh.bin
  3. 断开小米路由器的电源,将 U 盘插入 USB 接口
  4. 按住 reset 按钮之后重新接入电源,指示灯变为黄色闪烁状态即可松开 reset
  5. 等待 3-5 秒后安装完成之后,小米路由器会自动重启,之后就可以尽情折腾啦

三、安装 opkg

1.使用ssh工具登陆路由器

2.开始安装

1
curl https://dco.gitee.io/file/openwrt/dco_entware_miwifi_R3D.sh | /bin/sh

如果运行失败,浏览器打开https://dco.gitee.io/file/openwrt/dco_entware_miwifi_R3D.sh,Ctrl+S保存这个文件

文件内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/sh

unset LD_LIBRARY_PATH
unset LD_PRELOAD

# For miwifi HD R3D

echo "Info: https://dco.gitee.io/"
echo "Info: For miwifi HD R3D"
echo "Info: Checking for prerequisites and creating folders..."

if [ -d /userdisk/data/opt ]
then
echo "Warning: Folder /userdisk/data/opt exists!"
else
mkdir -p /userdisk/data/opt
mount -o bind /userdisk/data/opt /opt
fi
# no need to create many folders. entware-opt package creates most
for folder in bin etc lib/opkg tmp var/lock
do
if [ -d "/opt/$folder" ]
then
echo "Warning: Folder /opt/$folder exists!"
echo "Warning: If something goes wrong please clean /opt folder and try again."
else
mkdir -p /opt/$folder
fi
done

echo "Info: Opkg package manager deployment..."
DLOADER="ld-linux.so.3"
URL=http://bin.entware.net/armv7sf-k3.2/installer
wget $URL/opkg -O /opt/bin/opkg
chmod 755 /opt/bin/opkg
wget $URL/opkg.conf -O /opt/etc/opkg.conf
wget $URL/ld-2.27.so -O /opt/lib/ld-2.27.so
wget $URL/libc-2.27.so -O /opt/lib/libc-2.27.so
wget $URL/libgcc_s.so.1 -O /opt/lib/libgcc_s.so.1
wget $URL/libpthread-2.27.so -O /opt/lib/libpthread-2.27.so
cd /opt/lib
chmod 755 ld-2.27.so
ln -s ld-2.27.so $DLOADER
ln -s libc-2.27.so libc.so.6
ln -s libpthread-2.27.so libpthread.so.0

echo "Info: Basic packages installation..."
/opt/bin/opkg update
/opt/bin/opkg install entware-opt

# Fix for multiuser environment
chmod 777 /opt/tmp

# now try create symlinks - it is a std installation
if [ -f /etc/passwd ]
then
ln -sf /etc/passwd /opt/etc/passwd
else
cp /opt/etc/passwd.1 /opt/etc/passwd
fi

if [ -f /etc/group ]
then
ln -sf /etc/group /opt/etc/group
else
cp /opt/etc/group.1 /opt/etc/group
fi

if [ -f /etc/shells ]
then
ln -sf /etc/shells /opt/etc/shells
else
cp /opt/etc/shells.1 /opt/etc/shells
fi

if [ -f /etc/shadow ]
then
ln -sf /etc/shadow /opt/etc/shadow
fi

if [ -f /etc/gshadow ]
then
ln -sf /etc/gshadow /opt/etc/gshadow
fi

if [ -f /etc/localtime ]
then
ln -sf /etc/localtime /opt/etc/localtime
fi

curl -s -o /etc/init.d/dco.openwrt https://dco.gitee.io/file/openwrt/dco.openwrt
chmod 777 /etc/init.d/dco.openwrt
/etc/init.d/dco.openwrt enable

curl -s -o /opt/bin/dco.PATH https://dco.gitee.io/file/openwrt/dco.PATH
chmod 777 /opt/bin/dco.PATH
/opt/bin/dco.PATH

echo "Info: Congratulations!"
echo "Info: If there are no errors above then Entware was successfully initialized."
echo "Info: https://dco.gitee.io/"
echo "Info: Found a Bug? Please report at https://dco.gitee.io/"
echo "Info: Found a bug? Please report at https://entware.net/"

curl -s https://dco.gitee.io/file/openwrt/information.txt | /bin/cat

for i in `seq -w 60 -1 1`
do
echo -ne "瀹夎瀹屾瘯锛佽矾鐢卞櫒灏嗗湪$i绉掑悗閲嶅惎\r";
sleep 1;
done
reboot

3.等待路由器重启,验证安装是否成功。

1
opkg update

出现一下输出即成功:

1
2
Downloading http://bin.entware.net/armv7sf-k3.2/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/entware

安装pathon3

1
opkg install python3

4.安装MT3.0工具箱

1
curl -s -k https://www.misstar.com/download/$(uname -m)/mtinstall -o /tmp/mtinstall && chmod +x /tmp/mtinstall && /tmp/mtinstall

然后通过输入以下脚本,安装mt工具箱

一键安装命令:

[wget](https://so.csdn.net/so/search?q=wget&spm=1001.2101.3001.7020) http://cloud.lifeheart.cn:188/miwifi/MP/install.sh -O /tmp/install.sh && chmod +x /tmp/install.sh && /tmp/install.sh

支持路由型号R1D R2D R3D R3 R1CM R3P

根据您的路由器型号,使用安装/卸载命令

一键卸载命令:

wget http://cloud.lifeheart.cn:188/miwifi/MP/uninstall.sh -O /tmp/uninstall.sh && chmod +x /tmp/uninstall.sh && /tmp/uninstall.sh

重启路由后无法访问插件页面执行此命令:

wget http://cloud.lifeheart.cn:188/miwifi/MP/repair.sh -O /tmp/repair.sh && chmod +x /tmp/repair.sh && /tmp/repair.sh

Misstar Tools 页面修复:

wget http://cloud.lifeheart.cn:188/miwifi/MT/tools/appstore/update/index2.mt -O /tmp/index2.lua

cp /tmp/index2.lua /usr/lib/lua/luci/controller/web/index2.lua

rm -rf /tmp/luci-modulecache

rm -rf /tmp/luci-indexcache