TSN Box Development – TSN Box 3.0 Getting Started Guide
class MyListener:
def remove_service(self, zeroconf, type, name):
print("Service %s removed" % (name,))
def add_service(self, zeroconf, type, name):
info = zeroconf.get_service_info(type, name)
print("Service %s added, service info: %s" % (name, info))
zeroconf = Zeroconf()
listener = MyListener()
browser = ServiceBrowser(zeroconf, "_http._tcp.local.", listener)
try:
input("Press enter to exit...\n\n")
except KeyboardInterrupt:
pass
finally:
zeroconf.close()
The output from the above will be:
Service tsnbox [xx:xx:xx:xx:xx:xx].http.tcp.local. added, service info: ServiceInfo(type='http.tcp.local.',
name='tsnbox [xx:xx:xx:xx:xx:xx].http.tcp.local.', address=b'xc0xa8),', port=38933, weight=0, priority=0,
server='tsnbox [xx:xx:xx:xx:xx:xx].http.tcp.local.', properties={b'ip': b'192.168.41.44', b'netmask':
b'255.255.255.0', b'type': False, b'devicemodel': b'tsnbox3', b'buildtype': False, b'tag': False, b'mac':
b'xx:xx:xx:xx:xx:xx', b'multicast': b'224.1.1.2', b'name': b'tsnbox', b'release': False})
From the info above, one can see that there is a unitrunning with IP address 192.168.41.44/24. This method will
discover any uniton the same LAN regardless of subnet. To connect to the unit, ensure that the PC's subnet
matches the one advertised; in this case, 255.255.255.0
For Windows, there are applications such as the Bonjour Browser <https://hobbyistsoftware.com/
bonjourbrowser>_ that can be used to search for running units.
2.5.4 Web Interface
Navigate to the IP address found from the discovery step above using a web browser to open a login page for the
web interface running on the unit. Current defaults are single user "admin" and default password "admin". The
following describes the sections in the web application.
Modules Configuration