Python UDP 30303 Discovery Library
Summary
An async python library to perform UDP network discovery.
Protocols Supported
There are 3 protocols supported by this library:
30303 - Simple and basic
wiznet - Wiznet devices, does not fully decode the packet (yet)
ecowitt - Ecowitt weather stations
Notes on the 30303 Protocol
When you perform a 303030 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 4 modes. Default mode is “basic_30303”.
- send_discovery(“basic_30303”)
Sends “Discovery: Who is out there?”
- send_discovery(“simple_30303”)
Sends “D”
- send_discovery(“wiznet”)
Sends “FIND” (requires reply port bound to 5001)
- send_discovery(“ecowitt”)
Sends an ecowitt CMD_BROADCAST, requires reply port bound to 59387
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.3.0
Changelog
v0.3.0 (2021-11-27)
v0.2.0 (2021-11-14)
Add run_d30303_discovery class to simplify usage
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)
Metadata
Release files for py30303-disc 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| py30303_disc-0.3.0.tar.gz | 16.9 kB | Without provenance | Details for py30303_disc-0.3.0.tar.gz |
Release files / py30303_disc-0.3.0.tar.gz
| Download URL | py30303_disc-0.3.0.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
23c627a23604d494f96a5015be27550c0014b4a9138fb1f5a516b2b38b5977b4
|
|
BLAKE2b-256 checksum How to use checksums |
6a6d82b7319f5caacf2b03874cb326d741e04ec0067ae24a3a1f178171fb2236
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
|
Security for py30303-disc 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.