Skip to main content

Tenda 4G09 Python Client

A lightweight Python library for interacting with the Tenda 4G09 LTE router through its web interface.

Features

  • Router authentication and session management
  • Retrieving router status and Wi-Fi information
  • Reading SIM and WAN configuration
  • Detecting whether the mobile WAN connection is active
  • Requesting a mobile WAN reconnection
  • Retrieving serving cell information from the modem

Requirements

  • Python 3.10+
  • Tenda 4G09 router accessible over the local network

Installation

Install:

pip install tenda-4g09-client

Quick start

Collecting basic information.

from tenda_4g09 import Tenda4G09


URL = "192.168.0.1"

with Tenda4G09(URL, password="your-password") as router:
    status = router.get_status()

    print(f"Router IP:          {status.lan_ip}")
    print(f"Connected clients:  {status.client_count}")
    print(f"Work mode:          {status.work_mode}")
    print(f"Device name:        {status.device_name}\n")

    [print(f"{client}\n") for client in router.get_online_clients()]

output:

Router IP:          192.168.0.1
Connected clients:  3
Work mode:          3G/4G
Device name:        4G09

Client: RE605X (192.168.0.2)
  Device ID: ee:d3:##:##:##:29
  Upload: 8.05 kB/s
  Download: 30.63 kB/s
  Blocked: No
  Guest: No

Client: homeassistant (192.168.0.4)
  Device ID: b8:27:##:##:##:0a
  Upload: 0.00 kB/s
  Download: 0.00 kB/s
  Blocked: No
  Guest: No

Client: DESKTOP-AT2M0OR (192.168.0.49)
  Device ID: 34:6f:##:##:##:ef
  Upload: 27.26 kB/s
  Download: 403.56 kB/s
  Blocked: No
  Guest: No

Replace the IP address and password with your router's settings.

The mobile WAN reconnect

Check whether the router has lost its mobile WAN connection and try to reconnect.

with Tenda4G09(URL, password) as router:

    print(f"Before:\n\tMobile data connected: {router.is_mobile_data_connected()}\n")

    if not router.is_mobile_data_connected():
        router.mobile_data_connect()

    time.sleep(2)

    print(f"After:\n\tMobile data connected: {router.is_mobile_data_connected()}")

output:

Before:
        Mobile data connected: False

After:
        Mobile data connected: True

Getting the signal information from the modem

Retrieve the parameters of the serving cell connection (equivalent AT command: AT+QENG="servingcell").

with Tenda4G09(URL, password) as router:
    client = router.get_telnet_client(router.host_ip)
    print(client.get_signal_info())

output:

========== LTE SERVING CELL ==========
Connection state : NOCONN
Technology       : LTE (FDD)
MCC / MNC        : 260 / 02
Cell ID          : 0x###2512 (HEX), ###67602 (DEC)
PCI              : 334
TAC              : 0x##af (HEX), ##911 (DEC)
LTE band         : B20
EARFCN           : 6375
UL bandwidth     : 15 MHz
DL bandwidth     : 15 MHz
--------------------------------------
RSRP             : -105 dBm
RSRQ             :  -13 dB
RSSI             :  -72 dBm
SINR             : 11.0 dB
CQI              : 255
TX power         : 170 (raw value)
SRXLEV           : -
======================================

Compatibility

Designed for the Tenda 4G09 router. Compatibility with other models and firmware versions has not been verified.

Security

Use the library only on trusted networks. Do not commit router credentials to your repository.

License

MIT — see the LICENSE file.

Metadata

Release files for tenda-4g09-client 0.3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tenda-4g09-client 0.3.6
File Size Uploaded Provenance Actions
tenda_4g09_client-0.3.6.tar.gz 16.6 kB Without provenance Details for tenda_4g09_client-0.3.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tenda-4g09-client 0.3.6
File Interpreter ABI Platform Actions
tenda_4g09_client-0.3.6-py3-none-any.whl Python 3 none any Details for tenda_4g09_client-0.3.6-py3-none-any.whl

Total release size: 37.9 kB

Release files / tenda_4g09_client-0.3.6.tar.gz

Download URL tenda_4g09_client-0.3.6.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
57585f5384a5b29483c6e4cd60bef1d42a1d881a58411c061f91b1889e14d197
BLAKE2b-256 checksum
How to use checksums
59de5376f48e88d0079b7405443aef94d8a3dc2b11d69fe3049ad7048c6fd2ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / tenda_4g09_client-0.3.6-py3-none-any.whl

Download URL tenda_4g09_client-0.3.6-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eac092deee0e705556f76951bf5bb333058118654da05cefc340593230a9d5bb
BLAKE2b-256 checksum
How to use checksums
4c7d9b42185d845ca18922d56d820ed3887281c52da25e3c42e767279663e4fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for tenda-4g09-client 0.3.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page