Skip to content

Command Protocol

SmartPot uses a bidirectional LoRa command protocol between the base station and individual smart buoys. All packets are AES-128 encrypted. Every critical command requires an acknowledgment handshake confirming receipt and execution.

┌──────────┬──────────┬─────────┬──────────┬──────────┬──────────┐
│ Preamble │ Pot ID │ Cmd │ Payload │ Seq │ CMAC │
│ (2 bytes)│ (2 bytes)│ (1 byte)│ (0-16 B) │ (2 bytes)│ (4 bytes)│
└──────────┴──────────┴─────────┴──────────┴──────────┴──────────┘
FieldSizeDescription
Preamble2 bytes0x5350 (“SP” for SmartPot)
Pot ID2 bytesUnique trap identifier (0x0001–0xFFFE)
Command1 byteCommand opcode
Payload0–16 bytesCommand-specific data
Sequence2 bytesMonotonic counter for replay protection
CMAC4 bytesAES-CMAC truncated authentication tag
OpcodeNamePayloadDescription
0x01LOCK_DOORLock the servo-driven door latch to retain catch
0x02UNLOCK_DOORUnlock door to release contents
0x03SURFACETrigger ballast release for ropeless recovery
0x04CAPTURERequest on-demand image from trap camera
0x05STATUSForce immediate telemetry report
0x06SLEEPduration_hours (2B)Enter deep hibernation
0x07SET_MODEmode (1B)Set classification mode (0=auto, 1=manual, 2=log-only)
0x08REBOOTSoft restart both submerged unit and buoy
OpcodeNamePayloadDescription
0x80ACKcmd_acked (1B) + status (1B)Command acknowledgment
0x81TELEMETRYSee Telemetry FormatPeriodic status report
0x82CATCH_EVENTspecies (1B) + size_mm (2B) + action (1B)Classification result
0x83ALERTalert_type (1B) + data (4B)Drift, low battery, or fault alert
0x84IMAGE_READYchunk_count (1B) + total_bytes (2B)Image available for download

Critical commands (LOCK_DOOR, UNLOCK_DOOR, SURFACE) use a three-phase handshake:

  1. Base sends command with sequence number
  2. Buoy ACKs receipt (status=0x01 — received, forwarding)
  3. Buoy ACKs execution (status=0x02 — confirmed executed)

If no ACK is received within 10 seconds, the base retransmits up to 3 times. After 3 failures, the command is marked as failed and the operator is alerted.

  • AES-128-CMAC authentication on every packet
  • Sequence counter prevents replay attacks
  • Per-pot keys — compromise of one pot doesn’t affect the fleet
  • Key provisioning happens during initial flash (see Encryption)