UDP 30303 Network discovery library.
Project description
Summary
An async python library to perform UDP 30303 network discovery
Notes on the Protocol
When you perform a discovery, any device that responds will report 3 things.
IP Address
- Hostname
The hostname will be from the perspective of the device, not DNS. Often devices will have hardcoded hostnames, like a Balboa Spa WiFi will report as BWGSPA.
- MAC Address
In the form XX-XX-XX-XX-XX-XX
How to Use
pip install py30303_disc
See the example in src/py30303_disc/d30303_discover.py
The parse function has a few modes:
- parse(data, addr)
Simply decode the message, and return the tuple
- parse(data, addr, hostname=”blah”)
Only return the tuple if the hostname matches
- parse(data, addr, mac_prefix=”XX-XX-XX”)
Only return the tuple if the mac address matches the prefix given. Prefix can be of arbitrary size.
- parse(data, addr, hostname=”blah”, mac_prefix=”blah”)
Match both the hostname and the mac_prefix.
For the send_discovery() function, there are two modes. Default mode is 0.
- send_discovery(0)
Sends “Discovery: Who is out there?”
- send_discovery(1)
Sends “D”
Issues and Discussions
As usual in any GitHub based project, raise an issue if you find any bug or room for improvement (certainly there are many), or open a discussion (new feature!!) if you want to discuss or talk :-)
Version
v0.1.5
Changelog
v0.1.5 (2021-11-14)
v0.1.4 (2021-11-14)
v0.1.3 (2021-11-14)
First release on PyPI.
v0.1.2 (2021-11-13)
v0.1.1 (2021-11-13)
v0.1.0 (2021-11-13)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.