Home > Back-end >  Azure IoT Explorer does not recognize the device as a IoT Plug and Play device
Azure IoT Explorer does not recognize the device as a IoT Plug and Play device

Time:09-23

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 enter image description here

What am I missing, I checked this enter image description here

enter image description here

  1. I add IoT Hub connection in IoT Explorer and create Device from the same model repo used to create the digital twin.

enter image description here

enter image description here

enter image description here

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 enter image description here

  1. The following picture shows, that the device has assigned a modelId:

enter image description here

  1. Now, we can see that the device mymxchip is modelled based on the DTDL model (modelId):

enter image description here

  1. The following picture shows an example of the writable properties:

enter image description here

  1. For this demonstration has been used my enter image description here

    The last below picture shows a modelId property in the device twin on the portal:

    enter image description here

  • Related