After creating an Azure IoT hub and the digital twin resource with the same DTDL model as that inputed in Azure IoT Explorer, the Explorer says device is not recognized as IoT P&P device.
DTDL Model validates with DTDLValidator
What am I missing, I checked this
- I add IoT Hub connection in IoT Explorer and create Device from the same model repo used to create the digital twin.
My DTDL model json file:
{
"@id": "dtmi:com:sergio:devkit;1",
"@type": "Interface",
"@context": [
"dtmi:dtdl:context;2"
],
"displayName": "Machine Part -v1",
"description": "Machine Part data",
"contents": [
{
"@type": "Property",
"name": "PartId",
"displayName": "PartId",
"description": "The unique id of the machine part",
"writable": true,
"schema": "string"
},
{
"@type": "Property",
"name": "Alert",
"displayName": "Alert",
"description": "whether or not this machine part needs maintenance",
"writable": true,
"schema": "boolean"
},
{
"@type": "Property",
"name": "ledState",
"displayName": "LED state",
"description": "Returns the current state of the onboard LED.",
"writable": true,
"schema": "boolean"
},
{
"@type": "Telemetry",
"name": "telemetryInterval",
"description": "The time interval of this data",
"schema": "integer"
},
{
"@type": "Telemetry",
"name": "Description",
"schema": "string"
},
{
"@type": "Telemetry",
"name": "Code",
"schema": "integer"
},
{
"@type": "Telemetry",
"name": "Temperature",
"displayName": "Temperature",
"schema": "double"
},
{
"@type": "Telemetry",
"name": "Humidity",
"displayName": "Humidity",
"schema": "double"
},
{
"@type": "Telemetry",
"name": "pressure",
"displayName": "Pressure",
"schema": "double"
},
{
"@type": "Telemetry",
"name": "magnetometerX",
"displayName": "Magnetometer X / mgauss",
"schema": "double"
},
{
"@type": "Telemetry",
"name": "magnetometerY",
"displayName": "Magnetometer Y / mgauss",
"schema": "double"
},
{
"@type": "Telemetry",
"name": "magnetometerZ",
"displayName": "Magnetometer Z / mgauss",
"schema": "double"
},
{
"@type": "Telemetry",
"name": "accelerometerX",
"displayName": "Accelerometer X",
"schema": "double"
},
{
"@type": "Telemetry",
"name": "accelerometerY",
"displayName": "Accelerometer Y",
"schema": "double"
},
{
"@type": "Telemetry",
"name": "accelerometerZ",
"displayName": "Accelerometer Z",
"schema": "double"
},
{
"@type": "Telemetry",
"name": "gyroscopeX",
"displayName": "Gyroscope X",
"schema": "double"
},
{
"@type": "Telemetry",
"name": "gyroscopeY",
"displayName": "Gyroscope Y",
"schema": "double"
},
{
"@type": "Telemetry",
"name": "gyroscopeZ",
"displayName": "Gyroscope Z",
"schema": "double"
}
]
}
CodePudding user response:
Your DTDL model is correct. The problem is that the device modelId property in the device twin doesn't exist and
- The following picture shows, that the device has assigned a modelId:
- Now, we can see that the device mymxchip is modelled based on the DTDL model (modelId):
- The following picture shows an example of the writable properties: