Firmware update
Firmware update
Klas enables Over-The-Air (OTA) firmware updates by acting as a bridge between the Kamea cloud and the local system. When Kamea signals that a new firmware version is available, Klas notifies the system over D-Bus. The system can then choose to delegate the file download to Klas or handle it independently — in both cases, it confirms installation by calling a single D-Bus method, and Klas reports the result back to Kamea.
Key characteristics:
- D-Bus is the primary interface. All interaction with the system goes through D-Bus signals and method calls.
- Download is optional. The system may fetch the firmware file itself and skip
downloadFirmware()entirely. - State is persisted. Version information, download results, and timestamps survive Klas restarts.
A detailed description of the D-Bus API is available in the DBus API documentation.
sequenceDiagram
actor Kamea
participant Klas
actor System
Kamea->>Klas: new firmware version available (MQTT)
Klas->>System: newFirmwareVersionsAvailable [(name, version)]
opt System delegates download to Klas
System->>Klas: downloadFirmware(name, version)
alt Download succeeds
Klas->>System: newFirmwareFilesDownloaded [(name, version, file_path)]
else Download fails
Klas->>System: newFirmwareDownloadFailed [(name, version)]
end
end
System->>System: install firmware
System->>Klas: reportFirmwareUpdated(name, version)
Klas->>Kamea: reported installed version (MQTT)
-
New firmware version available
Kamea notifies Klas about a new firmware version. Klas emits thenewFirmwareVersionsAvailableD-Bus signal to the system.
The version is also readable at any time via thelatestFirmwareVersionAvailablesandallFirmwareVersionAvailablesproperties. -
Download (optional)
The system may calldownloadFirmware(name, version)to delegate the download to Klas.
The local name of the file isname_version. On success, Klas emitsnewFirmwareFilesDownloadedwith the local file path (also inlatestFirmwareFilesDownloaded/allFirmwareFilesDownloaded).
On failure, Klas emitsnewFirmwareDownloadFailed(also infailedFirmwareDownloads). The system may alternatively handle the download itself and skip this step entirely. -
Confirm installation
Once the firmware is installed, the system callsreportFirmwareUpdated(name, version).
Klas reports the installed version to Kamea. This is the only mandatory D-Bus call.
If Klas previously downloaded the firmware file, it is automatically deleted from disk at this point.