Skip to content

Publish OTA Progress and Status to MQTT #79

@rodneyosodo

Description

@rodneyosodo

Overview

Implement OTA status topic publishing to report download progress, verification status, and update state over MQTT.

Description

Aeolus publishes OTA progress to the ota/status topic so administrators can monitor update progress in real-time. The current Linux OTA implementation exists but doesn't publish status to MQTT.

Requirements

  1. Status Topic

    • Publish to m/{domain}/c/{ctrl_channel}/ota/status
    • Update on state transitions
    • Update on download progress (every 5%)
    • Use SenML format
  2. Status Fields

    • state - Current state (idle, downloading, verifying, ready, restarting, aborted)
    • bytes - Bytes downloaded so far
    • total - Total bytes expected
    • progress - Percentage complete (0-100)
    • error - Error message (if any)
  3. State Publishing

    • Publish on each state transition
    • Publish periodically during download
    • Publish final status on completion/abort
    • Retain last status message
  4. OTA Config Topic

    • Subscribe to m/{domain}/c/{ctrl_channel}/ota/cfg
    • Parse update trigger
    • Support URL, hash, and size fields
  5. OTA Data Topic

    • Subscribe to m/{domain}/c/{ctrl_channel}/ota
    • Receive firmware binary via MQTT streaming
    • Alternative to HTTP download

Status Format

[
  {
    "n": "state",
    "vs": "downloading"
  },
  {
    "n": "bytes",
    "v": 65536,
    "u": "By"
  },
  {
    "n": "total",
    "v": 1324740,
    "u": "By"
  }
]

Reference

See Aeolus implementation:

  • src/management/ota.c
  • docs/ota.md
  • Current OTA implementation in pkg/ota/ota.go

Acceptance Criteria

  • OTA status topic publishes state changes
  • Download progress publishes every 5%
  • Status includes bytes downloaded and total
  • Final status published on completion
  • Error status published on failure
  • OTA can be triggered via MQTT config topic
  • MQTT streaming download works
  • HTTP download still works
  • ProgressFn callback integrated with MQTT publisher
  • Integration tests for status publishing

Priority

High

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions