wireband-edge 0.1.0

Lightweight Wire.Band client for IoT gateway hardware — Raspberry Pi, NVIDIA Jetson, industrial PCs
Documentation

wireband-edge

Lightweight Wire.Band client for IoT gateway hardware — Raspberry Pi, NVIDIA Jetson, industrial PCs.

Collects telemetry from MQTT, serial ports, BLE, Modbus, and CoAP, frames it with a 2-byte theta-symbol prefix, and flushes batches to the Wire.Band backend over HTTPS (rustls — no OpenSSL dependency).

Quick start

# MQTT gateway (default feature)
wireband-edge \
  --broker mqtt://localhost:1883 \
  --topics "sensors/#" \
  --backend https://ingest.wire.band \
  --api-key YOUR_API_KEY \
  --device-id factory-rpi4

Installation

cargo add wireband-edge
# or with all protocol connectors
cargo add wireband-edge --features "mqtt,serial,agent"

Features

Feature Description
mqtt (default) MQTT connector via rumqttc
serial UART/RS-232/RS-485 via tokio-serial
ble Bluetooth LE via btleplug
modbus Modbus TCP/RTU via tokio-modbus
coap CoAP via coap-lite
agent Device twin, OTA updates, watchdog
infer-onnx Edge inference via ONNX Runtime
infer-tflite Edge inference via TensorFlow Lite

Library usage

use wireband_edge::{WireBandClient, ClientConfig};
use wireband_edge::mqtt::MqttConnector;

#[tokio::main]
async fn main() -> wireband_edge::Result<()> {
    let config = ClientConfig {
        backend_url: "https://ingest.wire.band".into(),
        api_key:     "YOUR_API_KEY".into(),
        device_id:   "factory-rpi4".into(),
        ..Default::default()
    };
    let client = WireBandClient::new(config);
    client.start().await;

    MqttConnector::new("mqtt://localhost:1883")
        .run(client.clone(), &["sensors/#"])
        .await
}

Agent (device twin, OTA, watchdog)

use wireband_edge::agent::{DeviceTwin, OtaManager, OtaUpdate, Watchdog};
use std::time::Duration;

// Device twin — sync reported/desired state
let twin = DeviceTwin::new("factory-rpi4");
twin.update_reported(serde_json::json!({"firmware": "1.2.3"})
    .as_object().unwrap().clone()).await;
twin.sync(&client).await;

// OTA firmware update
OtaManager::new("/tmp/ota-staging")
    .run(OtaUpdate {
        url:            "https://releases.example.com/fw-1.3.0.bin".into(),
        target_path:    "/usr/local/bin/sensor-daemon".into(),
        expected_sha256: Some("abc123...".into()),
        version:        "1.3.0".into(),
    }, &client)
    .await?;

// Watchdog — kicks /dev/watchdog + emits heartbeat
tokio::spawn(Watchdog::new(Duration::from_secs(30)).run(client.clone()));

Cross-compilation

Pre-built binaries for common targets are available on the GitHub releases page.

To cross-compile yourself:

cargo install cross
cargo build-rpi4   # aarch64 (RPi 4, Jetson)
cargo build-rpi3   # armv7 (RPi 3, Zero 2)
cargo build-rpi0   # arm (RPi Zero, RPi 1)
cargo build-x86    # x86_64 Linux

License

MIT