Over-the-Air (OTA) Updates
OTA updates allow firmware to be deployed to HIL devices without physical access. The OTA system supports both HTTP-based and MQTT-based firmware delivery (Hatamian et al., 2022).
OTA Architecture
OTA API
List Available Versions
curl http://localhost:3002/api/ota/versions
# Response:
{
"versions": [
{
"version": "2.0.0",
"timestamp": "2026-01-15T10:00:00Z",
"description": "Bug fixes and performance improvements",
"hash": "a1b2c3d4"
},
{
"version": "1.0.0",
"timestamp": "2026-01-01T00:00:00Z",
"description": "Initial release",
"hash": "e5f6g7h8"
}
]
}
Announce an Update
curl -X POST http://localhost:3002/api/ota/announce \
-H "Content-Type: application/json" \
-d '{
"version": "2.0.0",
"description": "Bug fixes and performance improvements",
"hash": "a1b2c3d4"
}'
Download Firmware
curl http://localhost:3002/api/ota/firmware/2.0.0 -o firmware.hex
OTA Flow
OTA in HIL LISP
Devices can be programmed to check for OTA updates periodically:
; Check for OTA updates every hour
(WHILE 1
(DO
(SET version (OTA-CHECK))
(IF version
(DO
(LOG "OTA update available: " version)
(SET fw (OTA-DOWNLOAD version))
(IF fw (OTA-APPLY fw)))))
(DELAY 3600000))
OTA Security
OTA updates require hash verification to prevent malicious firmware injection:
The firmware hash is announced alongside the version number. Devices compute the hash of the downloaded binary and compare it against the announced hash before flashing.
Versioning
HIL follows semantic versioning (SemVer) for firmware releases (Preston-Werner, 2013):
| Change Type | Version Bump | Example |
|---|---|---|
| Bug fix | Patch (1.0.x) | 1.0.0 → 1.0.1 |
| New feature | Minor (1.x.0) | 1.0.1 → 1.1.0 |
| Breaking change | Major (x.0.0) | 1.1.0 → 2.0.0 |
Rollback
If a firmware update fails or causes issues, the device can roll back to the previous version:
# Force rollback to previous version
hil-cli firmware flash --rollback
# Rollback to specific version
hil-cli firmware flash --version 1.0.0
References
Hatamian, M., Agah, A., Pishaie, S., & Razavi, S. (2022). Over-the-air firmware update for IoT devices: A survey. IEEE Internet of Things Journal, 9(14), 12107–12122.
Preston-Werner, T. (2013). Semantic versioning 2.0.0. https://semver.org