Skip to main content

Device Software Updates

Device-side perspective of OTA update management — how updates reach devices and how status is tracked.

For the server-side management API, see System > Software Updates.

Update Lifecycle (Device Perspective)

Server deploys update
→ MQTT message to device topic
→ Device downloads package
→ Device applies update
→ Device reports status back via MQTT/telemetry

Status Tracking

Each device has an UpdateStatus record tracking:

  • Current version
  • Target version
  • Download progress
  • Installation status: pending | downloading | installing | completed | failed | rolled_back
  • Error details (if failed)

Rollback

If an update fails:

  1. Server triggers rollback via SoftwareUpdatesService.rollbackDeployment()
  2. MQTT command sent to device to revert
  3. UpdateStatus marked as rolled_back

Prisma Models

  • SoftwareUpdate — Package metadata (version, changelog, file URL)
  • UpdateStatus — Per-device installation tracking (tenant-scoped)
  • SoftwareUpdatesModule — Server-side management
  • MqttModule — Update delivery channel
  • TelemetryModule — Status reporting