Skip to content

Examples

Muhammad Nuzaihan edited this page Aug 22, 2026 · 1 revision

Examples

examples/README.md gives the canonical overview; this page is a quick tour of what's in examples/.

Basic-Ducks/ — reference implementations

  • common/ — shared helper code used by multiple sketches.
  • MamaDuck/ — minimal, board-agnostic MamaDuck sketch. This is the default sketch built by any environment when EXAMPLE_DIR isn't set.
  • PapaDuck/ — gateway sketch with MQTT/WiFi hub integration (hub/command downlink handling, including the encrypted-command path described in Security and Encryption).
  • DuckLink/ — leaf sensor node sketch.
  • DetectorDuck/ — RSSI site-survey sketch.
  • Heltec/ — full-featured MamaDuck sketch for Heltec boards, including BLE phone-pairing, a custom "CDK protocol" text frame dispatcher (handleFrame()), and battery reporting.
  • Seeed/ — Seeed-board sketches, including:
    • Seeed/WioTrackerL1/ — the nRF52840 Wio Tracker L1 counterpart to the Heltec sketch above (Adafruit Bluefruit bleuart instead of NimBLE).

The Heltec and Seeed sketches each maintain their own copy of the CDK text-frame protocol (see each directory's CDK_PROTOCOL.md) rather than sharing one implementation — the same frame type must be added to each .ino individually if extended.

Custom-Papa-Examples/

  • AWS-PapaDuck/ — a PapaDuck configured to publish to AWS instead of a local/generic MQTT broker, and an example of an alternative uplink path that doesn't require an SX1302 concentrator gateway.

External-Boards-Example/

  • DuckLink/ — demonstrates building this library's DuckLink sketch against a board that isn't wired into the main platformio.ini, using its own standalone platformio.ini.

Which sketches use encryption

Per the opt-in design in Security and Encryption, only sketches that explicitly call sendSealedData()/sendEncryptedData()/announceIdentity() exercise encrypted traffic. Currently: MamaDuck/MamaDuck.ino and DuckLink/DuckLink.ino branch their send calls on isUplinkEncryptionEnabled(). Relay-only or broadcast-discovery-heavy sketches (PapaDuck, DetectorDuck, the Heltec/Seeed CDK-protocol sketches) are deliberately left on plain sendData() for their discovery/relay traffic, since encrypting broadcast discovery frames would break interoperability with unmodified peers rather than improve security.

Clone this wiki locally