Skip to main content

Experimental client for the TP-Link M7350 local web interface

Project description

tplink-m7350-client

Small Python client experiments for the TP-Link M7350 local web interface.

This is an unofficial project and is not affiliated with, endorsed by, or supported by TP-Link.

Current Scope

This is a starter client for the local auth_cgi / web_cgi interface.

Implemented now:

  • base64-wrapped JSON request/response codec
  • encrypted/signed JSON codec for GDPR-capable firmware
  • auth load call: {"module":"authenticator","action":0}
  • login digest flow using md5("<password>:<nonce>")
  • local token storage and injection into later request payloads
  • Status page helper for settings.html#Status
  • small CLI for quick experiments

Still to port:

  • higher-level helpers for SMS, connection, and reboot actions

Encrypted firmware support uses cryptography for AES-CBC.

Quick Checks

PYTHONPATH=src .venv/bin/python -m unittest discover -s tests

Status Example

Create or edit examples/.env:

TPLINK_M7350_IP=192.168.0.1
TPLINK_M7350_PORT=80
TPLINK_M7350_PASSWORD='your-router-password'
TPLINK_M7350_RATE_UNIT=KB/s

Then print the friendly Status JSON:

PYTHONPATH=src .venv/bin/python examples/status.py
PYTHONPATH=src .venv/bin/python examples/status.py --rate-unit auto

TPLINK_M7350_RATE_UNIT controls both upstream and downstream rate units. Allowed values are auto, B/s, KB/s, and MB/s; the default is KB/s.

The client sends a small curl-shaped HTTP request and intentionally omits Connection: close, because some simple ESP32 TCP proxies close the request without a response when that header is present.

CLI Examples

PYTHONPATH=src .venv/bin/python -m tplink_m7350_client.cli --env-file examples/.env load-auth
PYTHONPATH=src .venv/bin/python -m tplink_m7350_client.cli --env-file examples/.env login
PYTHONPATH=src .venv/bin/python -m tplink_m7350_client.cli --env-file examples/.env status
PYTHONPATH=src .venv/bin/python -m tplink_m7350_client.cli --env-file examples/.env --port 8080 status
PYTHONPATH=src .venv/bin/python -m tplink_m7350_client.cli --env-file examples/.env status --rate-unit MB/s
PYTHONPATH=src .venv/bin/python -m tplink_m7350_client.cli --env-file examples/.env status --raw
PYTHONPATH=src .venv/bin/python -m tplink_m7350_client.cli call webServer 0 --no-auth

The settings.html#Status page is backed by:

{"module":"status","action":0}

That response contains the connection, Wi-Fi, client count, and traffic statistics shown on the Status screen.

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

tplink_m7350_client-0.1.3.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tplink_m7350_client-0.1.3-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

Supported by

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