Skip to main content

Library to retrieve information from a Telstra Smart Modem.

Project description

Telstra Smart Modem - Python library

This library provides a Python 3 interface to query information from a Telstra Smart Modem (Gen 2).

Tested with

  • Telstra Smart Modem (Gen 2):
    • Model: Technicolor DJA0231
    • Firmware: 18.1.c.0443-950-RB

Current features

  • Retrieving online status (Online, Backup & Offline)
  • Retrieving connected devices:
    • Checking if a device is connected
    • Retrieving information of seen device's (ipv4, ipv6, hostname, mac, connection type, ethernet port)

Links

Installation

Requirements

Methods

PIP

pip install telstra-smart-modem

Usage

Initialization

import telstra_smart_modem

IP = '192.168.0.1'
USERNAME = 'admin'
PASSWORD = 'Telstra'

# Create tsm (Telstra Smart Modem) modem object:
tsm = telstra_smart_modem.Modem(IP, USERNAME, PASSWORD)

Devices

# Get current devices object from modem:
>>> clients = tsm.getDevices()

# Get list of seen devices:
>>> clients.devices
[
	{
		'online': False,
		'hostname': 'host1',
		'ipv4': None,
		'ipv6': [],
		'mac': '00:00:00:00:00:01',
		'connection': 'wireless - 5GHz',
		'eth-port': None
	},
	{
		'online': True,
		'hostname': 'host2',
		'ipv4': '192.168.0.3',
		'ipv6': [
			'2001:0db8:0000:0000:0000:8a2e:0370:7334'
		],
		'mac': '00:00:00:00:00:02',
		'connection': 'ethernet',
		'eth-port': 2
	}
]

# Get specific device by mac address:
>>> clients.getDevice("00:00:00:00:00:01")
{
	'online': False,
	'hostname': 'host1',
	'ipv4': None,
	'ipv6': [],
	'mac': '00:00:00:00:00:01',
	'connection': 'ethernet',
	'eth-port': 2
}

# Check if a device is currently connected:
>>> clients.isOnline("00:00:00:00:00:02")
True
>>> clients.isOnline("11:11:11:11:11:11")
False

Online status

# Returns 'online' if the modem is connected through the WAN port.
# Returns 'backup' if the WAN connection is down and the 4G backup is active.
# Returns 'offline' if both the WAN and 4G connections are down.

>>> tsm.getModemStatus()
online

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

telstra-smart-modem-1.0.1.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

telstra_smart_modem-1.0.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file telstra-smart-modem-1.0.1.tar.gz.

File metadata

  • Download URL: telstra-smart-modem-1.0.1.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for telstra-smart-modem-1.0.1.tar.gz
Algorithm Hash digest
SHA256 436ee1e8ad3b30644c3efab81c39add08ff12e4064fbe994033cfbdc7d703005
MD5 ac104fb7dcfd99be3fcac3c6a4d5a8e2
BLAKE2b-256 16d2977c3d5c85db1af91e5d5b5f028a4cc9deb139de1f2f0e76043a7e1efaf2

See more details on using hashes here.

File details

Details for the file telstra_smart_modem-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: telstra_smart_modem-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for telstra_smart_modem-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6efd569373d5372b714faa7da781a7717594b74271e258e2039244bd6449495f
MD5 49c626086029c4c73656771efcf7028a
BLAKE2b-256 db6b92b7d74bb8fef36bad7419b08b65ed9bd26de11125c2e292d382a2398cd9

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