找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 4514|回复: 4

[k3] k3固件定时功率/开关设置教程

[复制链接]
发表于 2018-11-16 09:50 | 显示全部楼层 |阅读模式
折腾了一晚上k3.早晨发一下心得,刷了一下tb梅林。信号比官方固件稍弱,但也没弱多少没什么大感觉。但是tb工具箱是联网的。所以万一哪天服务器挂了这个脚本估计也就GG了。自己又懒得去翻脚本备份。于是刷回了官改。但是刷过官改的朋友可能知道。官改的自动重启和关闭wifi不能用。只能在高级设置改。研究了一下。现发一下简易教程(炒冷饭2333).大佬请无视。。。ssh连路由器(怎么连接就不说了,大佬教程都有)

crontab -e 可以看到当前的定时任务



下面列出一个模板

  1. 0 0 * * * wifi 2 down && wl -i eth2 pwr_percent 8 #2.4G关闭,5G变成百分之8
  2. 0 2 * * * wifi 5 down #5G关闭
  3. 30 5 * * * wifi up #开启wifi
  4. 31 5 * * * reboot #重启
  5. 35 5 * * * wl -i eth2 pwr_percent 40 && wl -i eth1 pwr_percent 40 #2.4G和5G信号调节百分之40
复制代码


时间自己改。另附大佬推荐的验证网站:http://www.atool.org/crontab.php
提示一下:
wifiup执行后,功率会变回去
reboot执行后,功率会变回去
重启后要设置新命令要间隔2min+

摘抄的一些对我而言比较有用的东西:
或者参考官方命令(V21.6.8.46、V21.6.11.58 以上版本才支持) 数字 100 穿墙、75 正常、50 节能,可以自己修改相应数字大小来调节
2.4G

wl -i eth1 pwr_percent 75
5G

wl -i eth2 pwr_percent 100

无线设置??

# wl status
# Print information about current network association
# 查看2.4G 状态
wl -i eth1 status
# 查看5G 状态
wl -i eth2 status

# wl curpower
# Return current tx power settings
# 查看2.4G当前功率
wl -i eth1 curpower
# 查看5G当前功率
wl -i eth2 curpower

# wl txpwr_target_max
# Return current max tx target power settings.
# 查看2.4G当前最大功率
wl -i eth1 txpwr_target_max
# 查看5G当前最大功率
wl -i eth2 txpwr_target_max

# wl txpwr1
# Set tx power in in various units. Choose one of (default: dBm):
# -d dBm units (range: -32 - 31)
# -q quarter dBm units (range: -128 - 127)
# -m milliwatt units
# Can be combined with:
# -o turn on override to disable regulatory and other limitations
# 临时设置,重启恢复(胡乱设置可能损坏硬件)
# 临时设置2.4G功率 为20dBm
wl -i eth1 txpwr1 -o -d 20
# 临时设置2.4G功率 为20dBm
wl -i eth2 txpwr1 -o -d 20

计划任务
时间+命令的格式 添加到/etc/crontabs/admin里面,可以到http://www.atool.org/crontab.php网站学习验证测试
通过cru、crontab命令也可以,实质都是编辑的这个文件。
# 4点30定时重启废弃,官方已经集成
30 4 * * * /sbin/reboot # auto_reboot
# wifi控制
# 文件/opt/bin/wifi,可以完全关闭,K3功耗实测:熄屏、无USB、待机状态功耗10.8w,关闭wifi功耗6.4w
# 安装
wget -qO- http://oofxy4e74.bkt.clouddn.com/wifi|sh
# 手动控制 (单个关闭会禁用双频合一)
# 全部开启
wifi up
# 开启 2.4G
wifi 2 up
# 开启 5G
wifi 5 up
# 全部关闭
wifi down
# 关闭 2.4G(访客网络依赖2.4G)
wifi 2 down
# 关闭 5G
wifi 5 down
# 定时控制,使用/opt/bin/wifi绝对路径,添加到/etc/crontabs/admin
# 23点关闭wifi
0 23 * * * /opt/bin/wifi down
# 6点开启5G
0 6 * * * /opt/bin/wifi 5 up


A大固件帖子:
https://www.right.com.cn/forum/thread-259012-1-1.html
大部分内容摘抄自:
1.https://www.right.com.cn/forum/thread-212725-1-1.html
2.https://tbvv.net/posts/0101-k3.h ... F%E7%8E%87%EF%BC%9F
感谢大佬的无私奉献!

我的恩山、我的无线 The best wifi forum is right here.
发表于 2018-11-16 10:00 | 显示全部楼层
不错不错,拿走了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-11-16 11:03 | 显示全部楼层
官改把我那个wifi脚本集成到 /sbin/wifi 了,我去年的时候修过一个BUG,只是abc懒得更新
https://www.right.com.cn/forum/forum.php?mod=redirect&goto=findpost&ptid=259012&pid=2280713


安装到/opt/bin/wifi
  1. curl -Lksf tbvv.net/k3/wifi|sh
复制代码


我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2018-11-16 11:22 | 显示全部楼层
感谢分享。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-3-14 07:22 来自手机 | 显示全部楼层
0 0 * * * wifi 2 down && wl -i eth2 pwr_percent 8 #2.4G关闭,5G变成百分之8 0 2 * * * wifi 5 down #5G关闭 30 5 * * * wifi up #开启wifi 31 5 * * * reboot #重启 35 5 * * * wl -i eth2 pwr_percent 40 && wl -i eth1 pwr_percent 40 #2.4G和5G信号调节百分之40      也没说清楚执行命令后,取消的命令是什么啊?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-25 19:15

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表