Azure / iot-hub-device-update-yocto

A Yocto Project for the Device Update for IotHub
4 stars 4 forks source link

Problem performing an A/B update from the Azure portal #4

Closed Awarty closed 1 year ago

Awarty commented 1 year ago

We are currently exploring the possibility of using ADU to perform A/B updates on devices running a Yocto image. To create a small POC showcasing this update using ADU we used ‘iot-hub-device-update-yocto’ to build an image for a Raspberrypi 3b+. Following the steps in the README we successfully built the image and flashed the image to a device. Our problem is performing the A/B update. We have looked at the relevant links for ‘iot-hub-device-update’ and looked through the documentation but we still can’t perform an update without it failing. It looks like much of the documentation was written for version 0.8.0 and we are using version 1.0.0. ADU is also much more than just swupdate so finding relevant information for performing a complete A/B update is not straightforward. We are wondering how you perform an A/B update on a device flashed with the image generated by this project with a swu file using ADU.

Is there a step-by-step guide for updating from version 1.0.1 to 1.0.2 using swupdate to perform an A/B update on a Raspberrypi 3b+ device?

We tried performing an update locally on the device using swupdate directly which from what we could tell worked. The swu file produced from this repo does not contain any pre/post script for swupdate. This makes it not possible to change from one partition to the next as specified for A/B updates without manually changing. The output from performing the local update indicated a successful installation of the second partition but the device will not change the boot partition automatically. After verifying it working locally how do you perform an update using the Azure portal?

If you need any additional information on this issue, specify what and we will try to provide the additional information. Thanks for your help in advance.

Awarty commented 1 year ago

Microsoft has a tutorial for performing a device update on a Raspberry Pi 3B+ board. I posted an issue on the page asking if they could update the article for the new version of iot-hub-device-update (version 1.0+). Using the response and the updated article, I could perform an A/B update using both the image given in 'Tutorial_RaspberryPi.zip' and the image produced from iot-hub-device-update-yocto.

In the zip file they supplied an example script for performing an A/B update and the import manifest needed for ADU to perform the update.