Azure IoT Central - Not generating a device template for Plug and Play device

Willess, Brian 451 Reputation points
2021-01-04T19:53:20.34+00:00

I've been working on adding IoT Hub Plug and Play support for our development kit, the Avnet Azure Sphere Starter Kit. I've made good progress and today my DTDL model was merged into the Microsoft Plug and Play repository.

I've verified that my application is working correctly by leveraging the Azure IoT Explorer application. Using this application and connecting my device to an IoT Hub, I verified that Azure IoT Explorer can resolve my model ID "dtmi:avnet:Starterkit;1," and pull the model into the application. In the Azure IoT Explorer I configured the tool to only look for my model in the public repo "https://devicemodels.azure.com."

Since this is working in the Azure IoT Explorer tool I assume that the following statements are true:

  1. My device model is valid
  2. The Model ID my application is sending to the IoT Hub is correct, IoT Explorer is pulling the model from the public repo

Next, I wanted to test my Plug and Play device in IoT Central. I created an IoT Central Application and configured my application to connect to my new application.

My device connects, I can see the device ID under the Devices --> All devices list

I was expecting that IoT Central would use the model ID to pull my model from the public repo and create a device template that matched my model, then automatically move the device into the new device template. However, I don't see any device templates in my application, even after my device connects, and I approved the device.

I looked at the IoT Central documentation and found this statement: "Implement your device code from the model, and connect your real device to your IoT Central application. IoT Central finds and imports the device model from the public repository for you and generates a device template. "

This feature does not appear to be working, can you help me troubleshoot the issue?

Thanks,

Brian

Azure IoT Plug and Play
Azure IoT Plug and Play
A Microsoft technology based on an open modeling language that enables developers to connect internet of things (IoT) devices to the cloud without having to write any code.
18 questions
Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
365 questions
{count} votes

Accepted answer
  1. Willess, Brian 451 Reputation points
    2021-01-05T21:48:29.12+00:00

    Roman,

    Thanks for the help. I've made good progress today . . .

    • I've cleaned up my model and it imports into IoT Central without any errors
    • I've uploaded the new model to the public repo as rev2
    • Using the Azure IoT Explorer tool I verified that I can . . .
      • See all my read only properties
      • Exercise all my write/read properties
      • Exercise my direct methods
      • See all my telemetry as "modeled events"

    Next I configured my device to connect to my IoT Central Application

    • I deleted my device
    • I deleted any device templates
    • Started my device
      • It connects to my IoT Central application
      • A device template is automatically created!
      • I drill down into my device
      • I can see the default "views"
      • I don't see any telemetry on the overview view
        • I look at the Raw data view and I can see my telemetry coming in, however it's identified as "Unmodeled data"
        • I'm sending the telemetry as simple key: value JSON
        • The telemetry is being correctly identified as modeled data in the Azure IoT Explorer tools
      • I looked at the documentation and it states . . .

    Telemetry
    Telemetry sent from a no component device doesn't require any extra metadata. The system > adds the dt-dataschema property.

    >

    Telemetry sent from a multiple component device must add $.sub as a message property. The > system adds the dt-subject and dt-dataschema properties.

    Looking at my telemetry, I can see that the dt-dataschema systemProperty is set.

    {
    "body": {
    "gX": 0,
    "gY": -0.02,
    "gZ": 1.01,
    "aX": 0,
    "aY": -0.07,
    "aZ": 0,
    "pressure": 1011.8,
    "light_intensity": 0,
    "altitude": 12.08,
    "temp": 32.82,
    "rssi": -36
    },
    "enqueuedTime": "2021-01-05T20:48:36.425Z",
    "systemProperties": {
    "iothub-connection-device-id": "cb9143742fbdc70708369758ef98654c7e8b2a6ae519030e7b6e9be0480dbb01ab084a54aef1819a1fbd991016700f025b4dcd92fb1a2a8e40666db52223cb6f",
    "iothub-connection-auth-method": "{\"scope\":\"device\",\"type\":\"x509Certificate\",\"issuer\":\"external\",\"acceptingIpFilterRule\":null}",
    "iothub-connection-auth-generation-id": "637438387425275525",
    "iothub-enqueuedtime": 1609879716206,
    "iothub-message-source": "Telemetry",
    "dt-dataschema": "dtmi:avnet:Starterkit;2",
    "x-opt-sequence-number": 248640,
    "x-opt-offset": "163208842184",
    "x-opt-enqueued-time": 1609879716425
    }
    }

    Any idea why my telemetry is not seen as "modeled" data in IoT Central?

    Thanks,

    Brian


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.