用于打开/关闭Compal cabelmodem(CH7465LG/Zigo连接盒)wifi模块的CLI工具

compal-wifi-switch的Python项目详细描述


Compal Wifi交换机

PyPIPyPI - Python Versionlicense

BuildDeploy release

用于打开/关闭Compal-CH7465LG cablemodem的wifi信号的命令行工具。在

Turn wifi signal off when not in use!Compal-CH7465LG cablemodem front with UPC designCompal-CH7465LG cablemodem back

出于健康和安全考虑,不应该关闭Wifi。 不幸的是,Compal-CH7465LG cablemodem没有提供打开/关闭wifi信号的物理按钮。 也没有配置可根据时间表打开/关闭wifi信号。在

compal wifi切换工具可以通过命令行界面打开/关闭wifi信号。 该工具可以安装在Python3运行时可用的任何设备上(NAS、Raspberry Pi等)。 要计划compal wifi交换机,您可以使用任何调度机制(例如cron、Synology任务调度器等)。在

安装

使用pip

  1. 安装python3.7或更高版本
  2. 使用pip install compal-wifi-switch安装compal wifi交换机。在
  3. 使用compal-wifi-switch --help运行compal wifi交换机。在

无pip(例如在Synology DSM上)

  1. PyPi下载包(焦油gz)到你的服务器。在
  2. 运行以下命令:
# 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

学分

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何获取所有链接并使用SeleniumWebDriver逐个单击这些链接   java中数组列表的arraylist移位元素   java如何存储具有不同类型参数的元素   java不能使用List<Future<?>>当从不同位置调用时,在方法参数中   java我应该如何修复代码以避免测试代码出错?   安卓 PreferenceFragment java。lang.RuntimeException   java在运行emulator时发现错误   java取消多个AsyncTask回调的有效方法是什么?如果中途满足条件,这些回调将在将来返回?   有没有办法在运行时将方法动态分配给Java类?   java如何将propertyfile与GlassFish一起使用   如何在PHP中使用bcrypt对密码进行哈希处理?   Java和UDP web服务器   java JPA允许EntityListeners执行JPA操作吗?   java执行do while语句时不会产生错误   java无法在edittext中显示数据库中的数据   java Tomcat中活动会话的数量   java在何处使用@SuppressWarnings(“requestfactory”)   netty连接中的java HornetQ异常