Skip to main content

CLI tool to switch on/off the wifi module of a Compal cabelmodem (CH7465LG/Ziggo Connect Box)

Project description

Compal-Wifi-Switch

PyPI PyPI - Python Version license

Build Deploy release

A command line tool to switch on/off the wifi signal of a Compal-CH7465LG cablemodem.

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

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

  1. Install python3.7 or higher
  2. Install compal-wifi-switch with pip install compal-wifi-switch.
  3. Run compal-wifi-switch with compal-wifi-switch --help.

Without pip (e.g. on Synology DSM)

  1. Download package from PyPi (tar.gz) to your server.
  2. 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 ...]]
                      [--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

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>

==============================================================
 Modem
==============================================================
 Model               : CH7465LG
 HW Version          : 5.01
 SW Version          : CH7465LG-NCIP-6.12.18.26-3p4-GA-NOSH
 Serial Number       : ************
 Modem MAC Address   : **:**:**:**:**:**
 Operator ID         : LIBERTYGLOBAL
 Network Mode        : IPv4
 Uptime              : 50day(s)0h:12m:28s

==============================================================
 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

compal-wifi-switch-1.1.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

compal_wifi_switch-1.1.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file compal-wifi-switch-1.1.0.tar.gz.

File metadata

  • Download URL: compal-wifi-switch-1.1.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for compal-wifi-switch-1.1.0.tar.gz
Algorithm Hash digest
SHA256 e96eedf2d5c9ef51fe63a2ed4b2d84bff81917cb5214a9348debf580dfc612ef
MD5 8dbad24fcfdcfdd9e8983ae5cf37d5ff
BLAKE2b-256 2bf20bb0cf72b17a0158830eae33b5899f06536945c38029c69e5451357d5d4d

See more details on using hashes here.

File details

Details for the file compal_wifi_switch-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: compal_wifi_switch-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for compal_wifi_switch-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b40b28a7a38623465c8aa682aaddb65ad76288492c3adc24f41675f865b3370e
MD5 4c2b7eff4702be04a6a9e94a011daeaa
BLAKE2b-256 c5255ee3a7bbdd285419e3601366b3a479e80b2383a940fa1a6d8b179cd6ab38

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page