CLI tool to switch on/off the wifi module of a Compal cabelmodem (CH7465LG/Ziggo Connect Box)
Project description
Compal-Wifi-Switch
A command line tool to switch on/off the wifi signal of a Compal-CH7465LG cablemodem.
Wifi radiation should be turned off if not used (better for your health and for IT security reasons). Unfortunattly the Compal-CH7465LG cablemodem does not offer a physical button to switch on/off the wifi signal. There is also no configuration available to switch the wifi signal on/off based on a time schedule.
The compal-wifi-switch tool can switch the wifi signal on/off via a command line interface. The tool can be installed on any device where Python3 runtime is available (NAS, Raspberry Pi, etc.). To schedule compal-wifi-switch you can use any scheduling mechanism (e.g. cron, Synology task scheduler, ...).
Installation
Using pip
- Install python3.7 or higher
- Install compal-wifi-switch with
pip install compal-wifi-switch
. - Run compal-wifi-switch with
compal-wifi-switch --help
.
Without pip (e.g. on Synology DSM)
- Download package from PyPi (tar.gz) to your server.
- Run the following commands:
# 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
Usage
General syntax
usage: compal-wifi-switch [-h] [--version] {status,switch} ...
Compal-Wifi-Switch configuration
optional arguments:
-h, --help show this help message and exit
--version, -v show program's version number and exit
command:
{status,switch}
status shows the current status of the cablemodem
switch switches the wifi state of the cabelmodem
Command switch
Usage
usage: compal-wifi-switch switch [-h] [--band {2g,5g,all}] [--guest [GUEST ...]] --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
--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
Example
To enable the wifi signal for the 2GHz band including the activation of the guest network, use the following command:
> 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
Command status
Usage
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
Example
To show the status of the wifi signal, use the following command:
> 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
Credits
- Using compal_CH7465LG_py by ties to communicate with Compal cable modem.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file compal-wifi-switch-1.0.2.tar.gz
.
File metadata
- Download URL: compal-wifi-switch-1.0.2.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c50424c82e21519b30e343afdbeed18de3345cff0e48b3545cacd8aa28d3b0d0 |
|
MD5 | 68cf05d1bc39381b4eea97d4425d9233 |
|
BLAKE2b-256 | 063a48899d3752ab6745a634af567b73f4cd83d9722836753f2341eeda2f03a3 |
File details
Details for the file compal_wifi_switch-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: compal_wifi_switch-1.0.2-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed19bb9ae1099ed8a0ce67144e07f8ac8df02ab928f4bf71e23775023667464a |
|
MD5 | 5b2258e7a5876a5cb0237e3a09665a33 |
|
BLAKE2b-256 | 7eb079c5fe58226543a7d3c6b264ab303a1c088eead8e4c675fce2e42227d6b1 |