Skip to content

Test drive our OTA A/B image update in Docker

More advanced IoT application quickly get to the point that OTA A/B image / firmware updates are considered. This can be a very time consuming process involving Yocto and various hardware. With this tutorial we want to make your life simple by allowing you to test the RAUC update mechanism in a virtual environment.

  • creating a virtual test device in a Docker container that is prepared for A/B image updates
  • demonstrating adaptive streaming updates
  • demonstrating delta updates to reduce bandwidth

The only pre-requisites are that you have a qbee account and Docker installed on your local machine.

Setting up the virtual test device

First you need to retrieve your bootstrap key. It can be found here

Then you run the Docker container with your bootstrap key.

Linux

docker run -it -e BOOTSTRAP_KEY=<bootstrap-key> -e QBEE_DEMO_DEVICE_HUB_HOST=device.app.qbee.io --device /dev/kvm qbeeio/qbee-demo:latest-yocto

Windows/MacOS - hardware acceleration with --device /dev/kvm was removed

docker run -it -e BOOTSTRAP_KEY=<bootstrap-key> -e QBEE_DEMO_DEVICE_HUB_HOST=device.app.qbee.io qbeeio/qbee-demo:latest-yocto

In order to always get the latest version it is possible to add --pull always to force a new container download.

When your virtual device is up and running it will appear in devices.

Preparing the image bundle updates

Download the following RAUC bundles and upload them in File Manager:

Kernel 5.10:

https://cdn.qbee.io/examples/yocto/rauc/qemu-demo-bundle-qemux86-64-kernel-5-10.raucb

Kernel 5.15:

https://cdn.qbee.io/examples/yocto/rauc/qemu-demo-bundle-qemux86-64-kernel-5-15.raucb

Defining & starting the OTA A/B update process

The demo image for Docker has currently kernel 5.10 running.

Inventory - kernel info

We will then update to kernel 5.15. This installs the new kernel in partition B, reboots and the bootloader will then try to boot into B.

Let's define the OTA update in "Configure". We update to 5.15:

RAUC image updater

Save and don't forget to commit. Then the magic will happen. After the next agent run and the reboot the kernel version is 5.15. The commit is also registered in our audit log with who did it and when.

Inventory - updated kernel info

In the log files we see that the image was updated and that the device rebooted into kernel 5.15.

Log details

From here it is possible to use the 5.10 image again to downgrade. This demo runs on a virtual device running in Docker container, but it is possible to create this for real devices as well. Just follow this link to learn more.