This release is a pre-release and may not be stable for production use.
HiveMind-presence
Local-network presence and discovery for HiveMind nodes. A node announces itself on the LAN so satellites can find the hub without being told its IP address, and a satellite scans the LAN to discover reachable hubs.
It sits next to hivemind-core
(the hub) and the client libraries. The hub advertises its WebSocket address with
hivemind-presence announce. A client uses hivemind-presence scan (or the
LocalDiscovery API) to locate it and open a connection.
Discovery transports
- mDNS / Zeroconf: multicast DNS service discovery. The optional
zeroconfdependency is LGPL and imported lazily. Install it to enable mDNS. - UPnP / SSDP: an SSDP server advertises a UPnP device descriptor. The scanner discovers it over SSDP.
The roadmap moves the default transport to HiveBeacon, a zero-dependency UDP
broadcast beacon absorbed from the archived HiveBeacon project, and keeps mDNS
as an optional transport. UPnP is being retired. Until the beacon transport
ships, mDNS and UPnP are the available transports.
Prerequisites
- Python 3.10+
- A HiveMind hub (
hivemind-core) reachable on the LAN forscanto find anything. - For mDNS: the optional
zeroconfpackage (pip install zeroconf). Without it, announce/scan silently fall back to UPnP only.
Install
pip install hivemind-presence
From source:
git clone https://github.com/JarbasHiveMind/HiveMind-presence
cd HiveMind-presence
pip install -e .
To include mDNS support:
pip install hivemind-presence zeroconf
Quickstart
On the hub (advertise the node):
hivemind-presence announce --port 5678 --name living_room
On a satellite (discover hubs on the LAN):
hivemind-presence scan
HiveMind Nodes
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━┓
┃ Friendly Name ┃ Host ┃ Port ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━┩
│ living_room │ 192.168.1.9 │ 5678 │
│ kitchen │ 192.168.1.13 │ 5678 │
└───────────────┴──────────────┴──────┘
Both announce and scan use mDNS by default (--zeroconf true --upnp false).
Pass --upnp true to add the UPnP/SSDP transport.
Programmatic use
Announce from a hub process:
from hivemind_presence import LocalPresence
presence = LocalPresence(port=5678, name="living_room")
presence.start()
# ... run your hub ...
presence.stop()
Discover and connect from a client:
from hivemind_presence import LocalDiscovery
disc = LocalDiscovery()
for node in disc.scan(timeout=25):
bus = node.connect(key="my-access-key", crypto_key="my-crypto-key")
break
HiveMindNode.connect() returns a running HiveMessageBusClient connected to the
discovered hub.
Configuration
announce and scan options:
| Option | Default | Description |
|---|---|---|
--port |
5678 |
HiveMind WebSocket port to advertise (announce only). |
--name |
HiveMind-Node |
Friendly device name (announce only). |
--service-type |
HiveMind-websocket |
Service identifier matched between announce and scan. |
--zeroconf |
true |
Use the mDNS/Zeroconf transport. |
--upnp |
false |
Use the UPnP/SSDP transport. |
--ssl |
false |
Advertise SSL support (announce only). |
At least one transport must be enabled for scan. LocalDiscovery raises an
error if both are disabled.
Documentation
See docs/:
- How it works: the announce/scan flow and the transports.
- Configuration reference: every CLI option and API argument.
- Examples: discover-then-connect, hub announce loop.
License
MIT
Metadata
Release files for hivemind-presence 0.0.6a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hivemind_presence-0.0.6a1.tar.gz | 17.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hivemind_presence-0.0.6a1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 35.1 kB
Release files / hivemind_presence-0.0.6a1.tar.gz
| Download URL | hivemind_presence-0.0.6a1.tar.gz |
|---|---|
| Size | 17.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b7e7713fe1a357f69e2f7513d20838a070417c7fe250931e79c57c7040cdcbda
|
|
BLAKE2b-256 checksum How to use checksums |
e464ed2017e8768a23f7643255f78cda009002da9bbc8ccd06742db49709253e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hivemind_presence-0.0.6a1-py3-none-any.whl
| Download URL | hivemind_presence-0.0.6a1-py3-none-any.whl |
|---|---|
| Size | 18.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
051d4140dd762491bbc6e26fedeeba971a5da7ce534e9e6a659ae3ef789987a7
|
|
BLAKE2b-256 checksum How to use checksums |
4e476bd60f2a312b13d64b706db79c712ed464414af37317df87717515842d06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|