小米路由器3刷Openwrt

小米路由器 3 的后台开始又慢又卡,中继 WiFi 时常 Bug !

开始刷机~

一、获取权限

1 下载开发版

http://bigota.miwifi.com/xiaoqiang/rom/r3/miwifi_r3_all_55ac7_2.11.20.bin 下载开发版本 2.11

2 安装开发版

进入后台–选择手动升级–导入开发版–升级

截屏2020-02-26下午3.22.11

3 开启 SSH

官网教程不成功 https://d.miwifi.com/rom/ssh?userId=35420579

工具包使用方法:小米路由器需升级到开发版0.5.28及以上,小米路由器mini需升级到开发版0.3.84及以上,小米路由器3即将支持。注意:稳定版不支持。

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

此处完全参考 openwrt.org/toh/xiaomi/mir3

登录路由器后台,进行一系列初始设置,获取 stok 值,例如 stok=8afbe612c65e43251e8a4dbff3cf67d1

在浏览器中输入下面链接操作,注意替换 stok 值,密码设置为 12345678,执行一定等到返回结果,出现 502 多试几次。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Step1 IN
http://192.168.31.1/cgi-bin/luci/;stok=eecd2646b61b9e5b724182f4c037785a/api/xqnetwork/set_wifi_ap?ssid=Xiaomi&encryption=NONE&enctype=NONE&channel=1%3Bnvram%20set%20ssh%5Fen%3D1%3B%20nvram%20commit
## Step1 OUT
{"msg":"未能连接到指定WiFi(Connecting)","code":1616}


## Step2 IN
http://192.168.31.1/cgi-bin/luci/;stok=eecd2646b61b9e5b724182f4c037785a/api/xqnetwork/set_wifi_ap?ssid=Xiaomi&encryption=NONE&enctype=NONE&channel=1%3Bsed%20%2Di%20%22%3Ax%3AN%3As%2Fif%20%5C%5B%2E%2A%5C%3B%20then%5Cn%2E%2Areturn%200%5Cn%2E%2Afi%2F%23tb%2F%3Bb%20x%22%20%2Fetc%2Finit.d%2Fdropbear
## Step2 OUT
{"msg":"未能连接到指定WiFi(Probe timeout)","code":1616}


## Step3 IN
http://192.168.31.1/cgi-bin/luci/;stok=eecd2646b61b9e5b724182f4c037785a/api/xqnetwork/set_wifi_ap?ssid=Xiaomi&encryption=NONE&enctype=NONE&channel=1%3B%2Fetc%2Finit.d%2Fdropbear%20start
## Step3 OUT
{"msg":"未能连接到指定WiFi(Probe timeout)","code":1616}


## Step4 IN
http://192.168.31.1/cgi-bin/luci/;stok=eecd2646b61b9e5b724182f4c037785a/api/xqsystem/set_name_password?oldPwd=12345678&newPwd=12345678
## Step4 OUT
{"code":0}

执行 SSH

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
ssh: connect to host 192.168.31.1 port 22: Connection refused
ashin@MacBook ~ % ssh root@192.168.31.1
The authenticity of host '192.168.31.1 (192.168.31.1)' can't be established.
RSA key fingerprint is SHA256:WI3DaBP7KYPu+1Zjvpe4x8aRrV60TFw8UiENG4X+Wbw.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.31.1' (RSA) to the list of known hosts.
root@192.168.31.1's password:


BusyBox v1.19.4 (2016-04-15 17:38:14 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

-----------------------------------------------------
Welcome to XiaoQiang!
-----------------------------------------------------
root@XiaoQiang:~#

4 激活串口

1
2
3
4
5
6
7
8
9
$ nvram set flag_last_success=1

$ nvram set boot_wait=on

$ nvram set uart_en=1

$ nvram commit

$ reboot

二、上传刷机文件

1 下载刷机文件

2 上传刷机文件

使用 scp 命令(也可以使用 FTP 工具 ),上传至 /tmp

$ scp -r ./Desktop/Router_Xiaomi/LEDE/rom root@192.168.31.1:/tmp/

  • 也可以挂 U 盘。

三、刷入包

1
2
3
4
5
6
7
8
# 进入
$ cd /tmp/rom/

$ mtd write kernel1.bin kernel1

$ mtd write rootfs0.bin rootfs0

$ reboot

四、重启

$ reboot

等待 2 分钟

1
2
3
Address: 192.168.15.1
login: root
password: admin

Enjoy~