OTA updates for edge devices in the field

Keeping operating system and application current when devices sit behind someone else's firewall and nobody should have to travel.

  1. GitLab CImulti-arch build
  2. Mender serversigned artifact
  3. Customer firewalloutbound only
  4. Edge devicepartition A / B
The update travels to the device, but the device always opens the connection. The customer network needs no inbound port.

OTA (over-the-air) updates put new software on edge devices without anyone travelling to the machine. In BLUECTRL, the platform of BLUELINE / Linetechnology GmbH for modular recycling plants, Mender updates the operating system and software stack across a fleet of Revolution Pi devices, each with its own identity. The model holds up on customer networks because the device opens the connection itself and a failed system update falls back to the previous version.

A machine at a customer site runs on a network you don’t control: firewalls, proxies, blocked ports, sometimes no internet at all. An update that goes wrong means a site visit. This article looks at what matters on the update path, the trade-offs involved and the usual traps. The examples use Mender because that is the tool running in the field at BLUECTRL. Most of the reasoning applies to other tools too.

The device fetches the update

In managed mode, the Mender client regularly asks the server for new deployments. The connection starts on the device and uses HTTPS. The customer network therefore needs no inbound port and no VPN tunnel, only an allowance for the target addresses. That sets OTA apart from classic remote maintenance, where a technician connects to a single machine over VPN. The two can coexist.

Before installation, settle three things with the customer’s IT that would otherwise surface in the field:

  • Proxies with TLS inspection: these break the connection open. Either the device trusts the proxy or the target addresses get an exception.
  • System time: if NTP is blocked and the clock is wrong, every TLS connection fails. It looks like a network problem.
  • Bandwidth and time windows: a full system image takes a while over a thin line.

Networks with no internet at all can still be served. Mender Gateway routes traffic through a device that can reach the server. In standalone mode someone on site starts the update, for example from a USB stick using mender-update install. That takes a person at the customer’s end but uses the same signed artifact.

A/B partitions and automatic rollback

For the operating system, Mender uses two root partitions. The update goes onto the inactive partition, the bootloader switches over on restart, and the update is committed only after a successful boot. Without that commit, the device boots the old system again.

That has consequences for the hardware. Storage has to hold two system partitions. Anything that must survive an update lives on a separate data partition. And bootloader integration is one-off work per hardware platform, worth testing before the first field deployment, including pulling the power in the middle of a write.

“It booted” is rarely a sufficient success criterion. A state script in the ArtifactCommit phase can check whether the containers are running and the controller is reachable. If it returns an error, the update is aborted and rolled back.

Updating the OS and containers separately

BLUECTRL runs its services in containers on embedded Linux, and Mender updates the operating system and the stack. The two change at different rates: the system rarely and with a reboot, the application often. For applications, Mender offers Update Modules that don’t need a reboot.

That raises the question of where the images come from. Mender’s docker-compose module packs them into the artifact. The device needs just one connection and no registry, and standalone mode works too, but artifacts get large. If the device pulls images from a registry, updates are smaller, at the cost of a second address on the firewall allowlist.

The rollback path holds one trap no tool solves: database migrations. The old version has to cope with the new schema, or a rollback leaves you with a running application that can’t read its data.

Multi-arch builds from GitLab CI

The pipeline builds images for the target architecture, on ARM devices for instance with docker buildx build --platform linux/arm64. QEMU emulation is quick to set up and slow to run. A native ARM runner is the reverse. Every version gets a unique identifier from the commit that also shows up on the device. It is the only way to say later which code is running where.

Artifacts are signed in the pipeline, and devices check the signature with the public key. The private key belongs on a signing system and never on a device.

Device identity and provisioning

In BLUECTRL, each device has its own identity made up of keys and a serial number, assigned during provisioning. That is what makes it possible to update or block a single device.

By default, Mender uses the MAC address as the identity. A serial number is usually the better choice because it also appears on the rating plate. The server accepts new devices manually or by preauthorization. Order matters: keys are generated on the device during provisioning and never ship in an image that you copy to many devices.

Rollouts with no technician on site

Rollouts go in stages: one test device in-house, then a small group, then the fleet. Each stage needs a criterion for starting the next, and that requires visibility. In BLUECTRL, logs run through Promtail and Loki, metrics from selected devices through Node Exporter, and alerts through Grafana.

The customer is running production, and a reboot at the wrong moment costs them money. Before the download or reboot, a state script can query the state of the plant and return exit code 21 to request a later retry. The update then waits until the plant is idle.

Mender isn’t the only choice. SWUpdate and RAUC also use A/B schemes and leave more of the backend to you, for example with hawkBit. That means more freedom and more to build yourself. Some of Mender’s conveniences, such as delta updates, are tied to paid plans, which is worth checking up front. Balena takes a different route, as a container platform with its own OS.

Summary for management

A dependable update path saves site visits and keeps failures contained, because a failed system update falls back to the old version by itself. It is also the basis for closing security gaps over many years, which the Cyber Resilience Act requires of manufacturers. The effort goes into hardware integration, provisioning and the rollout process. It pays to do this early, since any device in the field without an update path can only be retrofitted on site.

Let’s talk about your devices

Which devices, how many, what is missing today: a short paragraph is enough for a first assessment.