用于打开/关闭Compal cabelmodem(CH7465LG/Zigo连接盒)wifi模块的CLI工具
compal-wifi-switch的Python项目详细描述
Compal Wifi交换机
用于打开/关闭Compal-CH7465LG cablemodem的wifi信号的命令行工具。在
出于健康和安全考虑,不应该关闭Wifi。 不幸的是,Compal-CH7465LG cablemodem没有提供打开/关闭wifi信号的物理按钮。 也没有配置可根据时间表打开/关闭wifi信号。在
compal wifi切换工具可以通过命令行界面打开/关闭wifi信号。 该工具可以安装在Python3运行时可用的任何设备上(NAS、Raspberry Pi等)。 要计划compal wifi交换机,您可以使用任何调度机制(例如cron、Synology任务调度器等)。在
安装
使用pip
- 安装python3.7或更高版本
- 使用
pip install compal-wifi-switch
安装compal wifi交换机。在 - 使用
compal-wifi-switch --help
运行compal wifi交换机。在
无pip(例如在Synology DSM上)
- 从PyPi下载包(焦油gz)到你的服务器。在
- 运行以下命令:
# Install
user@dsm:~> tar xfv compal-wifi-switch-<version>.tar.gz
user@dsm:~> cd compal-wifi-switch-<version>
user@dsm:~/compal-wifi-switch> python3 setup.py install --user
# Run
user@dsm:~> python3 ~/compal-wifi-switch-<version>/compal_wifi_switch/main.py --help
使用
一般语法
^{pr2}$命令开关
用法
usage: compal-wifi-switch switch [-h] [--band {2g,5g,all}] [--guest [GUEST ...]]
[--pause PAUSE] [--host HOST] [--password PASSWORD]
[--verbose]
{on,off}
positional arguments:
switch
{on,off}
optional arguments:
-h, --help show this help message and exit
--band {2g,5g,all}, -b {2g,5g,all}
band to switch power state for (default = all)
--guest [GUEST ...], -g [GUEST ...]
list of guest network mac-addresses to activate while
switching ON wifi
--pause PAUSE, -p PAUSE
number of seconds to pause after wifi state change
(default = 45); when the pause is too short, the
following modem commands may block forever
--host HOST host name or IP of compal cablemodem, or use env
variable COMPAL_WIFI_SWITCH_HOST
--password PASSWORD password of compal cablemodem, or use env variable
COMPAL_WIFI_SWITCH_PASSWORD
--verbose verbose logging
示例
要启用2GHz频段的wifi信号,包括激活来宾网络,请使用以下命令:
> compal-wifi-switch switch on --host 192.168.0.1 --password <YOUR_PW> --band 2g --guest 92:5C:34:DD:6F:0A
Switching wifi ON (band = 2g)
Activating guest networks 92:5C:34:DD:6F:0A
命令状态
用法
usage: compal-wifi-switch status [-h] --host HOST --password PASSWORD [--verbose]
positional arguments:
status
optional arguments:
-h, --help show this help message and exit
--host HOST host name or IP of compal cablemodem, or use env
variable COMPAL_WIFI_SWITCH_HOST
--password PASSWORD password of compal cablemodem, or use env variable
COMPAL_WIFI_SWITCH_PASSWORD
--verbose verbose logging
示例
要显示wifi信号的状态,请使用以下命令:
> compal-wifi-switch status --host 192.168.0.1 --password <YOUR_PW>
====================================================
WIFI BANDS
====================================================
State Band Hidden SSID
----- ---- ------ ----------------
ON 2g OFF FRIMTEC
OFF 5g OFF FRIMTEC
====================================================
WIFI GUEST NETWORKS
====================================================
State Band MAC Hidden SSID
----- ---- ----------------- ------ ----------------
ON 2g 92:5C:34:DD:6F:0A OFF FRIMTEC-GUEST
OFF 5g 92:5C:44:DD:6D:CA OFF FRIMTEC-GUEST
学分
- 使用compal_CH7465LG_pyby ties与Compal电缆调制解调器通信。在
- 项目
标签: