TP-link WiFi Router Controller
Installation
pip install tp-link-controller
Usage
- Install JDK-8
- Using Chocolatey:
choco install jdk8
- Using Chocolatey:
- Download browsermob-proxy pass the binary path to
TP_Link_controllerobject.
from TPLinkController import controller
email = "xyz@examplemail.com"
password = "topSecret"
bmp_path = r"bin\browsermob-proxy-2.1.4\bin\browsermob-proxy"
tplink = controller.TP_Link_Controller(email, password, browsermobproxy_location=bmp_path, DEBUG_MODE=True)
By default chrome runs in headless mode (NO UI WILL OPEN)
If DEBUG_MODE is True or headless option is True, it will open chrome.
Note: Login before doing anything
tplink.login()
The following methods are available
- .login() -> Logins to the admin panel
- .close() -> Exits the browser and closes the proxy
- .get_status() -> Returns a dictionary with a lot of status information.
- .turn_on_2G() -> Turns on 2.4G WiFi.
- .turn_on_5G() -> Turns on 5G WiFi.
- .turn_off_2G() -> Turns off 2.4G WiFi.
- .turn_off_5G() -> Turns off 5G WiFi.
- .toggle_2g_wifi() -> Toggles 2.4G WiFi
- .toggle_5g_wifi() -> Toggles 5G WiFi
- .is_2g_on() -> Returns
Trueif 2.4G WiFi isonelseFalse. - .is_5g_on() -> Returns
Trueif 5G WiFi isonelseFalse.
- Based on Selenium.
- Uses the WebUI as you would normally do.
- Made due to the lack of any kind of API to interact with any TP-Link Routers.
Tested On:
-
- Hardware: Archer C1200 v2.0
- Firmware Version: 2.0.2 Build 20180118 rel.38979 (EU)
To get started with package dev:
- Clone the repository.
- Create a virtual environment.
- Install all the packages from requirements.txt
- Install JDK-8
- Using Chocolatey
choco install jdk8
- Download Browsermob-proxy.
- For windows, leave it as default, should work out of the box.
- Pass it to the instance in code.
-
tplink = TP_Link_Controller(email, password, browsermobproxy_location=r"bin\browsermob-proxy-2.1.4\bin\browsermob-proxy", DEBUG_MODE=True)
- Download the Chrome webdriver and place it in
./bin/folder for windows. - For Raspberry Pi install .deb packages from here. No need to set bin path, packages will be installed in right directory.
Release files for tp-link-controller 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tp-link-controller-0.0.2.tar.gz | 7.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tp_link_controller-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.1 kB
Release files / tp-link-controller-0.0.2.tar.gz
| Download URL | tp-link-controller-0.0.2.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
99602ea27a5a5cbc83f27e08b8f24e0436afa2cadcff827200c450f98da842f9
|
|
BLAKE2b-256 checksum How to use checksums |
2deaf34520a67bae5cce0ce03b756ac051b71cf4ea1e8031644ff72aed347096
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.7
|
Release files / tp_link_controller-0.0.2-py3-none-any.whl
| Download URL | tp_link_controller-0.0.2-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b39aea43c29a8a99cc370b292357ad9787401b54a712dd3cf7d3fb558df889e
|
|
BLAKE2b-256 checksum How to use checksums |
37b0e92d66e11aa35a0056acebcfc7f33c018f54cabb5e8450587860cdd73ebb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.7
|