After provisioning a device successfully on Azure IoT Hub, I'm trying to get Azure Device Update to work. In the IoT hub on the portal, I select Updates, and then I see that the Diagnostics tab is flagged with a warning. See the image below:
As you can see the device has been flagged as unhealthy, and the interfaceId is reported as at fault. I have read the docs, and cannot figure out why it is reported as incorrect.
The device modelId is set to:
dtmi:azure:iot:deviceUpdateContractModel;2
The "deviceUpdate" appears as follows in the device twin:
"__t": "c",
"agent": {
"compatPropertyNames": "manufacturer,model",
"deviceProperties": {
"aduVer": "DU;agent/1.0.0",
"interfaceId": "dtmi:azure:iot:deviceUpdate;1",
"manufacturer": "LoadAssist",
"model": "LoadAssist-ESP32S3-F16-R2"
},
"installedUpdateId": "{\"provider\":\"LoadAssist\",\"name\":\"LoadAssist-ESP32S3-F16-R2\",\"version\":\"1.0\"}",
"state": 0
}
},
As you can see the device InterfaceId is correctly se to:
dtmi:azure:iot:deviceUpdate;1
So, I cannot understand why this device is reported as having a faulty interfaceId
Here is an excerpt from Microsoft docs, and I have added my settings onto the excerpt, and they are correctly reported by the device twin:
Any advice will help, I'm stumped.
The solution was actually simple.
The "deviceUpdate" should appear as follows in the device twin:
"deviceUpdate": {
"__t": "c",
"agent": {
"compatPropertyNames": "manufacturer,model",
"deviceProperties": {
"aduVer": "DU;agent/1.0.0",
"contractModelId": "dtmi:azure:iot:deviceUpdateContractModel;2",
"manufacturer": "LoadAssist",
"model": "LoadAssist-ESP32S3-F16-R2"
},
It would have been great if the docs at learn.microsoft.com actually reflected the latest GA releases format, as I could have found this earlier then.
I checked the azure-iot-middleware-freertos for changes, but only after many days decided to drill down on the libs contained in the middleware library, and noticed that changes for compatibility with Version 5, were pushed as long ago as 2022-Dec, and I was on an earlier version of the azure-sdk-for-c
Once I updated to the latest release of that library, all the errors disappeared.