Giter VIP home page Giter VIP logo

iot-hub-device-update's Introduction

What is Device Update for IoT Hub?

Device Update for IoT Hub is a service that enables you to deploy over-the-air updates (OTA) for your IoT devices.

Device Update for IoT Hub is an end-to-end platform that customers can use to publish, distribute, and manage over-the-air updates for everything from tiny sensors to gateway-level devices.

Device Update for IoT Hub also provides controls on how to manage the deployment updates so you are always in control of when and how devices are updated. Device Update for IoT Hub also provides reporting capabilities so you are always up to date on the state of your devices via integration with IoT Hub.

Device Update for IoT Hub features provide a powerful and flexible experience, including:

  • Update management UX integrated with Azure IoT Hub
  • Gradual update rollout through device grouping and update scheduling controls
  • Programmatic APIs to enable automation and custom portal experiences
  • At-a-glance update compliance and status views across heterogenous device fleets
  • Support for resilient device updates (A/B) to deliver seamless rollback
  • Subscription and role-based access controls available through the Azure.com portal
  • On-premise content cache and Nested Edge support to enable updating cloud disconnected devices
  • Detailed update management and reporting tools

Reference agent

Build Status
Ubuntu 22.04 AMD64 Ubuntu 22.04 Build Status

Getting started

Quick Start

Build and Install

./scripts/install-deps.sh -a
./scripts/build.sh -c -u --build-packages
cd out
sudo cmake --build . --target install

Incremental Build

cd out
ninja

Run Tests

cd out
ctest

or, alternatively:

ninja test

Run tests under valgrind memcheck

Ensure /usr/bin/valgrind is a valid symlink e.g. sudo ln -s /opt/valgrind.3.19.0/bin/valgrind /usr/bin/valgrind

cd out
ctest -T memcheck

Results will be in out/Testing/Temporary/MemoryChecker.*.log

iot-hub-device-update's People

Contributors

andrewbrownmsft avatar danewalton avatar eshashah-msft avatar jamiemagee avatar jeffmill avatar joergzeidler avatar jw-msft avatar matsujirushi avatar microsoft-github-policy-service[bot] avatar neonsoftware avatar nihemstr avatar nox-msft avatar shiyi-peng avatar valolson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iot-hub-device-update's Issues

swupdate image update requierments

Hi,

I'm kind of new to ADU and swupdate, so please forgive my ignorance.

We are thinking of using pi-gen to create images to be used on Raspberry Pi CM4.
We want to use ADU with swupdate and identity service. The image should also include IoT Edge Runtime (moby-engine etc.).

Is that possible or do swupdate require something (like uboot?) that Raspberry Pi OS doesn't have, to be able to make image updates.

As we want to use IoT Edge Runtime we have to use Raspberry Pi OS, as the current Yocto meta-layer with IoT Edge Runtime is "stuck" at version 0.9 and we want to use version 1.2, that supports identity service.

When doing a image update, how do you keep config, log files and similar, unchanged? The last thing we want to do is to update the OS and at the same time remove the connection string in the config.toml file, or something similar.

Thanks

Device doesn't reboot after update

Following my writeup in #79 - after some initial trouble with my NFS root filesystem - I got the system started and could connect my device to the Azure IoT Hub. All this worked as expected, and I could build an image which I uploaded to the Azure Device Update service according to the manual (https://docs.microsoft.com/en-us/azure/iot-hub-device-update/device-update-raspberry-pi). Sadly, the manual is quite outdated and some information about the manifest had to be taken from the documentation found in the repo (https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/iot-hub-device-update/update-manifest.md).

After taking all this ... I ended up with a system which I could flash (at least out of the logs it seemed to work) but which didn't reboot. Here are the logs I got from the service:

root@dagonet:/adu/logs# tail -f aduc.20210714-140755.log
2021-07-14T14:07:55.0591Z [I] Agent (linux; 0.6.0-public-preview) starting. [main]
2021-07-14T14:07:55.0592Z [I] Agent built with handlers: microsoft/swupdate. [main]
2021-07-14T14:07:55.0717Z [I] Initalizing PnP components. [ADUC_PnP_Components_Create]
2021-07-14T14:07:55.0718Z [I] ADUC agent started. Using IoT Hub Client SDK 1.6.0 [AzureDeviceUpdateCoreInterface_Create]
2021-07-14T14:07:55.0718Z [I] Calling ADUC_Register [ADUC_MethodCall_Register]
2021-07-14T14:07:55.0719Z [I] IoTHub Device Twin callback registered. [ADUC_DeviceClient_Create]
2021-07-14T14:07:55.0847Z [W] Failed to pass connection string to DO, error: -3 [StartupAgent]
2021-07-14T14:07:55.0848Z [I] Agent running. [main]
2021-07-14T14:07:55.7106Z [D] IotHub connection status: 0, reason:6 [ADUC_ConnectionStatus_Callback]
2021-07-14T14:07:56.1125Z [I] Processing existing Device Twin data after agent started. [ADUC_PnPDeviceTwin_Callback]
2021-07-14T14:07:56.1125Z [D] Notifies components that all callback are subscribed. [ADUC_PnPDeviceTwin_Callback]
2021-07-14T14:07:56.1125Z [I] DeviceInformation component is ready - reporting properties [DeviceInfoInterface_Connected]
2021-07-14T14:07:56.1127Z [I] Property manufacturer changed to Contoso [RefreshDeviceInfoInterfaceData]
2021-07-14T14:07:56.1129Z [I] Property model changed to Virtual-Machine [RefreshDeviceInfoInterfaceData]
2021-07-14T14:07:56.1129Z [I] Property osName changed to Linux [RefreshDeviceInfoInterfaceData]
2021-07-14T14:07:56.1130Z [I] Property swVersion changed to 5.4.72 [RefreshDeviceInfoInterfaceData]
2021-07-14T14:07:56.1130Z [I] Property processorArchitecture changed to armv7l [RefreshDeviceInfoInterfaceData]
2021-07-14T14:07:56.1421Z [I] Property processorManufacturer changed to ARM [RefreshDeviceInfoInterfaceData]
2021-07-14T14:07:56.1422Z [I] Property totalMemory changed to 3919740 [RefreshDeviceInfoInterfaceData]
2021-07-14T14:07:56.1423Z [I] Property totalStorage changed to 2575284 [RefreshDeviceInfoInterfaceData]
2021-07-14T14:07:56.1425Z [I] No update content. Reporting Idle state. [ADUC_Workflow_HandleStartupWorkflowData]
2021-07-14T14:07:56.1425Z [I] Setting UpdateState to Idle [ADUC_SetUpdateStateHelper]
2021-07-14T14:07:56.1426Z [I] Reporting state: 0, Idle (0); HTTP 200; result 1, 0 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
2021-07-14T14:07:56.1427Z [I] UpdateAction: Idle. WorkflowId: 210714140756 [ADUC_MethodCall_Idle]
2021-07-14T14:07:56.1427Z [I] Calling IdleCallback [ADUC_MethodCall_Idle]
2021-07-14T14:07:56.1427Z [I] Now idle. workflowId: 210714140756 [Idle]
2021-07-14T14:09:52.2336Z [D] ComponentName:azureDeviceUpdateAgent, propertyName:service [ADUC_PnP_ComponentClient_PropertyUpdate_Callback]
2021-07-14T14:09:52.2340Z [D] OrchestratorUpdateCallback received property JSON string ({"action":0,"updateManifest":"{\"manifestVersion\":\"2.0\",\"updateId\":{\"provider\":\"Munit\",\"name\":\"Greenbelt\",\"version\":\"1.0.0.0\"},\"updateType\":\"microsoft\/swupdate:1\",\"installedCriteria\":\"0.0.0.1\",\"files\":{\"06e7385af5cf132a\":{\"fileName\":\"core-image-base-raspberrypi4-20210714070044.rootfs.ext4.gz\",\"sizeInBytes\ [OrchestratorUpdateCallback]
2021-07-14T14:09:52.2377Z [I] Processing 'Download' action [ADUC_Workflow_HandleUpdateAction]
2021-07-14T14:09:52.2378Z [I] UpdateAction: Prepare - calling PrepareCallback [ADUC_MethodCall_Prepare]
2021-07-14T14:09:52.2379Z [I] {210714140756} Received Metadata, UpdateType: microsoft/swupdate:1, UpdateTypeName: microsoft/swupdate, UpdateTypeVersion: 1, FileCount: 1 [Prepare]
2021-07-14T14:09:52.2380Z [I] microsoft_swupdate_CreateFunc called. [microsoft_swupdate_CreateFunc]
2021-07-14T14:09:52.2380Z [I] Prepare succeeded. [Prepare]
2021-07-14T14:09:52.2381Z [I] UpdateAction: Download [ADUC_MethodCall_Download]
2021-07-14T14:09:52.2381Z [I] Calling SandboxCreateCallback [ADUC_MethodCall_Download]
2021-07-14T14:09:52.2383Z [I] Setting sandbox /tmp/aduc-dl-210714140756 [SandboxCreate]
2021-07-14T14:09:52.2383Z [I] Using sandbox /tmp/aduc-dl-210714140756 [ADUC_MethodCall_Download]
2021-07-14T14:09:52.2383Z [I] Setting UpdateState to DownloadStarted [ADUC_SetUpdateStateHelper]
2021-07-14T14:09:52.2384Z [I] Calling DownloadCallback [ADUC_MethodCall_Download]
2021-07-14T14:09:52.2385Z [I] Download thread started [DownloadCallback]
2021-07-14T14:09:52.2387Z [D] Downloading 1 files to /tmp/aduc-dl-210714140756 [Download]
2021-07-14T14:09:52.2388Z [I] OrchestratorPropertyUpdateCallback ended [OrchestratorUpdateCallback]
2021-07-14T14:09:52.2390Z [I] Downloading File 'core-image-base-raspberrypi4-20210714070044.rootfs.ext4.gz' from 'http://updateinstance--updateservice.b.nlu.dl.adu.microsoft.com/northeurope/UpdateInstance--updateservice/919236e874694fcb83921da95bc2ac43/core-image-base-raspberrypi4-20210714070044.rootfs.ext4.gz' to '/tmp/aduc-dl-210714140756/core-image-base-raspberrypi4-20210714070044.rootfs.ext4.gz' [Download]
2021-07-14T14:10:06.6648Z [I] Validating file hash [Download]
2021-07-14T14:10:14.1029Z [I] microsoft_swupdate_CreateFunc called. [microsoft_swupdate_CreateFunc]
2021-07-14T14:10:14.1030Z [I] Download called - no-op for swupdate [Download]
2021-07-14T14:10:14.1030Z [I] Content Handler Download resultCode: 1, extendedCode: 0 [Download]
2021-07-14T14:10:14.1031Z [I] ProgressCallback: workflowId: 210714140756; Id 06e7385af5cf132a; State: Completed; Bytes: 125770543/125770543 [DownloadProgressCallback]
2021-07-14T14:10:14.1031Z [I] Download resultCode: 1, extendedCode: 0 [Download]
2021-07-14T14:10:14.1031Z [I] Action 'Download' complete. Result: 1, 0 [ADUC_Workflow_WorkCompletionCallback]
2021-07-14T14:10:14.1032Z [I] WorkCompletionCallback: Download succeeded. Going to state DownloadSucceeded [ADUC_Workflow_WorkCompletionCallback]
2021-07-14T14:10:14.1032Z [I] Setting UpdateState to DownloadSucceeded [ADUC_SetUpdateStateHelper]
2021-07-14T14:10:14.1032Z [I] Reporting state: DownloadSucceeded (2) [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
2021-07-14T14:10:18.1841Z [D] ComponentName:azureDeviceUpdateAgent, propertyName:service [ADUC_PnP_ComponentClient_PropertyUpdate_Callback]
2021-07-14T14:10:18.1845Z [D] OrchestratorUpdateCallback received property JSON string ({"action":1,"updateManifest":"{\"manifestVersion\":\"2.0\",\"updateId\":{\"provider\":\"Munit\",\"name\":\"Greenbelt\",\"version\":\"1.0.0.0\"},\"updateType\":\"microsoft\/swupdate:1\",\"installedCriteria\":\"0.0.0.1\",\"files\":{\"06e7385af5cf132a\":{\"fileName\":\"core-image-base-raspberrypi4-20210714070044.rootfs.ext4.gz\",\"sizeInBytes\ [OrchestratorUpdateCallback]
2021-07-14T14:10:18.1883Z [I] Processing 'Install' action [ADUC_Workflow_HandleUpdateAction]
2021-07-14T14:10:18.1883Z [I] UpdateAction: Install [ADUC_MethodCall_Install]
2021-07-14T14:10:18.1884Z [I] Setting UpdateState to InstallStarted [ADUC_SetUpdateStateHelper]
2021-07-14T14:10:18.1884Z [I] Calling InstallCallback [ADUC_MethodCall_Install]
2021-07-14T14:10:18.1884Z [I] Install thread started [InstallCallback]
2021-07-14T14:10:18.1886Z [I] Installing from /tmp/aduc-dl-210714140756 [Install]
2021-07-14T14:10:18.1887Z [I] OrchestratorPropertyUpdateCallback ended [OrchestratorUpdateCallback]
2021-07-14T14:10:18.1888Z [I] Installing image file: core-image-base-raspberrypi4-20210714070044.rootfs.ext4.gz [Install]
2021-07-14T14:10:18.2055Z [I] Install succeeded [Install]
2021-07-14T14:10:18.2056Z [I] Action 'Install' complete. Result: 1, 0 [ADUC_Workflow_WorkCompletionCallback]
2021-07-14T14:10:18.2057Z [I] WorkCompletionCallback: Install succeeded. Going to state InstallSucceeded [ADUC_Workflow_WorkCompletionCallback]
2021-07-14T14:10:18.2057Z [I] Setting UpdateState to InstallSucceeded [ADUC_SetUpdateStateHelper]
2021-07-14T14:10:18.2058Z [I] Reporting state: InstallSucceeded (4) [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
2021-07-14T14:10:23.0977Z [D] ComponentName:azureDeviceUpdateAgent, propertyName:service [ADUC_PnP_ComponentClient_PropertyUpdate_Callback]
2021-07-14T14:10:23.0980Z [D] OrchestratorUpdateCallback received property JSON string ({"action":2,"updateManifest":"{\"manifestVersion\":\"2.0\",\"updateId\":{\"provider\":\"Munit\",\"name\":\"Greenbelt\",\"version\":\"1.0.0.0\"},\"updateType\":\"microsoft\/swupdate:1\",\"installedCriteria\":\"0.0.0.1\",\"files\":{\"06e7385af5cf132a\":{\"fileName\":\"core-image-base-raspberrypi4-20210714070044.rootfs.ext4.gz\",\"sizeInBytes\ [OrchestratorUpdateCallback]
2021-07-14T14:10:23.1017Z [I] Processing 'Apply' action [ADUC_Workflow_HandleUpdateAction]
2021-07-14T14:10:23.1017Z [I] UpdateAction: Apply [ADUC_MethodCall_Apply]
2021-07-14T14:10:23.1018Z [I] Setting UpdateState to ApplyStarted [ADUC_SetUpdateStateHelper]
2021-07-14T14:10:23.1018Z [I] Calling ApplyCallback [ADUC_MethodCall_Apply]
2021-07-14T14:10:23.1018Z [I] Apply thread started [ApplyCallback]
2021-07-14T14:10:23.1020Z [I] Applying data from /tmp/aduc-dl-210714140756 [Apply]
2021-07-14T14:10:23.1021Z [I] OrchestratorPropertyUpdateCallback ended [OrchestratorUpdateCallback]
2021-07-14T14:10:23.1159Z [I] Action 'Apply' complete. Result: 3, 0 [ADUC_Workflow_WorkCompletionCallback]
2021-07-14T14:10:23.1160Z [I] Apply indicated success with RebootRequired - rebooting system now [ADUC_MethodCall_Apply_Complete]
2021-07-14T14:10:23.1161Z [I] Calling ADUC_RebootSystem [ADUC_MethodCall_RebootSystem]
2021-07-14T14:10:23.1162Z [I] ADUC_RebootSystem called. Rebooting system. [ADUC_RebootSystem]
2021-07-14T14:10:23.1351Z [I] execvp failed, ret -1, error 13
2021-07-14T14:10:23.1242Z [E] Reboot failed. [ADUC_RebootSystem]
2021-07-14T14:10:23.1246Z [E] Reboot attempt failed. [ADUC_MethodCall_Apply_Complete]
RebootRequired - rebooting system now [ADUC_MethodCall_Apply_Complete]
2021-07-14T14:10:23.1161Z [I] Calling ADUC_RebootSystem [ADUC_MethodCall_RebootSystem]
2021-07-14T14:10:23.1162Z [I] ADUC_RebootSystem called. Reb [ADUC_RebootSystem]
2021-07-14T14:10:23.1353Z [I] WorkCompletionCallback: Apply succeeded. Going to state Idle [ADUC_Workflow_WorkCompletionCallback]
2021-07-14T14:10:23.1353Z [I] Setting UpdateState to Idle [ADUC_SetUpdateStateHelper]
2021-07-14T14:10:23.1353Z [I] Calling SandboxDestroyCallback [ADUC_MethodCall_Idle]
2021-07-14T14:10:23.1354Z [I] Destroying sandbox /tmp/aduc-dl-210714140756. workflowId: 210714140756 [SandboxDestroy]
2021-07-14T14:10:23.1354Z [E] Unable to remove sandbox, error -1 [SandboxDestroy]
2021-07-14T14:10:23.1356Z [I] UpdateAction: Idle. WorkflowId: 210714141023 [ADUC_MethodCall_Idle]
2021-07-14T14:10:23.1356Z [I] Calling IdleCallback [ADUC_MethodCall_Idle]
2021-07-14T14:10:23.1356Z [I] Now idle. workflowId: 210714141023 [Idle]

After those lines, I manually triggered a restart but couldn't verify that the operations actually were taking place ...

Any idea of what could've gone wrong?

Does this device-update service support azure iot central

Hi,
just wondering if this service also supports Azure IOT Central, if so, is there any guidelines that we can follow, thanks. if not, any roadmap for a device update agent implementation for the azure rtos used in devices connected to iot central? thanks

./scripts/install-deps.sh: default DO branch name (v0.6.0) does not exist

Hi,
I'm trying to build the agent (on a raspberry pi 4) following the how to build guide.

I launched the script to install the dependencies:
./scripts/install-deps.sh -a

...and I got the error:
image

...suggesting that the branch name "v0.6.0" does not exist in the repo https://github.com/microsoft/do-client...
and indeed it should be "0.6.0", not "v0.6.0": https://github.com/microsoft/do-client/releases/tag/0.6.0

I then re-launched the script by forcing the do branch name to "0.6.0" as follows:
./scripts/install-deps.sh -a --do-ref 0.6.0

...and it worked.

Does it make sense? Thanks!

Rules for version number validation ?

Hello,

I am having issues with importing a new device update. It seems that the version number is validated against some rules. We make rc versions of our updates and there version number lookis like X.Y.Z-rc which gives me this error : Cannot parse import manifest. (Error parsing version string: 0.0.1-rc. Path 'updateId.version', line 5, position 25.)

Are those rules specified somewhere ? I couldn't find them anywhere.
Thanks for your help

Module Support in Management APIs

Management APIs do not support the ModulesClient just the way we have DevicesClient.
If I setup ADU as Module Identity then the parent device isnt being fetched in the GetDevice method of DevicesClient.

Seemingly missing libcurl.so when building azure-device-update in yocto (zeus)

In the past 2 days I occasionally got the following error when trying to build azure-device-update in yocto (zeus) after applying the patches described in #79:

yocto@5f0b8c0979c2:~/project/build$ bitbake azure-device-update
Loading cache: 100% |########################################################################################################################################################################| Time: 0:00:00
Loaded 3735 entries from dependency cache.
Parsing recipes: 100% |######################################################################################################################################################################| Time: 0:00:01
Parsing of 2569 .bb files complete (2562 cached, 7 parsed). 3741 targets, 134 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.44.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "arm-poky-linux-gnueabi"
MACHINE              = "raspberrypi4"
DISTRO               = "poky"
DISTRO_VERSION       = "3.0.4"
TUNE_FEATURES        = "arm vfp cortexa7 neon vfpv4 thumb callconvention-hard"
TARGET_FPU           = "hard"
meta
meta-poky
meta-yocto-bsp       = "zeus:d88d62c20d7d8da85f02edb170dae0280624ad7e"
meta-oe
meta-python
meta-networking
meta-multimedia      = "zeus:2b5dd1eb81cd08bc065bc76125f2856e9383e98b"
meta-raspberrypi     = "HEAD:0e05098853eea77032bff9cf81955679edd2f35d"
meta-filesystems     = "zeus:2b5dd1eb81cd08bc065bc76125f2856e9383e98b"
meta-rust            = "HEAD:7ff669d8cedd83a2d3efb73073a63b0a7efffddc"
meta-virtualization  = "HEAD:7e5219669ff6f8e9c8c33ffd230e95a6b2b025f4"
meta-iotedge         = "zeus:9e2b459177f163aaeeb95d2e3fd3dc6ccfb9da44"
meta-swupdate        = "HEAD:08c05c4e63da3dd71f58d8dc7cd9464790fbceb4"
meta-azure-device-update

Initialising tasks: 100% |###################################################################################################################################################################| Time: 0:00:01
Sstate summary: Wanted 163 Found 157 Missed 6 Current 386 (96% match, 98% complete)
NOTE: Executing Tasks
NOTE: Setscene tasks completed
ERROR: azure-device-update-git-r0 do_compile: Execution of '/home/yocto/project/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/azure-device-update/git-r0/temp/run.do_compile.142569' failed with exit code 1:
ninja: error: '/home/yocto/project/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/azure-iot-sdk-c/git-r0/recipe-sysroot/usr/lib/libcurl.so', needed by 'src/agent/AducIotAgent', missing and no known rule to make it
WARNING: exit code 1 from a shell command.

ERROR: Logfile of failure stored in: /home/yocto/project/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/azure-device-update/git-r0/temp/log.do_compile.142569
Log data follows:
| DEBUG: Executing shell function do_compile
| NOTE: VERBOSE=1 cmake --build /home/yocto/project/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/azure-device-update/git-r0/build --target all -- -j 16
| ninja: error: '/home/yocto/project/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/azure-iot-sdk-c/git-r0/recipe-sysroot/usr/lib/libcurl.so', needed by 'src/agent/AducIotAgent', missing and no known rule to make it
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/home/yocto/project/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/azure-device-update/git-r0/temp/run.do_compile.142569' failed with exit code 1:
| ninja: error: '/home/yocto/project/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/azure-iot-sdk-c/git-r0/recipe-sysroot/usr/lib/libcurl.so', needed by 'src/agent/AducIotAgent', missing and no known rule to make it
| WARNING: exit code 1 from a shell command.
|
ERROR: Task (/home/yocto/project/meta-azure-device-update/recipes-azure-device-update/azure-device-update/azure-device-update_git.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2131 tasks of which 2129 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/yocto/project/meta-azure-device-update/recipes-azure-device-update/azure-device-update/azure-device-update_git.bb:do_compile
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

It mentions a missing library in azure-iot-sdk-c whereby calling bitbake azure-iot-sdk-c runs through without any error.

After a couple of attempts, it often starts working again, but I was not yet able to reproduce it. If someone got an idea or even a solution, I'd be thrilled to hear about it.

Device taking time while OTA firmware download

Hello friends working on a project in which I'm downloads firmware by OTA is taking near by 2 min. I think that id too long time for 420KB file .. other thing is Im testing the same thing with AWS in that case file is hust downloaded in ~33sec so Im looking for help like what can be issue or is there sockets configuration or else ???

Simple way to handle update internal flow via our own script?

Hi, we're big fans of ADU ... and we have a requirement that we could handle by writing a custom handler based on the src. However, I suspect that we may be able to somehow download a (signed) script and execute it using the existing ADU handlers? I see, for example, that the adu-agent calls a shell script. We'd like to download and call our own shell script to handle complex internals of our installation. Is there a way to do this already, or should we write our own handler to call our shell script? Thanks for a tip.

Provision ADU as Module Identity

Hi. I'm trying to follow the guide On IoT Edge enabled devices to get the ADU and let IoT Identity Service handle provisioning.

Predicted behavior:
Module Identity named IoTHubDeviceUpdate showing up on the IoT Edge enabled device

Current behavior:
No Module Identity, and instead ADU reports to device twin.
Also, I've encountered problems in the ADU logs, like 'Failed to pass connection string to DO'. However, communication between ADU and device twin seems to work as expected, and also Edge deployments and telemetry.

Please describe which action in the setup/provisioning is decisive for the ADU using a device or module identity, and when it happens.
e.g. does the DO client (or any other service) need to be built with special flags, is the order of applying config and starting services important, etc. Currently, I don't see the difference with just provisioning like I normally would.

One difference though is that I also make these group settings according to the ADU docs how-to-run-agent

 sudo usermod -aG "aziotid" "adu"
 sudo usermod -aG "aziotcs" "adu"
 sudo usermod -aG "aziotks" "adu"

Assumptions (please correct me if I'm wrong)

  • I assume step 3 Install the Device Update package update agent. is only needed if I will use APT updates with ADU.
  • IoT Edge doesn't need to have a module deployment for the ADU Module Identity to show up.
  • Only device connection string is relevant, even though a module identity can have its own connection string.
  • I should not enter the device connection string with AducIotAgent ' as I run ADU as a daemon. Neither do I need to add the connection string to /adu/adu-conf.txt

Also, what has to be done on the device, referring to this: If you are migrating from a device level agent to adding the agent as a Module identity on the device, remove the older agent that was communicating over the Device Twin
Uninstall ADU and install it again, or something else/more, e.g. how is the device twin data cleared?

Hardware & OS information
Raspberry Pi Model B
Flashed with Raspberry Pi OS (32bit)

We have installed IoT Edge runtime 1.2.5 along with identityservice 1.2.4. I installed libdeliveryoptimization_0.6.0_armhf.deb and deliveryoptimization-agent_0.6.0_armhf.deb from microsoft/do-client/releases and deviceupdate-agent*.deb build from source:
sudo ./scripts/build.sh -c -p linux --provision-with-iotedge --content-handlers microsoft/swupdate --build-packages

How to build the agent with yocto zeus:

Since I couldn't find any information about it, I wanted to share how I updated the meta-layer of this repo from warrior to zeus. I can verify these commands by running them in a fresh docker-container only having a couple of modules installed. If you don't have such an image yet, https://github.com/crops/yocto-dockerfiles/tree/master/dockerfiles might be a good starting point.

For this purpose, I assume you are starting off with a fresh project. Create a new folder and run the following commands. They will lead you into the meta-layer where we have to run more commands as follows.

git clone --depth=1 -b zeus git://git.yoctoproject.org/poky
git clone --depth=1 -b zeus git://github.com/openembedded/meta-openembedded.git
git clone --depth=1 -b zeus git://github.com/agherzan/meta-raspberrypi.git
git clone --depth=1 -b zeus git://github.com/sbabic/meta-swupdate.git

mkdir meta-azure-device-update
cd meta-azure-device-update

Download the meta-layer from https://github.com/Azure/iot-hub-device-update/releases/download/0.7.0/meta-azure-device-update.1.zip and extract the files:

wget https://github.com/Azure/iot-hub-device-update/releases/download/0.7.0/meta-azure-device-update.1.zip
unzip meta-azure-device-update.zip
rm meta-azure-device-update.zip

Before we come to the zeus-warrior related changes, there are a couple of git-related settings you have to change so the recipes are pointing to existing git repositories and branches:

sed -i 's/ADUC_GIT_BRANCH ?= "master"/ADUC_GIT_BRANCH ?= "main"/g' recipes-azure-device-update/azure-device-update/azure-device-update_git.bb
sed -i 's+ADUC_SRC_URI ?= "git://github.com/Azure/adu-private-preview;branch=${ADUC_GIT_BRANCH}"+ADUC_SRC_URI ?= "git://github.com/Azure/iot-hub-device-update;branch=${ADUC_GIT_BRANCH}"+g' recipes-azure-device-update/azure-device-update/azure-device-update_git.bb
sed -i 's+SRC_URI = "gitsm://github.com/microsoft/GSL.git;branch=master"+SRC_URI = "gitsm://github.com/microsoft/GSL.git;branch=main"+g' recipes-msft-gsl/msft-gsl/msft-gsl_git.bb

Now to the changes needed to get it to build on zeus:

# Update the compatibility layer
sed -i 's/warrior/zeus/g' conf/layer.conf

# Adjust the bitbake files according to the new sanity checks https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#migration-3.0-sanity-checks
sed -i 's/^DEPENDS_${PN}/DEPENDS/g' recipes-azure-device-update/adu-agent-service/adu-agent-service.bb

# Don't know why this was missing ... it's referenced in the swupdates files all over and should be along.
cat >>recipes-support/swupdate/swupdate_%.bbappend <<EOL

DEPENDS_append += " mtd-utils"
EOL

After updating the meta-files, you go one level up, initialize the yocto-build-env and add the layers by running these commands:

cd ..

source poky/oe-init-build-env

bitbake-layers add-layer ../meta-openembedded/meta-oe
bitbake-layers add-layer ../meta-openembedded/meta-python
bitbake-layers add-layer ../meta-openembedded/meta-networking
bitbake-layers add-layer ../meta-openembedded/meta-multimedia
bitbake-layers add-layer ../meta-raspberrypi
bitbake-layers add-layer ../meta-swupdate
bitbake-layers add-layer ../meta-azure-device-update

I added the following settings to the build/conf/local.conf:

cat >>conf/local.conf <<EOL

MACHINE = "raspberrypi3"

SDIMG_ROOTFS_TYPE = "ext4"
ENABLE_UART = "1"
RPI_USE_U_BOOT = "1"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot"
DISTRO_FEATURES_append = " systemd virtualization"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""

IMAGE_INSTALL_append = " adu-agent-service"

ADUC_PRIVATE_KEY = "/home/yocto/project/priv.pem"
ADUC_PRIVATE_KEY_PASSWORD = "/home/yocto/project/priv.pass"

EOL

The files referenced in the last two lines are needed for swupdate and can be generated by using the following command:

echo "TestPassword" > priv.pass
openssl genrsa -aes256 -passout file:priv.pass -out priv.pem

Now you should be able to build by running bitbake core-image-base 🎉

Hope this is helpful to someone. In case anything of what I did was stupid, please tell me! I'm not yet very familiar with yocto but open for improvements, which I'll update right away.

It would also be nice if @microsoftopensource would put this into a separate repository so the community can at least add patches for the individual yocto-releases - even though there aren't any plans to do so yet (#56 (comment)).

Can´t parse additional arguments to Agent

System:

  • I'm running Version 0.6.0 on a Fedora 21 machine.

State:

  • I followed this guide to install the Agent. I had to change a few things in the "install-deps.sh" script because I am running on Fedora 21, but it worked.

Problem:

  • Now when I try to run any additional described here I get the error "unrecognized option".

What I tried:

  • I tried installing just the simulator agent and the whole package, nothing changed.
  • I have looked through the whole repo and could not find the options mentioned in the guide.

What I found:

  • The only option working was "--version", so I searched for that sting and fond It mentioned in two files "src/adu-shell/src/main.cpp" and in "packages/debian/postrm" the second file is interesting because It calls the AducIotAgent with "--enable-iothub-tracing" which looks like "--EnableIotHubTracing" mentioned in the Guide to me. That option is working, but I can't find where this is implemented. So I'm either looking in the wrong files or just don't get it.

Hash algorithm is longer than in this file

In this file I tested to reproduce the hash number of the key. If I try to reproduce the hash key, the result has always a longer length of the hash signature.

I tried on a Windows machine the following hash algorithm:
certUtil -hashfile .\file SHA256

What hash algorithm with which settings is explicit used for creating this hash key?

building on a raspberry 4

Hi,
I'm building the agent on a raspberry pi 4 with the raspberry OS 32bit (which is based on debian 10 buster) as per the docs, i.e.:

sudo ./scripts/install-deps.sh -a
sudo ./scripts/build.sh -c -p linux --provision-with-iotedge --content-handlers microsoft/apt --build-packages
sudo cmake --build out --target install

Then I manually run the agent:

sudo AducIotAgent -l 0 -e

and I get some warnings/errors (highlighted below) as such as:

  • Failed to pass connection string to DO
  • Failed to create content handler, updateType:(null)
  • IsInstalled call failed. ExtendedResultCode: -536870781

What am I missing? Thanks!

Here's the full log:

pi@raspberrypi:~ $ sudo AducIotAgent -l 0 -e
2021-04-12T14:40:02.4598Z [I] Agent (linux; 0.6.0-public-preview) starting. [main]
2021-04-12T14:40:02.4598Z [I] Git Info: main:7a6e4c1 [main]
2021-04-12T14:40:02.4599Z [I] Agent built with handlers: microsoft/apt. [main]
2021-04-12T14:40:02.4600Z [I] Requesting connection string from the Edge Identity Service [GetConnectionInfoFromIdentityService]
2021-04-12T14:40:02.4632Z [I] Initalizing PnP components. [ADUC_PnP_Components_Create]
2021-04-12T14:40:02.4632Z [I] ADUC agent started. Using IoT Hub Client SDK 1.6.0 [AzureDeviceUpdateCoreInterface_Create]
2021-04-12T14:40:02.4633Z [I] Calling ADUC_Register [ADUC_MethodCall_Register]
2021-04-12T14:40:02.4633Z [I] IoTHub Device Twin callback registered. [ADUC_DeviceClient_Create]
2021-04-12T14:40:02.4638Z [W] Failed to pass connection string to DO, error: -1 [StartupAgent]
2021-04-12T14:40:02.4638Z [I] Agent running. [main]
-> 15:40:03 CONNECT | VER: 4 | KEEPALIVE: 240 | FLAGS: 192 | USERNAME: arturol76.azure-devices.net/home-rpi4-2/?api-version=2020-09-30&DeviceClientTy pe=iothubclient%2f1.6.0%20(native%3b%20Linux%3b%20armv7l)&model-id=dtmi%3aAzureDeviceUpdate%3b1 | PWD: XXXX | CLEAN: 0
<- 15:40:03 CONNACK | SESSION_PRESENT: true | RETURN_CODE: 0x0
2021-04-12T14:40:03.6591Z [D] IotHub connection status: 0, reason:6 [ADUC_ConnectionStatus_Callback]
-> 15:40:03 SUBSCRIBE | PACKET_ID: 2 | TOPIC_NAME: $iothub/twin/res/# | QOS: 0
<- 15:40:03 SUBACK | PACKET_ID: 2 | RETURN_CODE: 0
-> 15:40:04 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/GET/?$rid=3
<- 15:40:04 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: QOS_VALUE_INVALID | TOPIC_NAME: $iothub/twin/res/200/?$rid=3 | PAYLOAD_LEN: 756
2021-04-12T14:40:04.1628Z [D] ComponentName:azureDeviceUpdateAgent, propertyName:service [ADUC_PnP_ComponentClient_PropertyUpdate_Callback]
2021-04-12T14:40:04.1629Z [D] OrchestratorUpdateCallback received property JSON string ({"action":255,"updateManifest":"","updateManifestSignature":" "}), property version (3) [OrchestratorUpdateCallback]
2021-04-12T14:40:04.1630Z [I] Perform startup tasks. [ADUC_Workflow_HandleStartupWorkflowData]
2021-04-12T14:40:04.1630Z [I] Calling IsInstalledCallback to check if content is installed. [ADUC_MethodCall_IsInstalled]
2021-04-12T14:40:04.1631Z [I] IsInstalledCallback called [IsInstalledCallback]
2021-04-12T14:40:04.1631Z [I] IsInstalled called workflowId: , installed criteria: (null) [IsInstalled]
2021-04-12T14:40:04.1633Z [E] Failed to create content handler, updateType:(null) [IsInstalled]
2021-04-12T14:40:04.1634Z [W] IsInstalled call failed. ExtendedResultCode: -536870781 - setting state to Idle [ADUC_Workflow_HandleStartupWorkflowData]
2021-04-12T14:40:04.1634Z [I] Setting UpdateState to Idle [ADUC_SetUpdateStateHelper]
2021-04-12T14:40:04.1635Z [I] Reporting state: 0, Idle (0); HTTP 200; result 1, 0 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
2021-04-12T14:40:04.1636Z [I] UpdateAction: Idle. WorkflowId: 210412144004 [ADUC_MethodCall_Idle]
2021-04-12T14:40:04.1637Z [I] Calling IdleCallback [ADUC_MethodCall_Idle]
2021-04-12T14:40:04.1637Z [I] Now idle. workflowId: 210412144004 [Idle]
2021-04-12T14:40:04.1638Z [I] OrchestratorPropertyUpdateCallback ended [OrchestratorUpdateCallback]
2021-04-12T14:40:04.1639Z [I] Processing existing Device Twin data after agent started. [ADUC_PnPDeviceTwin_Callback]
2021-04-12T14:40:04.1639Z [D] Notifies components that all callback are subscribed. [ADUC_PnPDeviceTwin_Callback]
2021-04-12T14:40:04.1640Z [I] DeviceInformation component is ready - reporting properties [DeviceInfoInterface_Connected]
2021-04-12T14:40:04.1642Z [I] Property manufacturer changed to Contoso [RefreshDeviceInfoInterfaceData]
2021-04-12T14:40:04.1643Z [I] Property model changed to Virtual-Machine [RefreshDeviceInfoInterfaceData]
2021-04-12T14:40:04.1644Z [I] Property osName changed to Linux [RefreshDeviceInfoInterfaceData]
2021-04-12T14:40:04.1645Z [I] Property swVersion changed to 5.10.17-v7l- [RefreshDeviceInfoInterfaceData]
2021-04-12T14:40:04.1646Z [I] Property processorArchitecture changed to armv7l [RefreshDeviceInfoInterfaceData]
2021-04-12T14:40:04.1856Z [I] Property processorManufacturer changed to ARM [RefreshDeviceInfoInterfaceData]
2021-04-12T14:40:04.1858Z [I] Property totalMemory changed to 3868956 [RefreshDeviceInfoInterfaceData]
2021-04-12T14:40:04.1860Z [I] Property totalStorage changed to 1856980 [RefreshDeviceInfoInterfaceData]
-> 15:40:04 SUBSCRIBE | PACKET_ID: 4 | TOPIC_NAME: $iothub/twin/PATCH/properties/desired/# | QOS: 0
<- 15:40:04 SUBACK | PACKET_ID: 4 | RETURN_CODE: 0
-> 15:40:04 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/PATCH/properties/reported/?$rid=5 | PAYLOAD_LE N: 99
-> 15:40:04 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/PATCH/properties/reported/?$rid=6 | PAYLOAD_LE N: 146
-> 15:40:04 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/PATCH/properties/reported/?$rid=7 | PAYLOAD_LE N: 236
-> 15:40:04 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/PATCH/properties/reported/?$rid=8 | PAYLOAD_LE N: 202
<- 15:40:04 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: QOS_VALUE_INVALID | TOPIC_NAME: $iothub/twin/res/204/?$rid=8&$version=98 | PAYLOAD_LEN: 0
<- 15:40:04 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: QOS_VALUE_INVALID | TOPIC_NAME: $iothub/twin/res/204/?$rid=7&$version=97 | PAYLOAD_LEN: 0
<- 15:40:04 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: QOS_VALUE_INVALID | TOPIC_NAME: $iothub/twin/res/204/?$rid=6&$version=96 | PAYLOAD_LEN: 0
<- 15:40:04 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: QOS_VALUE_INVALID | TOPIC_NAME: $iothub/twin/res/204/?$rid=5&$version=95 | PAYLOAD_LEN: 0
-> 15:44:04 PINGREQ
<- 15:44:04 PINGRESP
-> 15:48:04 PINGREQ
<- 15:48:04 PINGRESP
-> 15:52:04 PINGREQ
<- 15:52:04 PINGRESP
-> 15:56:04 PINGREQ
<- 15:56:04 PINGRESP
-> 16:00:04 PINGREQ
<- 16:00:04 PINGRESP

Building an ARM image with Yocto

I was able to install and run the Agent on an Ubuntu VM to validate if DU has all needed functionality.
Now I want to cross compile the Agent using Yocto 3.0. Yocto is set up, and I'm able to create images for my target device. All that is missing is how to add the agent recipe. Unfortunately I could not find an example on how to do this.

@ValOlson Mentioned added recipes. It would be nice to get them.

At the moment it's not clear to me which packages are used during compilation and which during runtime. The c-sdk porting guide mentions some, but does not specify further if these are host packages or for the target. The fact that the example is for a Pi who is able to install all dependency by himself and then simply copy them to a host system does not help either.

Implementation of dps

HI ,
I am working on task where i need to enable the device provisioning in iot-hub-device-update code.
I have enable provisioning sdk from azure -ot-sdk-c by modified the install script where i added -Duse_prov_client:BOOL=ON in cmake argument of cmake for azure-iot-sdk-c as follows:

   # use_http is required for uHTTP support.
    local azureiotsdkc_cmake_options=(
        "-Duse_amqp:BOOL=OFF"
        "-Duse_http:BOOL=ON"
        "-Duse_mqtt:BOOL=ON"
        "-Duse_prov_client:BOOL=ON"  # added by me
        "-Dskip_samples:BOOL=ON"
        "-Dbuild_service_client:BOOL=OFF"
        "-Dbuild_provisioning_service_client:BOOL=OFF"
    )

I have successfully installed all dependencies.
But when i am building the iot-hub-device-update sdk , am getting following error

sudo ./scripts/build.sh -c -p linux

Building ADU Agent
* Clean build: true
* Documentation: false
* Platform layer: linux
* Content handlers: microsoft/swupdate
* Build type: Debug
* Log directory: /var/log/adu
* Logging library: zlog
* Output directory: /home/pi/iot-hub-device-update/scripts/../out
* Build unit tests: false
* Build packages: false
* Static analysis: (none)

-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
--
-- CMAKE_SYSTEM_NAME=Linux
-- CMAKE_SYSTEM_VERSION=5.10.17-v7l+
-- CMAKE_HOST_SYSTEM_NAME=Linux
-- CMAKE_GENERATOR=Ninja
-- CMAKE_BUILD_TYPE=Debug
-- CMAKE_C_COMPILER=/usr/bin/cc
-- CMAKE_CXX_COMPILER=/usr/bin/c++
-- CMAKE_BINARY_DIR=/home/pi/iot-hub-device-update/out
-- CMAKE_SOURCE_DIR=/home/pi/iot-hub-device-update
-- CMAKE_BUILD_TYPE=Debug
-- CMAKE_SYSTEM_NAME=Linux
--
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for include file stdbool.h
-- Looking for include file stdbool.h - found
-- target architecture: ARM
-- Performing Test CXX_FLAG_CXX11
-- Performing Test CXX_FLAG_CXX11 - Success
-- target architecture: ARM
-- Found OpenSSL: /usr/lib/arm-linux-gnueabihf/libcrypto.so (found version "1.1.1d")
-- target architecture: ARM
-- Found Parson: /usr/local/include/azureiot
-- target architecture: ARM
-- target architecture: ARM
-- target architecture: ARM
-- target architecture: ARM
-- Found IotHubClient: /usr/local/include/azureiot
-- target architecture: ARM
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   filesystem
--   system
-- target architecture: ARM
-- Found Git: /usr/bin/git (found version "2.20.1")
-- target architecture: ARM
-- target architecture: ARM
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   filesystem
--   system
-- Boost version: 1.67.0
-- Found the following Boost libraries:
--   filesystem
--   system
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/iot-hub-device-update/out
[48/48] Linking CXX executable bin/AducIotAgent
FAILED: bin/AducIotAgent
: && /usr/bin/c++  -Werror -fPIE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wformat -Werror=format-security -fno-rtti -Werror -Werror -g  -pie -z relro -z now src/agent/CMakeFiles/AducIotAgent.dir/src/main.c.o src/agent/CMakeFiles/AducIotAgent.dir/src/health_management.c.o  -o bin/AducIotAgent  -Wl,-rpath,/usr/local/lib: /usr/local/lib/libaziotsharedutil.a -liothub_client_http_transport -luhttp /usr/local/lib/libaziotsharedutil.a -liothub_client_mqtt_transport /usr/local/lib/libumqtt.a -lhsm_security_client -lprov_auth_client src/agent/pnp_helper/libpnp_helper.a src/agent/adu_core_interface/libadu_core_interface.a src/utils/c_utils/libc_utils.a src/agent/device_info_interface/libdevice_info_interface.a src/utils/eis_utils/libeis_utils.a src/utils/system_utils/libsystem_utils.a /usr/local/lib/libdeliveryoptimization.so.0.4.0 /usr/local/lib/libaziotsharedutil.a src/platform_layers/linux_platform_layer/liblinux_platform_layer.a src/content_handlers/libcontent_handlers.a src/content_handlers/swupdate_handler/libswupdate_handler.a src/utils/system_utils/libsystem_utils.a -laziotsharedutil src/utils/process_utils/libprocess_utils.a /usr/local/lib/libdeliveryoptimization.so.0.4.0 /usr/local/lib/libaziotsharedutil.a src/utils/jws_utils/libjws_utils.a src/utils/crypto_utils/libcrypto_utils.a /usr/local/lib/libaziotsharedutil.a /usr/lib/arm-linux-gnueabihf/libcrypto.so /usr/local/lib/libaziotsharedutil.a src/utils/hash_utils/libhash_utils.a /usr/local/lib/libaziotsharedutil.a /usr/local/lib/libaziotsharedutil.a /usr/local/lib/libdeliveryoptimization.so.0.4.0 src/agent/pnp_helper/libpnp_helper.a -liothub_client_http_transport -liothub_client_mqtt_transport /usr/local/lib/libaziotsharedutil.a -lumqtt /usr/local/lib/libiothub_client.a /usr/local/lib/libaziotsharedutil.a -luhttp src/utils/c_utils/libc_utils.a /usr/local/lib/libaziotsharedutil.a src/logging/zlog/libzlog.a -lpthread /usr/local/lib/libparson.a /usr/local/lib/libaziotsharedutil.a -lcurl /usr/lib/arm-linux-gnueabihf/libssl.so /usr/lib/arm-linux-gnueabihf/libcrypto.so -lpthread -lm -lrt -luuid /usr/lib/arm-linux-gnueabihf/libboost_filesystem.so /usr/lib/arm-linux-gnueabihf/libboost_system.so && :
/usr/bin/ld: //usr/local/lib/libprov_auth_client.a(iothub_auth_client.c.o): in function `iothub_device_auth_create':
iothub_auth_client.c:(.text+0x4b4): undefined reference to `hsm_client_tpm_interface'
/usr/bin/ld: iothub_auth_client.c:(.text+0x5bc): undefined reference to `hsm_client_x509_interface'
/usr/bin/ld: iothub_auth_client.c:(.text+0x6e4): undefined reference to `hsm_client_key_interface'
/usr/bin/ld: //usr/local/lib/libprov_auth_client.a(iothub_security_factory.c.o): in function `iothub_security_init':
iothub_security_factory.c:(.text+0x1c0): undefined reference to `initialize_hsm_system'
/usr/bin/ld: //usr/local/lib/libprov_auth_client.a(iothub_security_factory.c.o): in function `iothub_security_deinit':
iothub_security_factory.c:(.text+0x26c): undefined reference to `deinitialize_hsm_system'
/usr/bin/ld: //usr/local/lib/libprov_auth_client.a(prov_security_factory.c.o): in function `prov_dev_security_init':
prov_security_factory.c:(.text+0x1c0): undefined reference to `initialize_hsm_system'
/usr/bin/ld: //usr/local/lib/libprov_auth_client.a(prov_security_factory.c.o): in function `prov_dev_security_deinit':
prov_security_factory.c:(.text+0x26c): undefined reference to `deinitialize_hsm_system'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

It was executed and target for raspberry pi 4 running on raspbian os.
How should i link missing library ?
Is that not build at time of building in azure-iot-sdk-c.

My final goal to achieve the device provisioning in device update code which target for raspberry pi 4
Any help will be appreciated.
Thanks in advance
regards

Maximum size for OTA Firmware file

Hi,
I want to know limitation about size of file that can be import for OTA process which is updated Firmware in swu file.
My Requirement is used a large file about 5 GB for OTA update.

Does current implementation if DU service support the 5GB size of file for OTA update.

Regards
Gaurav Choubey

Device update with TPM

Hi,

my question could be slightly similar to #48

context:

  • linux openwrt on MIPS
  • non-edge
  • AduAgent runs alongside another application using Azure IoT SDK c99, device twin, and TPM

constraint:

  • it seems like IoT Identity Service is only in Rust, so no MIPS target for Identity Service, so no-go, correct ?

I have tested the AduAgent with the default configuration, connection string, and seemed to be working.

Will I be able to use the TPM also for the AduAgent binary ?

Thanks in advance

Child process doesn't terminate if execvp fails

In process_utils.cpp at L80, the child process should not return the execvp value but exit with it.

return ret; should be _exit(ret);

Otherwise, if the exec command fails, the child process will not be terminated and continue to run the main process code.

Question return or exit
Question _exit or exit

Log Snipped:

2021-07-27T09:23:54.3444Z [I] Installing image file: 'appUpdate' type: 'application' [Install]
2021-07-27T09:23:54.3444Z [I] Starting ChildProcess [ADUC_LaunchChildProcess]
2021-07-27T09:23:54.3445Z [I] Arg 0 = -af [ADUC_LaunchChildProcess]
2021-07-27T09:23:54.3445Z [I] Arg 1 = /tmp/aduc-dl-210727092348/appUpdate [ADUC_LaunchChildProcess]
2021-07-27T09:23:54.3445Z [I] Arg 2 = --debug [ADUC_LaunchChildProcess]
execvp failed, ret -1, error 2
2021-07-27T09:23:54.7003Z [E] Install failed, extendedResultCode = -1 [Install]
2021-07-27T09:23:54.7025Z [I] Action 'Install' complete. Result: 0, -1 [ADUC_Workflow_WorkCompletionCallback]
2021-07-27T09:23:54.7026Z [E] Install failed. error 0, -1 - Expecting service to send Cancel action [ADUC_Workflow_WorkCompletionCallback]
2021-07-27T09:23:54.7026Z [I] Setting UpdateState to Failed [ADUC_SetUpdateStateHelper]
2021-07-27T09:23:54.7026Z [I] Reporting state: 255, Failed (255); HTTP 500; result 0, -1 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
2021-07-27T09:23:54.7072Z [I] Child process terminated normally, signal 0 [ADUC_LaunchChildProcess]
2021-07-27T09:23:54.7073Z [I] Install succeeded [Install]
2021-07-27T09:23:54.7073Z [I] Action 'Install' complete. Result: 1, 0 [ADUC_Workflow_WorkCompletionCallback]
2021-07-27T09:23:54.7074Z [I] WorkCompletionCallback: Install succeeded. Going to state InstallSucceeded [ADUC_Workflow_WorkCompletionCallback]
2021-07-27T09:23:54.7074Z [I] Setting UpdateState to InstallSucceeded [ADUC_SetUpdateStateHelper]
2021-07-27T09:23:54.7074Z [I] Reporting state: InstallSucceeded (4) [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
2021-07-27T09:23:54.7075Z [I] Calling ADUC_RebootSystem [ADUC_MethodCall_RebootSystem]
2021-07-27T09:23:54.7075Z [I] ADUC_RebootSystem called. Rebooting system. [ADUC_RebootSystem]
2021-07-27T09:23:54.7132Z [E] Reboot failed. [ADUC_RebootSystem]

Downloading issue with error, code 1060110323

Hi,
I am working pi 4 running on Raspbian lit.
I build the given agent code from iot device update sdk and run the agent as daemon its seem like working fine.
When i initiate the OTA from HUB , it showing expectation error as follow.

Nov 29 17:52:16 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.6565Z [D] OrchestratorUpdateCallback received property JSON string ({"action":0,"updateManifest":"{\"manifestVersion\":\"2.0\",\"updateId\":{\"provider\":\"Tutorial-DUIoTHubTeam\",\"name\":\"Tutorial-RPi\",\"version\":\"0.6.5073.1\"},\"updateType\":\"microsoft\/swupdate:1\",\"installedCriteria\":\"0.6.5073.1\",\"files\":{\"f31c7ff503334d72a\":{\"fileName\":\"adu-update-image-raspberrypi3-0.6.5073.1.swu\",\"sizeInBytes\":106638336,\"hashes\":{\"sha256\":\"viofeb0YiA4XQfyXF57sNrjydiLyrSoeytxq3LH4Z00=\"}}},\"createdDateTime\":\"2021-05-05T15:28:19.5683004Z\"}","updateManifestSignature":"eyJhbGciOiJSUzI1NiIsInNqd2siOiJleUpoYkdjaU9pSlNVekkxTmlJc0ltdHBaQ0k2SWtGRVZTNHlNREEzTURJdVVpSjkuZXlKcmRIa2lPaUpTVTBFaUxDSnVJam9pYkV4bWMwdHZPRmwwWW1Oak1sRXpUalV3VlhSTVNXWlhVVXhXVTBGRlltTm9LMFl2WTJVM1V6Rlpja3BvV0U5VGNucFRaa051VEhCVmFYRlFWSGMwZWxndmRHbEJja0ZGZFhrM1JFRmxWVzVGU0VWamVEZE9hM2QzZVRVdk9IcExaV3AyWTBWWWNFRktMMlV6UWt0SE5FVTBiMjVtU0ZGRmNFOXplSGRQUzBWbFJ6QkhkamwzVjB3emVsUmpUblprUzFoUFJGaEdNMVZRWlVveGIwZGlVRkZ0Y3pKNmJVTktlRUppZEZOSldVbDBiWFpwWTNneVpXdGtWbnBYUm5jdmRrdFVUblZMYXpob2NVczNTRkptYWs5VlMzVkxXSGxqSzNsSVVVa3dZVVpDY2pKNmEyc3plR2d4ZEVWUFN6azRWMHBtZUdKamFsQnpSRTgyWjNwWmVtdFlla05OZW1Fd1R6QkhhV0pDWjB4QlZGUTVUV1k0V1ZCd1dVY3lhblpQWVVSVmIwTlJiakpWWTFWU1RtUnNPR2hLWW5scWJscHZNa3B5SzFVNE5IbDFjVTlyTjBZMFdubFRiMEoyTkdKWVNrZ3lXbEpTV2tab0wzVlRiSE5XT1hkU2JWbG9XWEoyT1RGRVdtbHhhemhJVWpaRVUyeHVabTVsZFRJNFJsUm9SVzF0YjNOVlRUTnJNbGxNYzBKak5FSnZkWEIwTTNsaFNEaFpia3BVTnpSMU16TjFlakU1TDAxNlZIVnFTMmMzVkdGcE1USXJXR0owYmxwRU9XcFVSMkY1U25Sc2FFWmxWeXRJUXpVM1FYUkJSbHBvY1ZsM2VVZHJXQ3M0TTBGaFVGaGFOR0V4VHpoMU1qTk9WVWQxTWtGd04yOU5NVTR3ZVVKS0swbHNUM29pTENKbElqb2lRVkZCUWlJc0ltRnNaeUk2SWxKVE1qVTJJaXdpYTJsa0lqb2lRVVJWTGpJeE1EWXdPUzVTTGxNaWZRLlJLS2VBZE02dGFjdWZpSVU3eTV2S3dsNFpQLURMNnEteHlrTndEdkljZFpIaTBIa2RIZ1V2WnoyZzZCTmpLS21WTU92dXp6TjhEczhybXo1dnMwT1RJN2tYUG1YeDZFLUYyUXVoUXNxT3J5LS1aN2J3TW5LYTNkZk1sbkthWU9PdURtV252RWMyR0hWdVVTSzREbmw0TE9vTTQxOVlMNThWTDAtSEthU18xYmNOUDhXYjVZR08xZXh1RmpiVGtIZkNIU0duVThJeUFjczlGTjhUT3JETHZpVEtwcWtvM3RiSUwxZE1TN3NhLWJkZExUVWp6TnVLTmFpNnpIWTdSanZGbjhjUDN6R2xjQnN1aVQ0XzVVaDZ0M05rZW1UdV9tZjdtZUFLLTBTMTAzMFpSNnNTR281azgtTE1sX0ZaUmh4djNFZFNtR2RBUTNlMDVMRzNnVVAyNzhTQWVzWHhNQUlHWmcxUFE3aEpoZGZHdmVGanJNdkdTSVFEM09wRnEtZHREcEFXbUo2Zm5sZFA1UWxYek5tQkJTMlZRQUtXZU9BYjh0Yjl5aVhsemht**T12021-11-29T17:52:16.9324Z [E] Download failed. error 0, -791674867 - Expecting service to send Cancel action [ADUC_Workflow_WorkCompletionCallback]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]:** dLRjF4SzlseHpYUG9GNmllOFRUWlJ4T0hxTjNiSkVISkVoQmVLclh6YkViV2tFNm4zTEoxbkd5M1htUlVFcER0Umdpa0tBUzZybFhFT0VneXNjIn0.eyJzaGEyNTYiOiJMc05mVE9uUjdXTldmWGpDb085VzVobllyajQ4K2FOWTZxc05USGVDZTVJPSJ9.TC78PkRLZJoXtXPs52t0UhYsxG8-dtQIyw4euBs8KFERiM-jOTqckxFcGlAJ8n6t3fYHK0ihRy2QSOJrX2ASjyba9icr59fXM78nyRVq7S0KyvtFF8N_m0sAZfStVujXWhUYML6Jv-EM9VUFKD1JCb5nRH09XESOgv3JHJ5ggTHx2i-DZhztu75_02UA_k_E5lOZksviAmbqF6berw8DE9phaipQQzovC7olprXexJphHAqg2KYRbhTQRaj7udMzpK9ALJfzjtQlOYuXAA_4_Zl0nbMrjgS26ve_BCxKG657hzI1JuTbM6Ukfr4kOt7wdKf1KaLArxz7SbFcH_yWB_KwQK3drz5SL9cXFatTXxS9LDckMW9XAIgV-JOginrh4qHMXgZDehKdvR8Op5C3Y61BKPKFshq82TIgcsSjI38VEVUQ1IuFPdpHSMcNZn6QWva2BZzNIyygc5dnlaoo2ixF9uf_RUjwYZMpMpNrkBxLqwaGYN13YNZaVdXVRTx9","fileUrls": [OrchestratorUpdateCallback]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.6642Z [I] Processing 'Download' action [ADUC_Workflow_HandleUpdateAction]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.6642Z [I] UpdateAction: Prepare - calling PrepareCallback [ADUC_MethodCall_Prepare]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.6644Z [I] {211129175145} Received Metadata, UpdateType: microsoft/swupdate:1, UpdateTypeName: microsoft/swupdate, UpdateTypeVersion: 1, FileCount: 1 [Prepare]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.6645Z [I] microsoft_swupdate_CreateFunc called. [microsoft_swupdate_CreateFunc]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.6645Z [I] Prepare succeeded. [Prepare]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.6646Z [I] UpdateAction: Download [ADUC_MethodCall_Download]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.6646Z [I] Calling SandboxCreateCallback [ADUC_MethodCall_Download]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.6650Z [I] Setting sandbox /tmp/aduc-dl-211129175145 [SandboxCreate]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.6650Z [I] Using sandbox /tmp/aduc-dl-211129175145 [ADUC_MethodCall_Download]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.6651Z [I] Setting UpdateState to DownloadStarted [ADUC_SetUpdateStateHelper]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.6652Z [I] Calling DownloadCallback [ADUC_MethodCall_Download]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.6652Z [I] Download thread started [DownloadCallback]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.6656Z [D] Downloading 1 files to /tmp/aduc-dl-211129175145 [Download]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.6656Z [I] OrchestratorPropertyUpdateCallback ended [OrchestratorUpdateCallback]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.6658Z [I] Downloading File 'adu-update-image-raspberrypi3-0.6.5073.1.swu' from 'http://dev-duintance--devmgmtupdate.b.nlu.dl.adu.microsoft.com/westus2/dev-duintance--devmgmtupdate/3fbf614382354c45a1afbf6af902f2cd/adu-update-image-raspberrypi3-0.6.5073.1.swu' to '/tmp/aduc-dl-211129175145/adu-update-image-raspberrypi3-0.6.5073.1.swu' [Download]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: -> 17:52:16 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/PATCH/properties/reported/?$rid=9 | PAYLOAD_LEN: 3233
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: **2021-11-29T17:52:16.9321Z [I] Caught DO exception, msg: unrecognized error, code: -1060110323 [Download]**
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.9322Z [I] ProgressCallback: workflowId: 211129175145; Id f31c7ff503334d72a; State: Error; Bytes: 0/0 [DownloadProgressCallback]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.9323Z [I] Download resultCode: 0, extendedCode: -791674867 [Download]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.9323Z [I] Action 'Download' complete. Result: 0, -791674867 [ADUC_Workflow_WorkCompletionCallback]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.9325Z [I] Setting UpdateState to Failed [ADUC_SetUpdateStateHelper]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:16.9325Z [I] Reporting state: 255, Failed (255); HTTP 500; result 0, -791674867 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: -> 17:52:17 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/PATCH/properties/reported/?$rid=10 | PAYLOAD_LEN: 110
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: <- 17:52:18 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/res/204/?$rid=9&$version=1391 | PAYLOAD_LEN: 0
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: <- 17:52:18 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/res/204/?$rid=10&$version=1392 | PAYLOAD_LEN: 0
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: <- 17:52:21 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/PATCH/properties/desired/?$version=11 | PAYLOAD_LEN: 146
Nov 29 17:52:21 raspberrypi AducIotAgent[2245]: 2021-11-29T17:52:21.4750Z [D] ComponentName:azureDeviceUpdateAgent, propertyName:service [ADUC_PnP_ComponentClient_PropertyUpdate_Callback]

I download the iot device update sdk which received as main branch
I have install using install_dep.sh script with option

# ADUC Deps
install_aduc_deps=false
install_azure_iot_sdk=false
azure_sdk_ref=LTS_07_2021_Ref01
install_catch2=false
default_catch2_ref=v2.11.0
catch2_ref=$default_catch2_ref

# DO Deps
install_do=false
default_do_ref=v0.8.1
do_ref=$default_do_ref
install_do_deps=false
install_cpprestsdk=false
default_cpprestsdk_ref=v2.10.18
cpprestsdk_ref=$default_cpprestsdk_ref
install_gsl=false
default_gsl_ref=v2.0.0
gsl_ref=$default_gsl_ref

After reading few post , i come to conclusion delivery optimization service should be present which has to be installed separately.
I git do client code and created ,install three service deliveryoptimization-agent_0.7.0_armhf.deb ,libdeliveryoptimization-dev_0.7.0_armhf.deb , deliveryoptimization-plugin-apt_0.5.0_armhf.deb.

But still getting the error.
Please help me out what is problem here.
what i am missing here ?

unnecessary update to the same version

Hi ADU Team

In our scenario we continuously build new yocto based linux firmware images, with adu agent configured to that latest version. Later on, the newest available version of the image is flashed to the device in a factory environment. In parallel to building the firmware, we also create and import an update of the same version into adu and create a deployment respectively.

We experienced that after the device was successfully provisioned and is visible in iothub for the first time, an update to the same version is offered by iothub. This is a bug in our opinion since there is no need for updating in that case.

Regards
Jan

DeliveryOptimization library not found when building Agent on Raspberry Pi

Hi, I'm trying to build the Device Update Agent on a Raspberry Pi device to work with IoT Edge version 1.2.
First, I run the install-deps.sh script and from what I can see the Delivery Optimization SDK should be included.

Reproduce:
Install IoT Edge 1.2 as described here on Raspberry Pi 3B+

Then clone this repo on the device, enter and run:
./scripts/install-deps.sh -a
./scripts/build.sh -c -p linux --content-handlers microsoft/apt --build-packages
sudo cmake --build out --target install
Then start agent:
sudo systemctl start adu-agent

Error shown in logs from adu-agent:
Apr 09 12:08:44 raspberrypi systemd[1]: Started Azure Device Update Agent daemon.. Apr 09 12:08:44 raspberrypi AducIotAgent[20148]: /usr/bin/AducIotAgent: error while loading shared libraries: libdeliveryoptimization.so.0: cannot open shared object file: No such file or directory Apr 09 12:08:44 raspberrypi systemd[1]: Stopped Azure Device Update Agent daemon..

Any ideas?

On the same topic I wonder if I should build from the main branch or release/2021-q2 to get the latest agent for armhf that would correspond to the 0.7.0 release that is available for amd64

Thanks

Connect Adu-Client to Azure by using dps with x509 certs

Hello,

I have registered my IoT device with the Device Provisioning Service to IoT Hub and now I want to connect the Adu-Client with Azure.
The registration was done with X509 certificates, so I want ask, how I can connect the Adu-Client with Azure by using the X509 certificates.
By the way, I have found a solution here approach, but I have not understand how I can implement it.
Would it be possible to introduce me to this approach to be able to implement it?
Thanks in advance.

How to use a yocto image with Device Update Service for NVIDIA Xavier-NX arm64?

I have created a Yocto image for my nvidia xavier nx. It is an arm64 device. The steps for a manually update are available but how do I use the Device Update Service to push the updated image through the IoT Hub?

The following are steps for deploying the image manually:

  1. The disk image package for Jetson has a name like devkit.tegraflash.tar.gz.
  2. This file can be used along with recovery mode on the Jetson to initially provision the device. You should insert an SDCard into the device before flashing.
  3. To enter recovery mode(instructions for jetson):
  4. For the Jetson carrier board, unless you have connected buttons to the header pins, use a jumper (REC to GND) to put the device into recovery mode on power up.
  5. Connect the USB cable to power on the Jetson. You should see your NVIDIA device listed in the lsusb device output.
  6. Extract the .tar.gz file and then run the ./doflash.sh script inside to flash the build to the device.

Infinite message spam

Not sure if this is something to fix on the client side or the server side but if for some reason you get a cancel with no operation in progress it enters an infinite loop of sending cancels. In my case it was because the update failed to apply and was reset so it lost its state.

Went through ~12000 messages an hour before I noticed it.

2021-12-09T21:37:59.2730Z [I] OrchestratorPropertyUpdateCallback ended [OrchestratorUpdateCallback]
2021-12-09T21:38:00.2240Z [I] Cancel received with no operation in progress - returning to Idle state [ADUC_Workflow_HandleUpdateAction]
2021-12-09T21:38:00.2241Z [I] Setting UpdateState to Idle [ADUC_SetUpdateStateHelper]
2021-12-09T21:38:00.2241Z [I] Reporting state: 0, Idle (0); HTTP 200; result 1, 0 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
2021-12-09T21:38:00.2243Z [I] UpdateAction: Idle. WorkflowId: 211209213800 [ADUC_MethodCall_Idle]
2021-12-09T21:38:00.2243Z [I] Calling IdleCallback [ADUC_MethodCall_Idle]
2021-12-09T21:38:00.2243Z [I] {211209213800} Now idle [Idle]
2021-12-09T21:38:00.2243Z [I] OrchestratorPropertyUpdateCallback ended [OrchestratorUpdateCallback]
2021-12-09T21:38:01.2768Z [I] Cancel received with no operation in progress - returning to Idle state [ADUC_Workflow_HandleUpdateAction]
2021-12-09T21:38:01.2769Z [I] Setting UpdateState to Idle [ADUC_SetUpdateStateHelper]
2021-12-09T21:38:01.2769Z [I] Reporting state: 0, Idle (0); HTTP 200; result 1, 0 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
2021-12-09T21:38:01.2770Z [I] UpdateAction: Idle. WorkflowId: 211209213801 [ADUC_MethodCall_Idle]
2021-12-09T21:38:01.2770Z [I] Calling IdleCallback [ADUC_MethodCall_Idle]
2021-12-09T21:38:01.2771Z [I] {211209213801} Now idle [Idle]

Broken link to porting guide

The link

https://github.com/Azure/azure-c-shared-utility/blob/public-preview/devdoc/porting_guide.md

mentioned in
/docs/agent-reference/how-to-modify-the-agent-code.md
Porting to a different OS or platform is broken.

I think it should be replaced by
https://github.com/Azure/azure-c-shared-utility/blob/master/devdoc/porting_guide.md

Unable to see Azure Device Update Groups in IoT Hub

I followed this procedure I manually prepared my VM

I added a tag for ADUGroup to my edge device in the Device Twin and in the IoTHubDeviceUpdate module Twin (because it was not clear to me to which I had to):

'tags': {
'ADUGroup': 'gerryTest'
}

image

image

When I try to create a Group in Device Updates - Groups the tag is not present, in fact NO TAGS are available in the drop down at all.

image

image

UPDATE:
I tried using the "Deploy to Azure" Button and it worked!!, after I checked what was the difference, I noticed that the template used for creating the VM has these commands:

    apt install -y deviceupdate-agent
    apt install -y deliveryoptimization-plugin-apt
    systemctl restart adu-agent

I believe the trick is done by restart adu-agent before tag the device! that instruction is not referenced in the manually procedure, please confirm, if it is the case please add to the documentation

Build the agent with yocto dunfell 3.1 version (boost 1.72.0, cpprest 2.10.16 )

With Dunfell the iot-hub-device-update is not building due to wrong dependancies with boost version 1.72.0 and cpprest version 2.10.16.
It is the same with ubuntu 20.04 (boost version 1.71.0)

Here are the modifications to be able of building the agent on yocto dunfell

  • cpprest_find_openssl.cmake file (in cpprest source code) : replace
    target_link_libraries(cpprest PRIVATE ${OPENSSL_LDFLAGS})
    with
    target_link_libraries(cpprest INTERFACE ${OPENSSL_LDFLAGS})

  • client-lite/CMakeLists.txt file : add
    ${Boost_LOG_LIBRARIES}
    after
    ${Boost_LIBRARIES}

  • deliveryoptimization_sdk-config.cmake file : replace
    find_dependency(Boost COMPONENTS filesystem system)
    with
    find_dependency(Boost COMPONENTS filesystem system regex random thread chrono atomic date_time

The three patches are in attachments
patch-adu.zip

Update staying in "New updates available" state

I am following the tutorial: https://docs.microsoft.com/en-us/azure/iot-hub-device-update/device-update-ubuntu-agent and the update never goes from new updates to in progress. I have waited hours for this to change.

image

I have tried restarting the adu-agent and the deliveryoptimization-agent.

OS: Ubuntu 18.04
IoT Edge: 1.2.0~rc4
ADU Agent: 0.6.0-public-preview

Any suggestions on how to troubleshoot this?

The agent seems to be connected:

systemctl status adu-agent
● adu-agent.service - Azure Device Update Agent daemon.
   Loaded: loaded (/usr/lib/systemd/system/adu-agent.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2021-03-05 17:21:11 UTC; 4h 8min ago
 Main PID: 18470 (AducIotAgent)
    Tasks: 2 (limit: 4646)
   CGroup: /system.slice/adu-agent.service
           └─18470 /usr/bin/AducIotAgent -l 0 -e

Mar 05 19:45:15 adu AducIotAgent[18470]: -> 19:29:15 PINGREQ
Mar 05 19:45:15 adu AducIotAgent[18470]: <- 19:29:15 PINGRESP
Mar 05 19:45:15 adu AducIotAgent[18470]: -> 19:33:15 PINGREQ
Mar 05 19:45:15 adu AducIotAgent[18470]: <- 19:33:15 PINGRESP
Mar 05 19:45:15 adu AducIotAgent[18470]: -> 19:37:15 PINGREQ
Mar 05 19:45:15 adu AducIotAgent[18470]: <- 19:37:15 PINGRESP
Mar 05 19:45:15 adu AducIotAgent[18470]: -> 19:41:15 PINGREQ
Mar 05 19:45:15 adu AducIotAgent[18470]: <- 19:41:15 PINGRESP
Mar 05 19:45:15 adu AducIotAgent[18470]: -> 19:45:15 DISCONNECT
Mar 05 19:45:15 adu AducIotAgent[18470]: 2021-03-05T19:45:15.2471Z [D] IotHub connection status: 1, reason:0 [ADUC_ConnectionStatus_Callback]
systemctl status
● adu
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Thu 2021-03-04 18:24:01 UTC; 1 day 3h ago
   CGroup: /
           ├─user.slice
           │ └─user-1000.slice
           │   ├─session-27.scope
           │   │ ├─17651 sshd: ksaye [priv]
           │   │ ├─17771 sshd: ksaye@pts/0
           │   │ ├─17772 -bash
           │   │ ├─17886 sudo su
           │   │ ├─17890 su
           │   │ ├─17891 bash
           │   │ ├─32180 systemctl status
           │   │ └─32181 systemctl status
           │   └─[email protected]
           │     └─init.scope
           │       ├─17653 /lib/systemd/systemd --user
           │       └─17654 (sd-pam)
           ├─init.scope
           │ └─1 /sbin/init
           └─system.slice
             ├─adu-agent.service
             │ └─18470 /usr/bin/AducIotAgent -l 0 -e
             ├─containerd.service
             │ ├─1085 /usr/bin/containerd
             │ ├─4662 /usr/bin/containerd-shim-runc-v2 -namespace moby -id 999c8648fb807e111dfea89f05587e2fe5b0f79973da4fae68cb37eabdf46e07 -address /run/containerd/containerd.sock
             │ ├─4693 /usr/bin/dotnet Microsoft.Azure.Devices.Edge.Agent.Service.dll
             │ ├─4902 /usr/bin/containerd-shim-runc-v2 -namespace moby -id 65bb794b872df0c0b543879290192cf4a51079251fbf1f747160f46b58ffbd66 -address /run/containerd/containerd.sock
             │ ├─4934 /usr/bin/dotnet Microsoft.Azure.Devices.Edge.Hub.Service.dll
             │ ├─6768 /usr/bin/containerd-shim-runc-v2 -namespace moby -id 58a66b54f852e3c11ff3ce3be487f2688cee27e01b329e0fb49b291462e76dec -address /run/containerd/containerd.sock
             │ └─6798 /usr/bin/dotnet SimulatedTemperatureSensor.dll
             ├─aziot-edged.service
             │ └─4383 /usr/libexec/aziot/aziot-edged
             ├─systemd-networkd.service
             │ └─821 /lib/systemd/systemd-networkd
             ├─systemd-udevd.service
             │ └─427 /lib/systemd/systemd-udevd
             ├─cron.service
             │ └─1079 /usr/sbin/cron -f
             ├─docker.service
             │ ├─1290 /usr/bin/dockerd -H fd:// --containerd /var/run/containerd/containerd.sock
             │ ├─4864 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8883 -container-ip 172.18.0.3 -container-port 8883
             │ ├─4876 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 5671 -container-ip 172.18.0.3 -container-port 5671
             │ └─4888 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 443 -container-ip 172.18.0.3 -container-port 443
             ├─polkit.service
             │ └─1104 /usr/lib/policykit-1/polkitd --no-debug
             ├─networkd-dispatcher.service
             │ └─984 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
             ├─accounts-daemon.service
             │ └─962 /usr/lib/accountsservice/accounts-daemon
             ├─systemd-journald.service
             │ └─396 /lib/systemd/systemd-journald
             ├─atd.service
             │ └─991 /usr/sbin/atd -f
             ├─aziot-keyd.service
             │ └─1915 /usr/libexec/aziot-identity-service/aziot-keyd
             ├─unattended-upgrades.service
             │ └─1109 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
             ├─deliveryoptimization-agent.service
             │ └─18585 /usr/local/bin/deliveryoptimization-agent
             ├─ssh.service
             │ └─1223 /usr/sbin/sshd -D
             ├─snapd.service
             │ └─29048 /usr/lib/snapd/snapd
             ├─rsyslog.service
             │ └─964 /usr/sbin/rsyslogd -n
             ├─aziot-identityd.service
             │ └─1890 /usr/libexec/aziot-identity-service/aziot-identityd
             ├─lxcfs.service
             │ └─948 /usr/bin/lxcfs /var/lib/lxcfs/
             ├─lvm2-lvmetad.service
             │ └─418 /sbin/lvmetad -f
             ├─systemd-resolved.service
             │ └─846 /lib/systemd/systemd-resolved
             ├─aziot-certd.service
             │ └─1935 /usr/libexec/aziot-identity-service/aziot-certd
             ├─dbus.service
             │ └─937 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
             ├─systemd-timesyncd.service
             │ └─643 /lib/systemd/systemd-timesyncd
             ├─system-getty.slice
             │ └─[email protected]
             │   └─1148 /sbin/agetty -o -p -- \u --noclear tty1 linux
             └─systemd-logind.service
               └─995 /lib/systemd/systemd-logind

Logs:

cat aduc.20210305-172111.log
2021-03-05T17:21:11.5491Z [I] Agent (linux; 0.6.0-public-preview+20210227-001549) starting. [main]
2021-03-05T17:21:11.5491Z [I] Git Info: HEAD:34d84e8 [main]
2021-03-05T17:21:11.5491Z [I] Agent built with handlers: microsoft/apt. [main]
2021-03-05T17:21:11.5492Z [I] Requesting connection string from the Edge Identity Service [GetConnectionInfoFromIdentityService]
2021-03-05T17:21:11.5518Z [I] Initalizing PnP components. [ADUC_PnP_Components_Create]
2021-03-05T17:21:11.5518Z [I] ADUC agent started. Using IoT Hub Client SDK 1.6.0 [AzureDeviceUpdateCoreInterface_Create]
2021-03-05T17:21:11.5518Z [I] Calling ADUC_Register [ADUC_MethodCall_Register]
2021-03-05T17:21:11.5518Z [I] IoTHub Device Twin callback registered. [ADUC_DeviceClient_Create]
2021-03-05T17:21:11.5546Z [W] Failed to pass connection string to DO, error: -1 [StartupAgent]
2021-03-05T17:21:11.5546Z [I] Agent running. [main]
2021-03-05T17:21:11.9257Z [D] IotHub connection status: 0, reason:6 [ADUC_ConnectionStatus_Callback]
2021-03-05T17:21:12.4272Z [I] Processing existing Device Twin data after agent started. [ADUC_PnPDeviceTwin_Callback]
2021-03-05T17:21:12.4272Z [D] Notifies components that all callback are subscribed. [ADUC_PnPDeviceTwin_Callback]
2021-03-05T17:21:12.4272Z [I] DeviceInformation component is ready - reporting properties [DeviceInfoInterface_Connected]
2021-03-05T17:21:12.4273Z [I] Property manufacturer changed to Contoso [RefreshDeviceInfoInterfaceData]
2021-03-05T17:21:12.4273Z [I] Property model changed to Virtual-Machine [RefreshDeviceInfoInterfaceData]
2021-03-05T17:21:12.4273Z [I] Property osName changed to Linux [RefreshDeviceInfoInterfaceData]
2021-03-05T17:21:12.4273Z [I] Property swVersion changed to 4.15.0-136-generic [RefreshDeviceInfoInterfaceData]
2021-03-05T17:21:12.4273Z [I] Property processorArchitecture changed to x86-64 [RefreshDeviceInfoInterfaceData]
2021-03-05T17:21:12.4393Z [I] Property processorManufacturer changed to GenuineIntel [RefreshDeviceInfoInterfaceData]
2021-03-05T17:21:12.4393Z [I] Property totalMemory changed to 4039224 [RefreshDeviceInfoInterfaceData]
2021-03-05T17:21:12.4394Z [I] Property totalStorage changed to 130036836 [RefreshDeviceInfoInterfaceData]
2021-03-05T17:21:12.4395Z [I] No update content. Reporting Idle state. [ADUC_Workflow_HandleStartupWorkflowData]
2021-03-05T17:21:12.4395Z [I] Setting UpdateState to Idle [ADUC_SetUpdateStateHelper]
2021-03-05T17:21:12.4395Z [I] Reporting state: 0, Idle (0); HTTP 200; result 1, 0 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
2021-03-05T17:21:12.4395Z [I] UpdateAction: Idle. WorkflowId: 210305172112 [ADUC_MethodCall_Idle]
2021-03-05T17:21:12.4395Z [I] Calling IdleCallback [ADUC_MethodCall_Idle]
2021-03-05T17:21:12.4395Z [I] Now idle. workflowId: 210305172112 [Idle]
2021-03-05T18:09:12.6805Z [D] IotHub connection status: 1, reason:0 [ADUC_ConnectionStatus_Callback]
2021-03-05T18:09:13.2383Z [D] IotHub connection status: 0, reason:6 [ADUC_ConnectionStatus_Callback]
2021-03-05T18:57:13.9672Z [D] IotHub connection status: 1, reason:0 [ADUC_ConnectionStatus_Callback]
2021-03-05T18:57:14.5095Z [D] IotHub connection status: 0, reason:6 [ADUC_ConnectionStatus_Callback]
2021-03-05T19:45:15.2471Z [D] IotHub connection status: 1, reason:0 [ADUC_ConnectionStatus_Callback]
2021-03-05T19:45:15.8103Z [D] IotHub connection status: 0, reason:6 [ADUC_ConnectionStatus_Callback]
2021-03-05T20:33:16.5316Z [D] IotHub connection status: 1, reason:0 [ADUC_ConnectionStatus_Callback]
2021-03-05T20:33:16.9975Z [D] IotHub connection status: 0, reason:6 [ADUC_ConnectionStatus_Callback]

device update with x509 certificate

Hi All,

We were playing around with the device update agent, connecting to Azure, update the device software packages. We could connect the agent to Azure using the Shared Acess keys. But is there any way to do it using the x509 certs?. Please guide us if there any documents or links to some blogs.

Device update service doesn't send cancel if update action fails

When the installation fails, the failed state is reported correctly to Iot-Hub, but the backend service doesn't send a cancel to the device. Therefore it stays in faild state, and a update retry fails because the download is started from unexpected state.

2021-08-25T13:35:15.7125Z [I] Action 'Install' complete. Result: 0, -536870781 [ADUC_Workflow_WorkCompletionCallback]
2021-08-25T13:35:15.7126Z [E] Install failed. error 0, -536870781 - Expecting service to send Cancel action [ADUC_Workflow_WorkCompletionCallback]
2021-08-25T13:35:15.7126Z [I] Setting UpdateState to Failed [ADUC_SetUpdateStateHelper]
2021-08-25T13:35:15.7126Z [I] ---------------------else [ADUC_SetUpdateStateHelper]
2021-08-25T13:35:15.7127Z [I] Reporting state: 255, Failed (255); HTTP 500; result 0, -536870781 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
2021-08-25T13:35:15.7129Z [I] Calling SandboxDestroyCallback [ADUC_MethodCall_Idle]
2021-08-25T13:35:15.7129Z [I] Destroying sandbox /tmp/aduc-dl-210825133322. workflowId: 210825133322 [SandboxDestroy]
2021-08-25T13:35:15.7131Z [I] UpdateAction: Idle. Ending workflow with WorkflowId: 210825133322 [ADUC_MethodCall_Idle]
2021-08-25T13:35:15.7131Z [I] Calling IdleCallback [ADUC_MethodCall_Idle]
2021-08-25T13:35:15.7131Z [I] Now idle. workflowId:  [Idle]
2021-08-25T13:35:55.6071Z [D] ComponentName:azureDeviceUpdateAgent, propertyName:service [ADUC_PnP_ComponentClient_PropertyUpdate_Callback]
2021-08-25T13:35:55.6074Z [D] OrchestratorUpdateCallback received property JSON string ({"action":0,"updateManifest":"{\"manifestVersion\":\"2.0\",\"updateId\":{\"provider\":\"FuS\",\"name\":\"Firmware\",\"version\":\"1.0\"},\"updateType\":\"fus\/fsupdate:firmware\",\"installedCriteria\":\"20211012\",\"files\":{\"51c625e22164c1c1\":{\"fileName\":\"rauc_update_nand-V20211012.artifact\",\"sizeInBytes\":120944697,\"hashes\":{\"sha256\":\"7fYzv8\/WdIL5hq3S+sXe9YqLRuXGsfTvKngmZLhXgL8=\"}}},\"createdDateTime\":\"2021-08-24T02:46:57Z\"}","updateManifestSignature":"eyJhbGciOiJSUzI1NiIsInNqd2siOiJleUpoYkdjaU9pSlNVekkxTmlJc0ltdHBaQ0k2SWtGRVZTNHlNREEzTURJdVVpSjkuZXlKcmRIa2lPaUpTVTBFaUxDSnVJam9pYkV4bWMwdHZPRmwwWW1Oak1sRXpUalV3VlhSTVNXWlhVVXhXVTBGRlltTm9LMFl2WTJVM1V6Rlpja3BvV0U5VGNucFRaa051VEhCVmFYRlFWSGMwZWxndmRHbEJja0ZGZFhrM1JFRmxWVzVGU0VWamVEZE9hM2QzZVRVdk9IcExaV3AyWTBWWWNFRktMMlV6UWt0SE5FVTBiMjVtU0ZGRmNFOXplSGRQUzBWbFJ6QkhkamwzVjB3emVsUmpUblprUzFoUFJGaEdNMVZRWlVveGIwZGlVRkZ0Y3pKNmJVTktlRUppZEZOSldVbDBiWFpwWTNneVpXdGtWbnBYUm5jdmRrdFVUblZMYXpob2NVczNTRkptYWs5VlMzVkxXSGxqSzNsSVVVa3dZVVpDY2pKNmEyc3plR2d4ZEVWUFN6azRWMHBtZUdKamFsQnpSRTgyWjNwWmVtdFlla05OZW1Fd1R6QkhhV0pDWjB4QlZGUTVUV1k0V1ZCd1dVY3lhblpQWVVSVmIwTlJiakpWWTFWU1RtUnNPR2hLWW5scWJscHZNa3B5SzFVNE5IbDFjVTlyTjBZMFdubFRiMEoyTkdKWVNrZ3lXbEpTV2tab0wzVlRiSE5XT1hkU2JWbG9XWEoyT1RGRVdtbHhhemhJVWpaRVUyeHVabTVsZFRJNFJsUm9SVzF0YjNOVlRUTnJNbGxNYzBKak5FSnZkWEIwTTNsaFNEaFpia3BVTnpSMU16TjFlakU1TDAxNlZIVnFTMmMzVkdGcE1USXJXR0owYmxwRU9XcFVSMkY1U25Sc2FFWmxWeXRJUXpVM1FYUkJSbHBvY1ZsM2VVZHJXQ3M0TTBGaFVGaGFOR0V4VHpoMU1qTk9WVWQxTWtGd04yOU5NVTR3ZVVKS0swbHNUM29pTENKbElqb2lRVkZCUWlJc0ltRnNaeUk2SWxKVE1qVTJJaXdpYTJsa0lqb2lRVVJWTGpJeE1EWXdPUzVTTGxNaWZRLlJLS2VBZE02dGFjdWZpSVU3eTV2S3dsNFpQLURMNnEteHlrTndEdkljZFpIaTBIa2RIZ1V2WnoyZzZCTmpLS21WTU92dXp6TjhEczhybXo1dnMwT1RJN2tYUG1YeDZFLUYyUXVoUXNxT3J5LS1aN2J3TW5LYTNkZk1sbkthWU9PdURtV252RWMyR0hWdVVTSzREbmw0TE9vTTQxOVlMNThWTDAtSEthU18xYmNOUDhXYjVZR08xZXh1RmpiVGtIZkNIU0duVThJeUFjczlGTjhUT3JETHZpVEtwcWtvM3RiSUwxZE1TN3NhLWJkZExUVWp6TnVLTmFpNnpIWTdSanZGbjhjUDN6R2xjQnN1aVQ0XzVVaDZ0M05rZW1UdV9tZjdtZUFLLTBTMTAzMFpSNnNTR281azgtTE1sX0ZaUmh4djNFZFNtR2RBUTNlMDVMRzNnVVAyNzhTQWVzWHhNQUlHWmcxUFE3aEpoZGZHdmVGanJNdkdTSVFEM09wRnEtZHREcEFXbUo2Zm5sZFA1UWxYek5tQkJTMlZRQUtXZU9BYjh0Yjl5aVhsemhtT1dLRjF4SzlseHpYUG9GNmllOFRUWlJ4T0hxTjNiSkVISkVoQmVLclh6YkViV2tFNm4zTEoxbkd5M1htUlVFcER0Umdpa0tBUzZybFhFT0VneXNjIn0.eyJzaGEyNTYiOiJRWi9tTkRwR1FXYkliQy9pbk5jTVM5Z2lQMFVhNCswZnVMdG5zeXhKK0RjPSJ9.TIx2GdQpr118Q7SXtYTUC4OuwxXbJUcFnKpwQ7WdFKbqQL8kFpuapZloqKPVnhBEnzgcWrEjHiwnkbLCM1fekwmpvj5npz9Hmwp6bz1HwKOiyNZtjH2LSi9DuKo2Eux91nRBqbuurl9SU0R_Cyize-sbG-YvmZMv9Yk0ygRqcEEO-oFy-THcavJvVRTPhlJsnvDlrdgle81iezBIlXgQADvR69b04ScmMuHq-Bdsqc42-_hqLT9oTwIRODlOZftL52N2oUsHoo38y7kzwCGAURAXeTsWcV1-5Q9p7ODp1oksmm8tS_4PQ8S7oZHwWj_twq6H4ee6yfk-9vKP-P5oKllxSVMcX7ZrMRD4RB7dq8Osj1fPcUMaHyXV6i6h0ZK8Ee6RsDeoe2On-PLGVA02ynpm2xipOZJ1VgCU2Erl5cOgsWsLaB96hCHJQ6LrnX2_lGdpsS2YM98bnCsjarQ8PCWK6mFJhafkYvaVkvHBkdg-eKsYqgaKxJbc3m1M2diY","fileUrls":{"51c625e22164c1c1":"http:\/\/deviceupdateinsta [OrchestratorUpdateCallback]
2021-08-25T13:35:55.6097Z [I] Calling IsInstalledCallback to check if content is installed. [ADUC_MethodCall_IsInstalled]
2021-08-25T13:35:55.6097Z [I] IsInstalledCallback called [IsInstalledCallback]
2021-08-25T13:35:55.6098Z [I] IsInstalled called workflowId: , installed criteria: 20211012 [IsInstalled]
2021-08-25T13:35:55.7053Z [I] Installed criteria 20211012 was not installed, the current version is 20211013 [IsInstalled]
2021-08-25T13:35:55.7053Z [I] Processing 'Download' action [ADUC_Workflow_HandleUpdateAction]
2021-08-25T13:35:55.7054Z [I] Start the workflow - downloading, with WorkflowId 210825133555 [ADUC_Workflow_HandleUpdateAction]
2021-08-25T13:35:55.7054Z [I] UpdateAction: Prepare - calling PrepareCallback [ADUC_MethodCall_Prepare]
2021-08-25T13:35:55.7055Z [I] PrepareCallback called [PrepareCallback]
2021-08-25T13:35:55.7055Z [I] {210825133555} Received Metadata, UpdateType: fus/fsupdate:firmware, UpdateTypeName: fus/fsupdate, UpdateTypeVersion: firmware, FileCount: 1 [Prepare]
2021-08-25T13:35:55.7056Z [I] fsupdate_handler_create-called. [fus_fsupdate_CreateFunc]
2021-08-25T13:35:55.7056Z [I] Prepare succeeded. [Prepare]
2021-08-25T13:35:55.7056Z [I] UpdateAction: Download [ADUC_MethodCall_Download]
2021-08-25T13:35:55.7056Z [E] Download UpdateAction called in unexpected state: Failed! [ADUC_MethodCall_Download]
2021-08-25T13:35:55.7056Z [I] Action 'Download' complete. Result: 0, -536870911 [ADUC_Workflow_WorkCompletionCallback]
2021-08-25T13:35:55.7057Z [E] Download failed. error 0, -536870911 - Expecting service to send Cancel action [ADUC_Workflow_WorkCompletionCallback]
2021-08-25T13:35:55.7057Z [I] Setting UpdateState to Failed [ADUC_SetUpdateStateHelper]
2021-08-25T13:35:55.7057Z [I] ---------------------else [ADUC_SetUpdateStateHelper]
2021-08-25T13:35:55.7057Z [I] Reporting state: 255, Failed (255); HTTP 500; result 0, -536870911 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
2021-08-25T13:35:55.7058Z [I] UpdateAction: Idle. WorkFolder not set. -> SandboxDestroy was not called [ADUC_MethodCall_Idle]
2021-08-25T13:35:56.0579Z [I] Calling IdleCallback [ADUC_MethodCall_Idle]
2021-08-25T13:35:56.0580Z [I] Now idle. workflowId: 210825133555 [Idle]
2021-08-25T13:35:56.0581Z [I] OrchestratorPropertyUpdateCallback ended [OrchestratorUpdateCallback]
2021-08-25T13:36:26.5942Z [D] ComponentName:azureDeviceUpdateAgent, propertyName:service [ADUC_PnP_ComponentClient_PropertyUpdate_Callback]
2021-08-25T13:36:26.5945Z [D] OrchestratorUpdateCallback received property JSON string ({"action":255,"updateManifest":"{\"manifestVersion\":\"2.0\",\"updateId\":{\"provider\":\"FuS\",\"name\":\"Firmware\",\"version\":\"1.0\"},\"updateType\":\"fus\/fsupdate:firmware\",\"installedCriteria\":\"20211012\",\"files\":{\"51c625e22164c1c1\":{\"fileName\":\"rauc_update_nand-V20211012.artifact\",\"sizeInBytes\":120944697,\"hashes\":{\"sha256\":\"7fYzv8\/WdIL5hq3S+sXe9YqLRuXGsfTvKngmZLhXgL8=\"}}},\"createdDateTime\":\"2021-08-24T02:46:57Z\"}","updateManifestSignature":"eyJhbGciOiJSUzI1NiIsInNqd2siOiJleUpoYkdjaU9pSlNVekkxTmlJc0ltdHBaQ0k2SWtGRVZTNHlNREEzTURJdVVpSjkuZXlKcmRIa2lPaUpTVTBFaUxDSnVJam9pYkV4bWMwdHZPRmwwWW1Oak1sRXpUalV3VlhSTVNXWlhVVXhXVTBGRlltTm9LMFl2WTJVM1V6Rlpja3BvV0U5VGNucFRaa051VEhCVmFYRlFWSGMwZWxndmRHbEJja0ZGZFhrM1JFRmxWVzVGU0VWamVEZE9hM2QzZVRVdk9IcExaV3AyWTBWWWNFRktMMlV6UWt0SE5FVTBiMjVtU0ZGRmNFOXplSGRQUzBWbFJ6QkhkamwzVjB3emVsUmpUblprUzFoUFJGaEdNMVZRWlVveGIwZGlVRkZ0Y3pKNmJVTktlRUppZEZOSldVbDBiWFpwWTNneVpXdGtWbnBYUm5jdmRrdFVUblZMYXpob2NVczNTRkptYWs5VlMzVkxXSGxqSzNsSVVVa3dZVVpDY2pKNmEyc3plR2d4ZEVWUFN6azRWMHBtZUdKamFsQnpSRTgyWjNwWmVtdFlla05OZW1Fd1R6QkhhV0pDWjB4QlZGUTVUV1k0V1ZCd1dVY3lhblpQWVVSVmIwTlJiakpWWTFWU1RtUnNPR2hLWW5scWJscHZNa3B5SzFVNE5IbDFjVTlyTjBZMFdubFRiMEoyTkdKWVNrZ3lXbEpTV2tab0wzVlRiSE5XT1hkU2JWbG9XWEoyT1RGRVdtbHhhemhJVWpaRVUyeHVabTVsZFRJNFJsUm9SVzF0YjNOVlRUTnJNbGxNYzBKak5FSnZkWEIwTTNsaFNEaFpia3BVTnpSMU16TjFlakU1TDAxNlZIVnFTMmMzVkdGcE1USXJXR0owYmxwRU9XcFVSMkY1U25Sc2FFWmxWeXRJUXpVM1FYUkJSbHBvY1ZsM2VVZHJXQ3M0TTBGaFVGaGFOR0V4VHpoMU1qTk9WVWQxTWtGd04yOU5NVTR3ZVVKS0swbHNUM29pTENKbElqb2lRVkZCUWlJc0ltRnNaeUk2SWxKVE1qVTJJaXdpYTJsa0lqb2lRVVJWTGpJeE1EWXdPUzVTTGxNaWZRLlJLS2VBZE02dGFjdWZpSVU3eTV2S3dsNFpQLURMNnEteHlrTndEdkljZFpIaTBIa2RIZ1V2WnoyZzZCTmpLS21WTU92dXp6TjhEczhybXo1dnMwT1RJN2tYUG1YeDZFLUYyUXVoUXNxT3J5LS1aN2J3TW5LYTNkZk1sbkthWU9PdURtV252RWMyR0hWdVVTSzREbmw0TE9vTTQxOVlMNThWTDAtSEthU18xYmNOUDhXYjVZR08xZXh1RmpiVGtIZkNIU0duVThJeUFjczlGTjhUT3JETHZpVEtwcWtvM3RiSUwxZE1TN3NhLWJkZExUVWp6TnVLTmFpNnpIWTdSanZGbjhjUDN6R2xjQnN1aVQ0XzVVaDZ0M05rZW1UdV9tZjdtZUFLLTBTMTAzMFpSNnNTR281azgtTE1sX0ZaUmh4djNFZFNtR2RBUTNlMDVMRzNnVVAyNzhTQWVzWHhNQUlHWmcxUFE3aEpoZGZHdmVGanJNdkdTSVFEM09wRnEtZHREcEFXbUo2Zm5sZFA1UWxYek5tQkJTMlZRQUtXZU9BYjh0Yjl5aVhsemhtT1dLRjF4SzlseHpYUG9GNmllOFRUWlJ4T0hxTjNiSkVISkVoQmVLclh6YkViV2tFNm4zTEoxbkd5M1htUlVFcER0Umdpa0tBUzZybFhFT0VneXNjIn0.eyJzaGEyNTYiOiJRWi9tTkRwR1FXYkliQy9pbk5jTVM5Z2lQMFVhNCswZnVMdG5zeXhKK0RjPSJ9.TIx2GdQpr118Q7SXtYTUC4OuwxXbJUcFnKpwQ7WdFKbqQL8kFpuapZloqKPVnhBEnzgcWrEjHiwnkbLCM1fekwmpvj5npz9Hmwp6bz1HwKOiyNZtjH2LSi9DuKo2Eux91nRBqbuurl9SU0R_Cyize-sbG-YvmZMv9Yk0ygRqcEEO-oFy-THcavJvVRTPhlJsnvDlrdgle81iezBIlXgQADvR69b04ScmMuHq-Bdsqc42-_hqLT9oTwIRODlOZftL52N2oUsHoo38y7kzwCGAURAXeTsWcV1-5Q9p7ODp1oksmm8tS_4PQ8S7oZHwWj_twq6H4ee6yfk-9vKP-P5oKllxSVMcX7ZrMRD4RB7dq8Osj1fPcUMaHyXV6i6h0ZK8Ee6RsDeoe2On-PLGVA02ynpm2xipOZJ1VgCU2Erl5cOgsWsLaB96hCHJQ6LrnX2_lGdpsS2YM98bnCsjarQ8PCWK6mFJhafkYvaVkvHBkdg-eKsYqgaKxJbc3m1M2diY","fileUrls":{"51c625e22164c1c1":"http:\/\/deviceupdateins [OrchestratorUpdateCallback]
2021-08-25T13:36:26.5946Z [I] Cancel received with no operation in progress - returning to Idle state [ADUC_Workflow_HandleUpdateAction]
2021-08-25T13:36:26.5947Z [I] Setting UpdateState to Idle [ADUC_SetUpdateStateHelper]
2021-08-25T13:36:26.5947Z [I] ---------------------if [ADUC_SetUpdateStateHelper]
2021-08-25T13:36:26.5947Z [I] Reporting state: 0, Idle (0); HTTP 200; result 1, 0 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
2021-08-25T13:36:26.5948Z [I] UpdateAction: Idle. WorkFolder not set. -> SandboxDestroy was not called [ADUC_MethodCall_Idle]
2021-08-25T13:36:26.5948Z [I] Calling IdleCallback [ADUC_MethodCall_Idle]
2021-08-25T13:36:26.5948Z [I] Now idle. workflowId: 210825133555 [Idle]
2021-08-25T13:36:26.5949Z [I] OrchestratorPropertyUpdateCallback ended [OrchestratorUpdateCallback]
2021-08-25T13:36:28.8038Z [D] ComponentName:azureDeviceUpdateAgent, propertyName:service [ADUC_PnP_ComponentClient_PropertyUpdate_Callback]
2021-08-25T13:36:28.8039Z [D] OrchestratorUpdateCallback received property JSON string ({"action":255,"updateManifest":"","updateManifestSignature":"","fileUrls":null}), property version (643) [OrchestratorUpdateCallback]
2021-08-25T13:36:28.8040Z [I] Cancel received with no operation in progress - returning to Idle state [ADUC_Workflow_HandleUpdateAction]
2021-08-25T13:36:28.8040Z [I] Setting UpdateState to Idle [ADUC_SetUpdateStateHelper]
2021-08-25T13:36:28.8040Z [I] ---------------------if [ADUC_SetUpdateStateHelper]
2021-08-25T13:36:28.8040Z [I] Reporting state: 0, Idle (0); HTTP 200; result 1, 0 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
2021-08-25T13:36:28.8041Z [I] UpdateAction: Idle. WorkFolder not set. -> SandboxDestroy was not called [ADUC_MethodCall_Idle]
2021-08-25T13:36:28.8041Z [I] Calling IdleCallback [ADUC_MethodCall_Idle]
2021-08-25T13:36:28.8042Z [I] Now idle. workflowId: 210825133555 [Idle]
2021-08-25T13:36:28.8042Z [I] OrchestratorPropertyUpdateCallback ended [OrchestratorUpdateCallback]
2021-08-25T13:39:21.9644Z [D] ComponentName:azureDeviceUpdateAgent, propertyName:service [ADUC_PnP_ComponentClient_PropertyUpdate_Callback]
2021-08-25T13:39:21.9647Z [D] OrchestratorUpdateCallback received property JSON string ({"action":0,"updateManifest":"{\"manifestVersion\":\"2.0\",\"updateId\":{\"provider\":\"FuS\",\"name\":\"Firmware\",\"version\":\"1.0\"},\"updateType\":\"fus\/fsupdate:firmware\",\"installedCriteria\":\"20211012\",\"files\":{\"51c625e22164c1c1\":{\"fileName\":\"rauc_update_nand-V20211012.artifact\",\"sizeInBytes\":120944697,\"hashes\":{\"sha256\":\"7fYzv8\/WdIL5hq3S+sXe9YqLRuXGsfTvKngmZLhXgL8=\"}}},\"createdDateTime\":\"2021-08-24T02:46:57Z\"}","updateManifestSignature":"eyJhbGciOiJSUzI1NiIsInNqd2siOiJleUpoYkdjaU9pSlNVekkxTmlJc0ltdHBaQ0k2SWtGRVZTNHlNREEzTURJdVVpSjkuZXlKcmRIa2lPaUpTVTBFaUxDSnVJam9pYkV4bWMwdHZPRmwwWW1Oak1sRXpUalV3VlhSTVNXWlhVVXhXVTBGRlltTm9LMFl2WTJVM1V6Rlpja3BvV0U5VGNucFRaa051VEhCVmFYRlFWSGMwZWxndmRHbEJja0ZGZFhrM1JFRmxWVzVGU0VWamVEZE9hM2QzZVRVdk9IcExaV3AyWTBWWWNFRktMMlV6UWt0SE5FVTBiMjVtU0ZGRmNFOXplSGRQUzBWbFJ6QkhkamwzVjB3emVsUmpUblprUzFoUFJGaEdNMVZRWlVveGIwZGlVRkZ0Y3pKNmJVTktlRUppZEZOSldVbDBiWFpwWTNneVpXdGtWbnBYUm5jdmRrdFVUblZMYXpob2NVczNTRkptYWs5VlMzVkxXSGxqSzNsSVVVa3dZVVpDY2pKNmEyc3plR2d4ZEVWUFN6azRWMHBtZUdKamFsQnpSRTgyWjNwWmVtdFlla05OZW1Fd1R6QkhhV0pDWjB4QlZGUTVUV1k0V1ZCd1dVY3lhblpQWVVSVmIwTlJiakpWWTFWU1RtUnNPR2hLWW5scWJscHZNa3B5SzFVNE5IbDFjVTlyTjBZMFdubFRiMEoyTkdKWVNrZ3lXbEpTV2tab0wzVlRiSE5XT1hkU2JWbG9XWEoyT1RGRVdtbHhhemhJVWpaRVUyeHVabTVsZFRJNFJsUm9SVzF0YjNOVlRUTnJNbGxNYzBKak5FSnZkWEIwTTNsaFNEaFpia3BVTnpSMU16TjFlakU1TDAxNlZIVnFTMmMzVkdGcE1USXJXR0owYmxwRU9XcFVSMkY1U25Sc2FFWmxWeXRJUXpVM1FYUkJSbHBvY1ZsM2VVZHJXQ3M0TTBGaFVGaGFOR0V4VHpoMU1qTk9WVWQxTWtGd04yOU5NVTR3ZVVKS0swbHNUM29pTENKbElqb2lRVkZCUWlJc0ltRnNaeUk2SWxKVE1qVTJJaXdpYTJsa0lqb2lRVVJWTGpJeE1EWXdPUzVTTGxNaWZRLlJLS2VBZE02dGFjdWZpSVU3eTV2S3dsNFpQLURMNnEteHlrTndEdkljZFpIaTBIa2RIZ1V2WnoyZzZCTmpLS21WTU92dXp6TjhEczhybXo1dnMwT1RJN2tYUG1YeDZFLUYyUXVoUXNxT3J5LS1aN2J3TW5LYTNkZk1sbkthWU9PdURtV252RWMyR0hWdVVTSzREbmw0TE9vTTQxOVlMNThWTDAtSEthU18xYmNOUDhXYjVZR08xZXh1RmpiVGtIZkNIU0duVThJeUFjczlGTjhUT3JETHZpVEtwcWtvM3RiSUwxZE1TN3NhLWJkZExUVWp6TnVLTmFpNnpIWTdSanZGbjhjUDN6R2xjQnN1aVQ0XzVVaDZ0M05rZW1UdV9tZjdtZUFLLTBTMTAzMFpSNnNTR281azgtTE1sX0ZaUmh4djNFZFNtR2RBUTNlMDVMRzNnVVAyNzhTQWVzWHhNQUlHWmcxUFE3aEpoZGZHdmVGanJNdkdTSVFEM09wRnEtZHREcEFXbUo2Zm5sZFA1UWxYek5tQkJTMlZRQUtXZU9BYjh0Yjl5aVhsemhtT1dLRjF4SzlseHpYUG9GNmllOFRUWlJ4T0hxTjNiSkVISkVoQmVLclh6YkViV2tFNm4zTEoxbkd5M1htUlVFcER0Umdpa0tBUzZybFhFT0VneXNjIn0.eyJzaGEyNTYiOiJRWi9tTkRwR1FXYkliQy9pbk5jTVM5Z2lQMFVhNCswZnVMdG5zeXhKK0RjPSJ9.TIx2GdQpr118Q7SXtYTUC4OuwxXbJUcFnKpwQ7WdFKbqQL8kFpuapZloqKPVnhBEnzgcWrEjHiwnkbLCM1fekwmpvj5npz9Hmwp6bz1HwKOiyNZtjH2LSi9DuKo2Eux91nRBqbuurl9SU0R_Cyize-sbG-YvmZMv9Yk0ygRqcEEO-oFy-THcavJvVRTPhlJsnvDlrdgle81iezBIlXgQADvR69b04ScmMuHq-Bdsqc42-_hqLT9oTwIRODlOZftL52N2oUsHoo38y7kzwCGAURAXeTsWcV1-5Q9p7ODp1oksmm8tS_4PQ8S7oZHwWj_twq6H4ee6yfk-9vKP-P5oKllxSVMcX7ZrMRD4RB7dq8Osj1fPcUMaHyXV6i6h0ZK8Ee6RsDeoe2On-PLGVA02ynpm2xipOZJ1VgCU2Erl5cOgsWsLaB96hCHJQ6LrnX2_lGdpsS2YM98bnCsjarQ8PCWK6mFJhafkYvaVkvHBkdg-eKsYqgaKxJbc3m1M2diY","fileUrls":{"51c625e22164c1c1":"http:\/\/deviceupdateinsta [OrchestratorUpdateCallback]
2021-08-25T13:39:21.9669Z [I] Calling IsInstalledCallback to check if content is installed. [ADUC_MethodCall_IsInstalled]
2021-08-25T13:39:21.9669Z [I] IsInstalledCallback called [IsInstalledCallback]
2021-08-25T13:39:21.9669Z [I] IsInstalled called workflowId: 210825133555, installed criteria: 20211012 [IsInstalled]
2021-08-25T13:39:21.9669Z [E] Faield to read Version file. Invaliede filetype '' [IsInstalled]
2021-08-25T13:39:21.9669Z [I] Processing 'Download' action [ADUC_Workflow_HandleUpdateAction]
2021-08-25T13:39:21.9670Z [I] Start the workflow - downloading, with WorkflowId 210825133921 [ADUC_Workflow_HandleUpdateAction]
2021-08-25T13:39:21.9670Z [I] UpdateAction: Prepare - calling PrepareCallback [ADUC_MethodCall_Prepare]
2021-08-25T13:39:21.9670Z [I] PrepareCallback called [PrepareCallback]
2021-08-25T13:39:21.9671Z [I] {210825133921} Received Metadata, UpdateType: fus/fsupdate:firmware, UpdateTypeName: fus/fsupdate, UpdateTypeVersion: firmware, FileCount: 1 [Prepare]
2021-08-25T13:39:22.3209Z [I] fsupdate_handler_create-called. [fus_fsupdate_CreateFunc]
2021-08-25T13:39:22.3209Z [I] Prepare succeeded. [Prepare]
2021-08-25T13:39:22.3210Z [I] UpdateAction: Download [ADUC_MethodCall_Download]
2021-08-25T13:39:22.3210Z [I] Calling SandboxCreateCallback [ADUC_MethodCall_Download]
2021-08-25T13:39:22.3214Z [I] Setting sandbox /tmp/aduc-dl-210825133921 [SandboxCreate]
2021-08-25T13:39:22.3214Z [I] Using sandbox /tmp/aduc-dl-210825133921 [ADUC_MethodCall_Download]
2021-08-25T13:39:22.3214Z [I] Setting UpdateState to DownloadStarted [ADUC_SetUpdateStateHelper]
2021-08-25T13:39:22.3214Z [I] ---------------------else [ADUC_SetUpdateStateHelper]
2021-08-25T13:39:22.3215Z [I] Calling DownloadCallback [ADUC_MethodCall_Download]
2021-08-25T13:39:22.3215Z [I] Download thread started [DownloadCallback]
2021-08-25T13:39:22.3218Z [I] OrchestratorPropertyUpdateCallback ended [OrchestratorUpdateCallback]
2021-08-25T13:39:22.3220Z [D] Downloading 1 files to /tmp/aduc-dl-210825133921 [Download]
2021-08-25T13:39:22.3221Z [I] Downloading File 'rauc_update_nand-V20211012.artifact' from 'http://deviceupdateinstance--schneider-device-update.b.nlu.dl.adu.microsoft.com/northeurope/deviceupdateinstance--schneider-device-update/6ecc8a8fb83b4160bd833ac8eb68ad74/rauc_update_nand-V20211012.artifact' to '/tmp/aduc-dl-210825133921/rauc_update_nand-V20211012.artifact' [Download]

Error from package update: "The installed criteria is not met. The current update was not installed on the device"

Hi,
I am trying to do a package update by installing a Debian package for the first time.
I can see in the logs that the error is "The installed criteria is not met. The current update was not installed on the device".
Does anyone know how I can resolve this error?

Manifest used:

{
    "name": "mycompany-iot-firmware",
    "version": "1.0.0",
    "packages": [
        {
            "name": "mycompany-iot-firmware",
            "version": "1.0.0"
        }
    ],
	"updateId": {
		"provider": "mycompany",
		"name": "mycompany-iot-firmware",
		"version": "1.0.0"
	},
	"updateType": "microsoft/apt:1",
	"installedCriteria": "mycompany-iot-firmware-1.0.0",
	"compatibility": [{
			"deviceManufacturer": "Sony",
			"deviceModel": "RaspberryPi4B"
		}
	],
	"files": [{
			"filename": "mycompany-iot-firmware.deb",
			"sizeInBytes": 20711084,
			"hashes": {
				"sha256": "Gtft/bPVfs9KmFrI+QK4o40YNpeMJFhqFqVjdBi5a6k="
			}
		}
	],
	"createdDateTime": "2021-10-25T06:16:43.2847417Z",
	"manifestVersion": "2.0"
}

Logs from adu-agent

Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6854Z [I] Perform startup tasks. [ADUC_Workflow_HandleStartupWorkflowData]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6855Z [I] Calling IsInstalledCallback to check if content is installed. [ADUC_MethodCall_IsInstalled]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6855Z [I] IsInstalledCallback called [IsInstalledCallback]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6855Z [I] IsInstalled called workflowId: , installed criteria: mycompany-iot-firmware-1.0.0 [IsInstalled]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6856Z [I] microsoft_apt_CreateFunc called. [microsoft_apt_CreateFunc]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6857Z [I] Evaluating installedCriteria mycompany-iot-firmware-1.0.0 [GetIsInstalled]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6857Z [I] The installed criteria is not met. The current update was not installed on the device. [ADUC_Workflow_HandleStartupWorkflowData]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6858Z [I] Setting UpdateState to Idle [ADUC_SetUpdateStateHelper]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6858Z [I] Reporting state: 0, Idle (0); HTTP 200; result 1, 0 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6859Z [I] UpdateAction: Idle. WorkflowId: 211103060005 [ADUC_MethodCall_Idle]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6860Z [I] Calling IdleCallback [ADUC_MethodCall_Idle]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6860Z [I] Now idle. workflowId: 211103060005 [Idle]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6861Z [I] OrchestratorPropertyUpdateCallback ended [OrchestratorUpdateCallback]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6862Z [I] Processing existing Device Twin data after agent started. [ADUC_PnPDeviceTwin_Callback]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6862Z [D] Notifies components that all callback are subscribed. [ADUC_PnPDeviceTwin_Callback]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6862Z [I] DeviceInformation component is ready - reporting properties [DeviceInfoInterface_Connected]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6864Z [I] Property manufacturer changed to Sony [RefreshDeviceInfoInterfaceData]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6866Z [I] Property model changed to RaspberryPi4B [RefreshDeviceInfoInterfaceData]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6866Z [I] Property osName changed to Linux [RefreshDeviceInfoInterfaceData]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6867Z [I] Property swVersion changed to 5.10.17-v7l- [RefreshDeviceInfoInterfaceData]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.6868Z [I] Property processorArchitecture changed to armv7l [RefreshDeviceInfoInterfaceData]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.7079Z [I] Property processorManufacturer changed to ARM [RefreshDeviceInfoInterfaceData]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.7081Z [I] Property totalMemory changed to 3817356 [RefreshDeviceInfoInterfaceData]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: 2021-11-03T06:00:05.7082Z [I] Property totalStorage changed to 2344700 [RefreshDeviceInfoInterfaceData]
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: -> 17:00:05 SUBSCRIBE | PACKET_ID: 4 | TOPIC_NAME: $iothub/twin/PATCH/properties/desired/# | QOS: 0
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: <- 17:00:05 SUBACK | PACKET_ID: 4 | RETURN_CODE: 0
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: -> 17:00:06 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/PATCH/properties/reported/?$rid=5 | PAYLOAD_LEN: 99
Nov 03 17:00:06 raspberrypi AducIotAgent[2906]: -> 17:00:06 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/PATCH/properties/reported/?$rid=6 | PAYLOAD_LEN: 3224
^C

Aduc 127 extendedErrorCode when applying a update

Hi, i'm running into a problem when the device update client runs the apply action, which happens right after installation of the update image. I'm getting extendedErrorCode 127 which indicates to me that some tool is missing in my linux system. My question is: Is there a list of dependencies that i need to provide on my linux system or better yet how can i find out what tool is missing on my system.

This is the log output:
2021-10-27T21:42:44.1987Z [I] Install succeeded [Install] 2021-10-27T21:42:44.1988Z [I] Action 'Install' complete. Result: 1, 0 [ADUC_Workflow_WorkCompletionCallback] 2021-10-27T21:42:44.1988Z [I] WorkCompletionCallback: Install succeeded. Going to state InstallSucceeded [ADUC_Workflow_WorkCompletionCallback] 2021-10-27T21:42:44.1989Z [I] Setting UpdateState to InstallSucceeded [ADUC_SetUpdateStateHelper] 2021-10-27T21:42:44.1989Z [I] Reporting state: InstallSucceeded (4) [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync] 2021-10-27T21:42:45.9129Z [D] ComponentName:azureDeviceUpdateAgent, propertyName:service [ADUC_PnP_ComponentClient_PropertyUpdate_Callback] 2021-10-27T21:42:45.9132Z [D] OrchestratorUpdateCallback received property JSON string ({"action":2,"updateManifest":"{\"manifestVersion\":\"2.0\",\"updateId\":{\"provider\":\"Elicity\",\"name\":\"beacon-firmware-update\",\"version\":\"0.0.0.1\"},\"updateType\":\"microsoft\/swupdate:1\",\"installedCriteria\":\"0.0.0.1\",\"files\":{\"fbfaffe17349d14f9\":{\"fileName\":\"beacon-image-update-raspberrypi4.swu\",\"sizeInBytes\":1162 [OrchestratorUpdateCallback] 2021-10-27T21:42:45.9169Z [I] Processing 'Apply' action [ADUC_Workflow_HandleUpdateAction] 2021-10-27T21:42:45.9169Z [I] UpdateAction: Apply [ADUC_MethodCall_Apply] 2021-10-27T21:42:45.9170Z [I] Setting UpdateState to ApplyStarted [ADUC_SetUpdateStateHelper] 2021-10-27T21:42:45.9170Z [I] Calling ApplyCallback [ADUC_MethodCall_Apply] 2021-10-27T21:42:45.9170Z [I] Apply thread started [ApplyCallback] 2021-10-27T21:42:45.9172Z [I] Applying data from /tmp/aduc-dl-211027213111 [Apply] 2021-10-27T21:42:45.9173Z [I] OrchestratorPropertyUpdateCallback ended [OrchestratorUpdateCallback] 2021-10-27T21:42:45.9726Z [E] Apply failed, extendedResultCode = 127 [Apply] 2021-10-27T21:42:45.9727Z [I] Action 'Apply' complete. Result: 0, 127 [ADUC_Workflow_WorkCompletionCallback] 2021-10-27T21:42:45.9728Z [E] Apply failed. error 0, 127 - Expecting service to send Cancel action [ADUC_Workflow_WorkCompletionCallback] 2021-10-27T21:42:45.9728Z [I] Setting UpdateState to Failed [ADUC_SetUpdateStateHelper] 2021-10-27T21:42:45.9728Z [I] Reporting state: 255, Failed (255); HTTP 500; result 0, 127 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync] 2021-10-27T21:42:47.8239Z [D] ComponentName:azureDeviceUpdateAgent, propertyName:service [ADUC_PnP_ComponentClient_PropertyUpdate_Callback] 2021-10-27T21:42:47.8240Z [D] OrchestratorUpdateCallback received property JSON string ({"action":255,"updateManifest":"","updateManifestSignature":""}), property version (61) [OrchestratorUpdateCallback] 2021-10-27T21:42:47.8240Z [I] Cancel received with no operation in progress - returning to Idle state [ADUC_Workflow_HandleUpdateAction] 2021-10-27T21:42:47.8241Z [I] Setting UpdateState to Idle [ADUC_SetUpdateStateHelper] 2021-10-27T21:42:47.8241Z [I] Reporting state: 0, Idle (0); HTTP 200; result 1, 0 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync] 2021-10-27T21:42:47.8242Z [I] Calling SandboxDestroyCallback [ADUC_MethodCall_Idle] 2021-10-27T21:42:47.8242Z [I] Destroying sandbox /tmp/aduc-dl-211027213111. workflowId: 211027213111 [SandboxDestroy] 2021-10-27T21:42:47.8244Z [I] UpdateAction: Idle. WorkflowId: 211027214247 [ADUC_MethodCall_Idle] 2021-10-27T21:42:47.8245Z [I] Calling IdleCallback [ADUC_MethodCall_Idle] 2021-10-27T21:42:47.8245Z [I] Now idle. workflowId: 211027214247 [Idle] 2021-10-27T21:42:47.8245Z [I] OrchestratorPropertyUpdateCallback ended [OrchestratorUpdateCallback]

Source code for reference image availiable?

Hi,

  • Could you make the code for building the reference Yocto image open source?

  • And/or could you describe the steps necessary steps to set up ADU and SWUpdate. E.g. In the reference image, a log folder is placed in /adu/logs and the public key for signed imaged in /adukey. Explanation of these details and how ADU communicates with SWUpdate and its configuration with be appreciated.

Background:
We'd like to build our own Raspberry image for swupdates with ADU and enable file updates and running scripts. Moreover, the image would have IoT Edge runtime 1.2 along with identity service. Thus far we have not completed a successful SWUpdate through ADU (however running is directly on the Raspberry with the swupdate-command and swu-file in a local folder works), instead it stays at in progress. (also, advice on how to get verbose logging here would be great).

Thanks

Resource Limits Docs

Currently getting the below error

You have reached a limit on the number of different Providers, Names of Versions allowed in your instance of Device Update for IoT Hub. Delete some updates from your instance and try again.

Is a documentation around what are the limits with for ADU

Customization in OTA flow between IOT device and IOT HUB service

Hi Everyone,

I am working on device update or OTA implementation with azure. Azure has device update feature with IOT hub.
I am utilizing same service for my task.

I want to customized the IOT device update code for OTA operation.
Normally IOT HUB Service initiate the all action(Download, Install, Apply) and based on request device will be acted, once requested action done ,device will update the state to IOT hub service and go ideal state where wait for next action..

I want to add one additional layer or confirmation layer for each action[Download, Install, Apply)] , mean when IOT hub Service request for any action,
device will received as twin properties update. Instead executing the respective process(e.g. downloading the Firmware), device will wait for confirmation/ approval (which is customization part to be implemented ) from external/manual resource.
Once confirmation/approval received, device will resume with flow and execute the respective process( device will start downloading the firmware and update response to IOT HUB Service).

My Question based on above scenario as follow

  1. Does it possible to implement above follow with current IOT HUB device update implementation from azure.
  2. What will happen if device not reply to IOT hub service for requested action ? Does it discard the whole OTA process ?
  3. What is time period of waiting for IOT hub service when it request for any action and waiting for reply ? My target to make wait for 30 days and if no approval or confirmation receive the, reply back to IOT hub service with fail/Discard response.
  4. Can I make 30 days waiting period for IOT hub service API response ?

Please answer me as soon as possible. As most of development depend on it.

Regards,
Gaurav Choubey

Logging enhancement question

Are there plans to upload the ADU agent logging data to an Azure Storage or to send log data from the ADU agent to a Log Analytics Workspace in Azure?

Device keeps in progress state after IsInstalled succeeds

Quick Question:

Question 1:
Is it intended that the device stays in the "in progress" state even when the IsInstalled call succeeds ? I would set the state to succeeded, then I have a clear picture in the deployment overview. But before doing that, I would like to know if there is more to it.
Edit: Is it correct that I had to report apply action and idle state to get the result that I want ?
Edit2:
Question 2:
Why is the download URL Removed after the Download success is reported ? It would be handy if this entry stays in device twin. That way, it would be possible to redownload the file if it was lost in a reboot between download and install.
I know that the current workflow doesn't support this, so the download URL is not needed anymore.

Thanks

How to debugging imcompatible for device update ?

have any log for imcompatible?
or how to check this issues?

test with the below code on Yocto Dunfell
github.com/Azure/iot-hub-device-update with commit id:367b880baf43294f8b127612f7687e1247d50c79
github.com/microsoft/do-client/ with commit id:713fe558a8a7fa8213ebe261aacbfd16f531b9b0

image
check https://docs.microsoft.com/en-us/azure/iot-hub-device-update/device-update-raspberry-pi

maybe I lost something so show "No available updates"
Would you give me a hand for more detail about how to create correct update steps?
image

device twin


{
  "deviceId": "RPI3B_ADU_TEST",
  "etag": "AAAAAAAAAAI=",
  "deviceEtag": "MTcyNTE4NzEw",
  "status": "enabled",
  "statusUpdateTime": "0001-01-01T00:00:00Z",
  "connectionState": "Connected",
  "lastActivityTime": "0001-01-01T00:00:00Z",
  "cloudToDeviceMessageCount": 0,
  "authenticationType": "sas",
  "x509Thumbprint": {
    "primaryThumbprint": null,
    "secondaryThumbprint": null
  },
  "modelId": "dtmi:AzureDeviceUpdate;1",
  "version": 36,
  "tags": {
    "ADUGroup": "RPI3B"
  },
  "properties": {
    "desired": {
      "$metadata": {
        "$lastUpdated": "2021-03-19T05:15:35.8672954Z"
      },
      "$version": 1
    },
    "reported": {
      "deviceInformation": {
        "__t": "c",
        "manufacturer": "UWINGS",
        "model": "raspberrypi3b",
        "osName": "Linux",
        "swVersion": "5.4.72-v7",
        "processorArchitecture": "armv7l",
        "processorManufacturer": "ARM",
        "totalMemory": 946596,
        "totalStorage": 990784
      },
      "azureDeviceUpdateAgent": {
        "__t": "c",
        "client": {
          "state": 0,
          "resultCode": 200,
          "extendedResultCode": 0,
          "deviceProperties": {
            "manufacturer": "UWINGS",
            "model": "raspberrypi3b",
            "aduVer": "DU;agent/0.6.0-public-preview",
            "doVer": "DU;lib/v0.4.0+20210316.230533.713fe55,DU;agent/v0.4.0+20210316.230533.713fe55"
          }
        }
      },
      "$metadata": {
        "$lastUpdated": "2021-03-19T07:46:34.8986571Z",
        "deviceInformation": {
          "$lastUpdated": "2021-03-19T07:46:34.8936641Z",
          "__t": {
            "$lastUpdated": "2021-03-19T07:46:34.8936641Z"
          },
          "manufacturer": {
            "$lastUpdated": "2021-03-19T07:46:34.8936641Z"
          },
          "model": {
            "$lastUpdated": "2021-03-19T07:46:34.8936641Z"
          },
          "osName": {
            "$lastUpdated": "2021-03-19T07:46:34.8936641Z"
          },
          "swVersion": {
            "$lastUpdated": "2021-03-19T07:46:34.8936641Z"
          },
          "processorArchitecture": {
            "$lastUpdated": "2021-03-19T07:46:34.8936641Z"
          },
          "processorManufacturer": {
            "$lastUpdated": "2021-03-19T07:46:34.8936641Z"
          },
          "totalMemory": {
            "$lastUpdated": "2021-03-19T07:46:34.8936641Z"
          },
          "totalStorage": {
            "$lastUpdated": "2021-03-19T07:46:34.8936641Z"
          }
        },
        "azureDeviceUpdateAgent": {
          "$lastUpdated": "2021-03-19T07:46:34.8986571Z",
          "__t": {
            "$lastUpdated": "2021-03-19T07:46:34.8986571Z"
          },
          "client": {
            "$lastUpdated": "2021-03-19T07:46:34.8986571Z",
            "state": {
              "$lastUpdated": "2021-03-19T07:46:34.8986571Z"
            },
            "resultCode": {
              "$lastUpdated": "2021-03-19T07:46:34.8986571Z"
            },
            "extendedResultCode": {
              "$lastUpdated": "2021-03-19T07:46:34.8986571Z"
            },
            "deviceProperties": {
              "$lastUpdated": "2021-03-19T07:46:34.8986571Z",
              "manufacturer": {
                "$lastUpdated": "2021-03-19T07:46:34.8986571Z"
              },
              "model": {
                "$lastUpdated": "2021-03-19T07:46:34.8986571Z"
              },
              "aduVer": {
                "$lastUpdated": "2021-03-19T07:46:34.8986571Z"
              },
              "doVer": {
                "$lastUpdated": "2021-03-19T07:46:34.8986571Z"
              }
            }
          }
        }
      },
      "$version": 34
    }
  },
  "capabilities": {
    "iotEdge": false
  }
}

importManifest.json


{
  "updateId": {
    "provider": "UWINGS.1",
    "name": "raspberrypi3b",
    "version": "0.0.2"
  },
  "updateType": "microsoft/swupdate:1",
  "installedCriteria": "5",
  "compatibility": [
    {
      "deviceManufacturer": "UWINGS",
      "deviceModel": "raspberrypi3b"
    }
  ],
  "files": [
    {
      "filename": "adu-update-image-raspberrypi3.swu",
      "sizeInBytes": 98632192,
      "hashes": {
        "sha256": "k2kx2oFn87/8cLPr5gPS1MQ+gbDbs+n+qNoeR5FSAPY="
      }
    }
  ],
  "createdDateTime": "2021-03-19T07:48:24.1369187Z",
  "manifestVersion": "2.0"
}

iot-hub-device-update log
===


Mar 19 07:46:31 raspberrypi3 systemd[1]: Started Azure Device Update Agent daemon..
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:31.8656Z [I] Agent (linux; 0.6.0-public-preview) starting. [main]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:31.8656Z [I] Git Info: main:367b880 [main]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:31.8657Z [I] Agent built with handlers: microsoft/swupdate. [main]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:31.8661Z [I] Initalizing PnP components. [ADUC_PnP_Components_Create]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:31.8661Z [I] ADUC agent started. Using IoT Hub Client SDK 1.6.0 [AzureDeviceUpdateCoreInterface_Create]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:31.8662Z [I] Calling ADUC_Register [ADUC_MethodCall_Register]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:31.8662Z [I] IoTHub Device Twin callback registered. [ADUC_DeviceClient_Create]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:31.8669Z [W] Failed to pass connection string to DO, error: -1 [StartupAgent]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:31.8669Z [I] Agent running. [main]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: -> 07:46:32 CONNECT | VER: 4 | KEEPALIVE: 240 | FLAGS: 192 | USERNAME: AduTestHub.azure-devices.net/RPI3B_ADU_TEST/?api-version=2020-09-30&DeviceClientType=iothubclient%2f1.6.0%20(native%3b%20Linux%3b%20armv7l)&model-id=dtmi%3aAzureDeviceUpdate%3b1 | PWD: XXXX | CLEAN: 0
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: <- 07:46:33 CONNACK | SESSION_PRESENT: true | RETURN_CODE: 0x0
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:33.3255Z [D] IotHub connection status: 0, reason:6 [ADUC_ConnectionStatus_Callback]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: -> 07:46:33 SUBSCRIBE | PACKET_ID: 2 | TOPIC_NAME: $iothub/twin/res/# | QOS: 0
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: <- 07:46:33 SUBACK | PACKET_ID: 2 | RETURN_CODE: 0
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: -> 07:46:33 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/GET/?$rid=3
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: <- 07:46:34 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: QOS_VALUE_INVALID | TOPIC_NAME: $iothub/twin/res/200/?$rid=3 | PAYLOAD_LEN: 577
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3284Z [I] Processing existing Device Twin data after agent started. [ADUC_PnPDeviceTwin_Callback]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3285Z [D] Notifies components that all callback are subscribed. [ADUC_PnPDeviceTwin_Callback]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3285Z [I] DeviceInformation component is ready - reporting properties [DeviceInfoInterface_Connected]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3287Z [I] Property manufacturer changed to UWINGS [RefreshDeviceInfoInterfaceData]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3288Z [I] Property model changed to raspberrypi3b [RefreshDeviceInfoInterfaceData]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3289Z [I] Property osName changed to Linux [RefreshDeviceInfoInterfaceData]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3289Z [I] Property swVersion changed to 5.4.72-v7 [RefreshDeviceInfoInterfaceData]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3290Z [I] Property processorArchitecture changed to armv7l [RefreshDeviceInfoInterfaceData]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3441Z [I] Property processorManufacturer changed to ARM [RefreshDeviceInfoInterfaceData]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3442Z [I] Property totalMemory changed to 946596 [RefreshDeviceInfoInterfaceData]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3443Z [I] Property totalStorage changed to 990784 [RefreshDeviceInfoInterfaceData]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3445Z [I] No update content. Reporting Idle state. [ADUC_Workflow_HandleStartupWorkflowData]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3446Z [I] Setting UpdateState to Idle [ADUC_SetUpdateStateHelper]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3446Z [I] Reporting state: 0, Idle (0); HTTP 200; result 1, 0 [AzureDeviceUpdateCoreInterface_ReportStateAndResultAsync]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3447Z [I] UpdateAction: Idle. WorkflowId: 210319074634 [ADUC_MethodCall_Idle]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3448Z [I] Calling IdleCallback [ADUC_MethodCall_Idle]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: 2021-03-19T07:46:34.3448Z [I] Now idle. workflowId: 210319074634 [Idle]
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: -> 07:46:34 SUBSCRIBE | PACKET_ID: 4 | TOPIC_NAME: $iothub/twin/PATCH/properties/desired/# | QOS: 0
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: -> 07:46:34 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/PATCH/properties/reported/?$rid=5 | PAYLOAD_LEN: 228
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: -> 07:46:34 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/PATCH/properties/reported/?$rid=6 | PAYLOAD_LEN: 99
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: -> 07:46:34 PUBLISH | IS_DUP: false | RETAIN: 0 | QOS: DELIVER_AT_MOST_ONCE | TOPIC_NAME: $iothub/twin/PATCH/properties/reported/?$rid=7 | PAYLOAD_LEN: 250
Mar 19 07:46:35 raspberrypi3 AducIotAgent[506]: <- 07:46:34 SUBACK | PACKET_ID: 4 | RETURN_CODE: 0

Device Optimization log


root@raspberrypi3:/var/cache/deliveryoptimization-agent/log# cat do-agent.20200920_104409.log 
2020-09-20T10:44:09.6561131Z 262   262   info     {Run} Started, DU;deliveryoptimization-agent/v0.4.0+20210316.230533.713fe55 (main)

DU Agen't doesn't use action property when starting up.

Why doesn't the DU Agent use the action property when starting up ? When looking at the Logs I can clearly see, that an Update action is received from the device Twin, but no action is being taken. If I change the action property manually in the IoT Hub then the Action is being executed.

What works:
When the Agent is running on my device, and then I deploy an Update, the changed property is received, and the corresponding action is being taken,

What doesn't work:
When there is an active Deployment and the Agent is started afterwards, then no action will be taken, and the agent remains in idle mode.

Why is that a Problem ?
I have a custom Client side Updater that installs the Update. But its workflow differs form SW-Update in that, that the System needs to be restarted in between the Installation and Apply phase. The File is correctly downloaded and this is reported back to the DeviceTwin, but when restarting the Agent the correct Action is received from the Hub, but it's not being executed.

Solution ?
Shouldn't the agent regularly fetch it's twin to check if changes happened ?

Edit:
In the agent_workflow.c File, this case is described. The agent will ignore all actions until he reached Idle mode once. When checking if the Update has been Installed with the IsInstalled() function, we can determine if the set action should be executed or not. I modified the adu-version file so that the IsInstalled call succeeded and failed. Even though the IsInstalled call failed the 255 cancel action is called and not the action set in the device twin.

UpdatesClient in C# reporting no such host is known after 4 retries.

Currently I am using 1.0.0-beta.2 of Azure.IoT.DeviceUpdate.

I used app registration in Azure AD to create an application Id and secret for use with ADU. At first I went the route of creating a service client using the RESTful implementation of ADU in Azure. I then discovered that was a class model that could be used.

The call to the UpdatesClient GetProvidersAsync() succeeds but as soon as I attempt an await foreach(var provider in providers) I get the no such host is known error 4 times.

This is a blocking issue for the AED/AICS Secured Core Device Certification development process and we are supposed to have a version of ADU available in the AICS API by June 15th.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.