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 tutorial as an example and can't see what's wrong?
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"
}
]
}
Your DTDL model is correct. The problem is that the device modelId property in the device twin doesn't exist and must be populated during the device connection to the IoT Hub.
The following screen snippets shows that your DTDL is working in the Azure IoT Explorer:
The last below picture shows a modelId property in the device twin on the portal: