-
Notifications
You must be signed in to change notification settings - Fork 0
Duck Types
CDP defines four node roles (DuckType in src/Ducks/DuckTypes.h): PAPA, MAMA, LINK, DETECTOR.
src/Ducks/MamaDuck.h
The workhorse of the mesh. Relays and routes packets like a PapaDuck, but doesn't require WiFi/MQTT by default, so it can run on battery-only hardware.
-
onReceiveDuckData(rxDoneCallback cb)— register a callback invoked when a packet needs to be relayed/delivered to the sketch. -
goPublic()— skip the RREQ network-discovery phase and go operational immediately. - Handles decrypting
encrypted_cmd/encrypted_data/sealed_uplink/group_broadcasttraffic addressed to it, blindly relaying anything addressed elsewhere. - Maintains a small
repliedIdentityTo_set so that if a peer sends it a directedidentity_announce, it replies with its ownannounceIdentity()once, closing the TOFU key-exchange loop within one round trip. - Tracks
consecutiveEncryptedCmdFailures_; after 3 consecutive decrypt failures onencrypted_cmd, it re-announces its identity (in case MeshBeacon Ops has a stale key for it).
src/Ducks/PapaDuck.h
The mesh's backhaul. Adds WiFi/MQTT integration on top of Mama-like relay/routing behavior, so incoming packet data can reach a broker (e.g. for MeshBeacon Ops, InfluxDB, or a custom cloud backend).
-
onReceiveDuckData(rxDoneCallback cb)— register a callback for packets received off the mesh. -
isWifiConnected()— check current WiFi status. - Defaults to WiFi enabled (
DuckWificapability); can be constructed withDuckWifiNoneif only local storage is needed. - Answers RREQ broadcasts with RREP so other Ducks can learn a route toward it.
There's also an SX1302-concentrator gateway path (a separate daemon, clusterduckd, in the meshbeacon-uplink repository) that bridges a LoRa concentrator directly to MQTT instead of running PapaDuck firmware on a single-radio board. See Radio and Regions for the uplink channel-spreading mechanism that benefits this gateway architecture.
src/Ducks/DuckLink.h
A pure edge/sensor node: no relay capability, minimal routing table interaction. Meant to sit at the edge of the mesh, sending data toward the backhaul (Mama/PapaDuck) without forwarding other nodes' traffic. You can build a mesh purely from Mama/PapaDucks, or add DuckLinks for a hybrid mesh with cheaper/simpler edge devices.
src/Ducks/DetectorDuck.h
Not a data-relay node at all — a field tool for surveying signal coverage before committing to a deployment layout.
-
onReceiveRssi(rssiCallback rssiCb)— register a callback (void (*)(const int)) that receives RSSI values as they're read off the radio. - Only responds to
ping/pong; bypasses the network-join/discovery phase entirely (run()sets it straight toNetworkState::PUBLIC).
- Pure mesh: MamaDucks + one or more PapaDucks. Every node can relay.
- Hybrid mesh: add DuckLinks at the edges where only origination (not relaying) is needed — cheaper/lower-power nodes.
- Site survey: run a DetectorDuck before finalizing node placement to check RSSI coverage.