小米路由器组成的 mesh 网络,如何定时重启子路由呢?

31 天前
 memcache
977 次点击
所在节点    问与答
6 条回复
n2l
31 天前
可以上软路由,然后小米路由器做 AP ,之前我用 3 个 AX3000T 组网,其中一个拨号,结果总是掉线,待机量也就 20 几个,后来换成软路由拨号就好了,
datocp
31 天前
这种有 ssh 最好,可以自己在其它路由用 sshpass 进行远程登录重启

sshpass -p 'your_password' ssh user@remote_host 'sudo reboot'

其它的分析网页的有点麻烦,但是当年也尝试成功了。


Reboot TP-Link Router TL-WA7510N using Curl
Posted By Abir Pathak on Nov 2, 2015 | 1 comment
Tags: automated, curl, reboot, script, TL-WA7510N, tp-link, WA7510N
I have a TP-Link outdoor AP point router:
Hardware Version: WA7510N v2
It sometimes freezes and I need to manually reboot it. My downloads suffer and I am a bit OCDic about continuous downloads and no speed wasted.
So, I had been trying to find a way to have an automated process for that.
The router has this URL for rebooting it:
http://192.168.1.254:8888/userRpm/SysRebootRpm.htm?Reboot=Reboot
You need your username/password with curl:
(Make sure to replace the correct IP, port, username and password for your router)

CURL Command Line:
1
curl -D -s --header "Referer: http://192.168.1.254:8888/userRpm/SysRebootRpm.htm" -u "admin:password" "http://192.168.1.254:8888/userRpm/SysRebootRpm.htm?Reboot=Reboot"
Note: Adding referer header is very important. Without it, you will get an error:
“You have no authority to access this router”
Another way you can do this is if you can find your Authorization key.
(In case you need to keep your script out in the open. And don’t want to put your username and password for everyone to see.)
Once you login to your router in your web browser, just look at any HTTP request/response. You can use Developer tools (F12) -> Network (Chrome). Or maybe an HTTP capture tool like Fiddler, Charles etc. In any of the request/responses you capture you’ll be able to see a header like: Authorization:Basic ABCdef123456
You can use it like this:
1
curl -D -s --header "Authorization:Basic ABCdef123456" --header "Referer: http://192.168.1.254:8888/userRpm/SysRebootRpm.htm" "http://192.168.1.254:8888/userRpm/SysRebootRpm.htm?Reboot=Reboot"
No need to add username and password in this command. Unfortunately you’ll need to find your Authorization string manually.
You can also put this command in a batch script.
cxe2v
31 天前
买个小米的智能插座,定时关闭开启插座
memcache
31 天前
@n2l 那这个三个 ap 应该实现不了无感切换把?比如从 A 路由器附近走到 B 路由器附近,手机可以从 A AP 无感切换到 B AP
@datocp 小米路由器咋开启 ssh 啊
@cxe2v 这个好,简单暴力!
n2l
31 天前
@memcache 肯定中继啊,用软件测过,自动切换,
memcache
31 天前
@n2l 嗯嗯,我本来还以为普通中继会没有 mesh 路由切换那么丝滑。不过需要购入一个软路由,有一些成本,hhh

结帖了,我抓取了页面 API, 写了一个脚本,结合定时调度(如青龙),实现定时重启子路由的功能。
脚本地址: https://github.com/chenqimiao/pyMiWiFi ,有需要的朋友可以参考下

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1153918

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX