Lightweight Wire.Band client for IoT gateway hardware — Raspberry Pi, NVIDIA Jetson, industrial PCs
Project description
wire-band-edge
Lightweight Wire.Band client for IoT gateway hardware — Raspberry Pi, NVIDIA Jetson, industrial PCs, any Linux SBC.
Runs close to your devices: subscribes to an MQTT broker, classifies each message into a typed semantic frame, buffers locally during connectivity loss, and forwards compressed event batches to a Wire.Band backend over HTTP.
Features
- Zero private dependencies — installs anywhere with
pip install wire-band-edge - MQTT bridge — subscribes to topic patterns, classifies + compresses each message
- Local ring buffer — survives network interruptions; events are retried with exponential backoff
- Delta filtering — suppress sensor readings that haven't meaningfully changed (configurable threshold)
- Semantic classification — maps MQTT topic paths and payload keys to typed IoT symbols (sensor, actuator, GPIO, edge lifecycle, metrics, geographic)
- Async throughout — built on
asyncio+httpx; non-blocking on constrained hardware
Installation
# Core client (HTTP flush only)
pip install wire-band-edge
# With MQTT broker support
pip install "wire-band-edge[mqtt]"
Python 3.10+ required.
Quick Start
CLI (after install)
# Basic — bridge all topics to a local backend
wire-band-edge --broker mqtt://localhost:1883 --backend http://localhost:8000
# With device ID and delta filtering
wire-band-edge \
--broker mqtt://broker.example.com:1883 \
--topics "sensors/#" "machines/#" \
--device-id factory-rpi4 \
--delta-threshold 0.02 \
--backend http://my-wireband-server:8000
# Or with python -m
python -m wire_band_edge --help
Full MQTT gateway
import asyncio
from wire_band_edge import WireBandEdgeClient, MQTTConnector
async def main():
client = WireBandEdgeClient(
backend_url="http://your-wireband-server:8000",
device_id="factory-floor-rpi4",
delta_threshold=0.02, # suppress readings with <2% change
)
connector = MQTTConnector("mqtt://localhost:1883")
await client.run_mqtt(connector, topics=["sensors/#", "machines/#"])
asyncio.run(main())
Programmatic ingest (serial drivers, custom sensors)
import asyncio
from wire_band_edge import WireBandEdgeClient
async def main():
async with WireBandEdgeClient(
backend_url="http://your-wireband-server:8000",
device_id="serial-node-01",
) as client:
await client.ingest({"temp": 72.3, "humidity": 45.1}, topic="env/zone-a")
await client.ingest({"rpm": 1420, "current": 3.2}, topic="motor/spindle")
asyncio.run(main())
TLS broker with authentication
connector = MQTTConnector(
broker_url="mqtts://broker.example.com:8883",
username="gateway",
password="secret",
delta_threshold=0.01,
)
Configuration
WireBandEdgeClient
| Parameter | Default | Description |
|---|---|---|
backend_url |
http://localhost:8000 |
Wire.Band backend URL |
device_id |
edge-node |
Unique gateway identifier |
api_key |
None |
Bearer token for backend auth |
buffer_size |
50000 |
Local ring buffer capacity (events) |
flush_interval |
1.0 |
Flush attempt interval (seconds) |
flush_batch |
200 |
Max events per HTTP request |
max_retries |
3 |
Retry attempts before backoff |
backoff_base |
2.0 |
Exponential backoff base (seconds) |
delta_threshold |
0.0 |
Numeric delta filter threshold (0 = forward all) |
MQTTConnector
| Parameter | Default | Description |
|---|---|---|
broker_url |
mqtt://localhost:1883 |
Broker URL (mqtt:// or mqtts://) |
client_id |
wire-band-connector |
MQTT client identifier |
username |
None |
Broker username |
password |
None |
Broker password |
keepalive |
60 |
MQTT keepalive interval (seconds) |
max_queue_size |
10000 |
Max buffered events before drop |
delta_threshold |
0.0 |
Numeric delta filter threshold |
Semantic Classification
Each MQTT message is automatically classified to a typed symbol based on the topic path and payload keys. Classifications are prioritised in order:
- Exact topic overrides (
register_topic_symbol) - Topic path keyword matching (rightmost segment first)
- Payload key heuristics
- Fallback: generic sensor poll
Topic keyword examples:
| Topic contains | Symbol type |
|---|---|
temp, temperature |
Hardware Sensor — Temperature |
humidity, pressure, voltage, current |
Hardware Sensor |
motor, servo, relay, led, buzzer |
Hardware Actuator |
gpio, pin, pwm, adc, dac |
Hardware GPIO |
ota, update, watchdog, twin, shadow |
Edge Lifecycle |
metrics, telemetry, counter, event |
Metrics |
Register custom mappings at runtime:
connector.register_topic_symbol("factory/line-1/emergency-stop", 0xFC6D) # SENSOR_ALERT
connector.register_keyword_symbol("spindle", 0xFC90) # ACTUATOR_MOTOR_START
Stats
Both WireBandEdgeClient and MQTTConnector expose a .stats() method:
print(client.stats())
# {
# "events_ingested": 14823,
# "events_flushed": 14800,
# "events_dropped": 0,
# "flush_errors": 0,
# "bytes_sent": 187432,
# "buffer_depth": 23,
# "buffer_capacity": 50000,
# "uptime_seconds": 3612.4,
# "device_id": "factory-floor-rpi4",
# "backend_url": "http://your-wireband-server:8000"
# }
print(connector.stats())
# {
# "messages_received": 14823,
# "messages_compressed": 14823,
# "messages_delta_filtered": 412,
# "bytes_in": 1923441,
# "bytes_out": 187432,
# "compression_ratio": 10.27,
# "connected": true,
# "uptime_seconds": 3612.4
# }
Links
- Homepage: https://wire.band
- Repository: https://github.com/maco144/wireband
- Issues: https://github.com/maco144/wireband/issues
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wire_band_edge-0.1.0.tar.gz.
File metadata
- Download URL: wire_band_edge-0.1.0.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c2fc9ebc90cfe73845414e767bfdf2ed3fa79e2088cefd6578b68dd61c3d89b
|
|
| MD5 |
426c61b577a636b6763cb55ded023490
|
|
| BLAKE2b-256 |
b51d55f462efb698574c3eb27ec2db1bdb06ee781b6724e1180829beb56c86a0
|
File details
Details for the file wire_band_edge-0.1.0-py3-none-any.whl.
File metadata
- Download URL: wire_band_edge-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc418fa8de3eb4d8ec9b5750b4bc1ea84b1bc29ecc9801a37325b0ce2e64ab8f
|
|
| MD5 |
992c685fa77bf4b8af57f8881479d1fa
|
|
| BLAKE2b-256 |
92863797c20385badc33e2bf85ba54d9cd7df1873796eb62ed3b4fc3500a9a6c
|