Simple TR64 UPnP

Release v1.0.6. (Installation)

This Python library supports the discovery of UPnP devices in the local network and let you execute actions on them if the device supports any. Also it contains a convenient way to execute TR64 protocol actions on routers or other network devices which supports TR64.

TR 64 is a protocol designed to communicate with devices which provides Internet connectivity like DSL or cable routers, also several Wifi routers do support it. The protocol is based on the UPnP standard, it just adds several service types and actions how to configure and monitor a device. TR64 is based on the UPnP standard like and very generic.

What I do with this library is to check regularly if certain Wifi devices are online as my Home-automation is based on profiles if someone is at home or not.

Discover and execute:

>>> results =
>>> print(results[0])
LOC: SRV: urn:dslforum-org:device:InternetGatewayDevice:1
>>> device = simpletr64.DeviceTR64(hostname=, port=49000)
>>> device.execute("/upnp/control/hosts", "urn:dslforum-org:service:Hosts:1", "GetGenericHostEntry", NewIndex=1)
{'NewActive': '0', 'NewIPAddress': '', 'NewMACAddress': '9C:20:7B:E7:FF:5F', 'NewInterfaceType':
    'Ethernet', 'NewHostName': 'Apple-TV', 'NewAddressSource': 'DHCP', 'NewLeaseTimeRemaining': '0'}

or even easier, execute:

>>> device = System("")
>>> device.setupTR64Device("")
>>> print(device.getSystemInfo().manufactureName)

On the command line:

$ upnp_tools discover

Indices and tables