简体   繁体   中英

Azure IoT Central Device Template for Raspberry Pi 4

I was just following this document , and I see that there is no device template for Raspberry Pi 4 but for devices like MXChip it has, is it intended? Or is there any way to get the device template for Raspberry Pi 4?

在此处输入图像描述

This is intended. A device template describes the capabilities of a device. For instance, the MXChip will send temperature, humidity, and motion events (among other things) and this is described in the device template. The ReButton you also posted in your screenshot will have capabilities like button press (with support for single/double/triple/long click).

This brings us to the reason there is no template for the Raspberry Pi, this device on its own has no out of the box capabilities to connect it to IoT Central. I might decide to add a temperature sensor to it, so I will build a template describing that capability. But you might decide to add a button and an LED to it, so you will build a template describing those capabilities.

As you stated in your comment, if you want a starting point, you will begin with the most basic and nearly empty capability model, but you can't have a capability model without any interfaces, so you can add the DeviceInformation interface that Microsoft provides. You will need to write the code that your Raspberry will run to actually fill out these fields!

{
  "@id": "urn:matthijsvdveer:RaspberryPi4_41:1",
  "@type": "CapabilityModel",
  "implements": [
    {
      "@id": "urn:matthijsvdveer:RaspberryPi4_41:2x_rlqmb2:1",
      "@type": "InterfaceInstance",
      "name": "DeviceInformation_z1",
      "schema": {
        "@id": "urn:azureiot:DeviceManagement:DeviceInformation:1",
        "@type": "Interface",
        "displayName": {
          "en": "Device information"
        },
        "contents": [
          {
            "@id": "urn:azureiot:DeviceManagement:DeviceInformation:manufacturer:1",
            "@type": "Property",
            "comment": "Company name of the device manufacturer. This could be the same as the name of the original equipment manufacturer (OEM). Ex. Contoso.",
            "displayName": {
              "en": "Manufacturer"
            },
            "name": "manufacturer",
            "schema": "string"
          },
          {
            "@id": "urn:azureiot:DeviceManagement:DeviceInformation:model:1",
            "@type": "Property",
            "comment": "Device model name or ID. Ex. Surface Book 2.",
            "displayName": {
              "en": "Device model"
            },
            "name": "model",
            "schema": "string"
          },
          {
            "@id": "urn:azureiot:DeviceManagement:DeviceInformation:swVersion:1",
            "@type": "Property",
            "comment": "Version of the software on your device. This could be the version of your firmware. Ex. 1.3.45",
            "displayName": {
              "en": "Software version"
            },
            "name": "swVersion",
            "schema": "string"
          },
          {
            "@id": "urn:azureiot:DeviceManagement:DeviceInformation:osName:1",
            "@type": "Property",
            "comment": "Name of the operating system on the device. Ex. Windows 10 IoT Core.",
            "displayName": {
              "en": "Operating system name"
            },
            "name": "osName",
            "schema": "string"
          },
          {
            "@id": "urn:azureiot:DeviceManagement:DeviceInformation:processorArchitecture:1",
            "@type": "Property",
            "comment": "Architecture of the processor on the device. Ex. x64 or ARM.",
            "displayName": {
              "en": "Processor architecture"
            },
            "name": "processorArchitecture",
            "schema": "string"
          },
          {
            "@id": "urn:azureiot:DeviceManagement:DeviceInformation:processorManufacturer:1",
            "@type": "Property",
            "comment": "Name of the manufacturer of the processor on the device. Ex. Intel.",
            "displayName": {
              "en": "Processor manufacturer"
            },
            "name": "processorManufacturer",
            "schema": "string"
          },
          {
            "@id": "urn:azureiot:DeviceManagement:DeviceInformation:totalStorage:1",
            "@type": "Property",
            "comment": "Total available storage on the device in kilobytes. Ex. 2048000 kilobytes.",
            "displayName": {
              "en": "Total storage"
            },
            "name": "totalStorage",
            "displayUnit": {
              "en": "kilobytes"
            },
            "schema": "long"
          },
          {
            "@id": "urn:azureiot:DeviceManagement:DeviceInformation:totalMemory:1",
            "@type": "Property",
            "comment": "Total available memory on the device in kilobytes. Ex. 256000 kilobytes.",
            "displayName": {
              "en": "Total memory"
            },
            "name": "totalMemory",
            "displayUnit": {
              "en": "kilobytes"
            },
            "schema": "long"
          }
        ]
      }
    }
  ],
  "displayName": {
    "en": "Raspberry Pi 4"
  },
  "@context": [
    "http://azureiot.com/v1/contexts/IoTModel.json"
  ]
}

My advice would be to create your own in IoT Central , while the above is a decent starting-off point, it takes only a minute to create your own in IoT Central and then you can add your own interfaces.

Hope this explains it a bit. Let me know if you need anything clarified.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM