Home / Learn Embedded C / OTA Updates Over a Network, Revisited

OTA Updates Over a Network, Revisited

Connecting the OTA firmware update concept from the Bootloaders group to real network protocol choices.

The short versionConnecting the OTA firmware update concept from the Bootloaders group to real network protocol choices.

Theory in plain words

Layers of a robust networked OTA updateNetwork layer: reliably transport the firmware image (HTTP download,…Integrity layer: CRC-check the received image before trusting itBootloader layer: A/B rollback if the new image fails to boot/pass…
Layers of a robust networked OTA update

The basic idea

OTA (Over-The-Air) updates, introduced conceptually in the Bootloaders group, in practice use one of the networking protocols from this group (often HTTP for downloading the firmware image, sometimes MQTT for triggering/coordinating the update) combined with the bootloader's CRC-checking and rollback mechanisms already covered.

Why this comes up

This lesson deliberately ties together two previously-separate groups: the bootloader mechanics of safely installing new firmware, and the networking mechanics of actually transporting that firmware image to the device — OTA in practice needs both working correctly together.

The mechanics

A robust networked OTA system layers: network-level reliability (retry a failed download), transport-level integrity (the firmware image's own CRC check from the Bootloaders group), and bootloader-level safety (A/B rollback if the new image fails to boot) — each layer catching a different class of possible failure.

Where it is used

  • Connected device update infrastructure
  • Cross-group architecture integration
  • Production OTA system design

Try it

Walking through all 3 OTA layers for one simulated updateC: edit and run

Each layer's check must pass before the next one even runs, exactly matching the 3-layer diagram above.

Try it: a download that fails and retries before succeeding

Retrying a failed OTA download before moving on to integrity checksC: edit and run

Network-level retry logic recovers from the first two failed attempts, so the OTA process overall still succeeds instead of giving up after one dropped connection.

Quick check

1. Why does a robust networked OTA update system need both network-level reliability and the bootloader's own CRC/rollback mechanisms?