簡體   English   中英

Azure 適用於 Raspberry Pi 4 的 IoT Central 設備模板

[英]Azure IoT Central Device Template for Raspberry Pi 4

我只是在關注這個文檔,我看到樹莓派 4 沒有設備模板,但是對於像 MXChip 這樣的設備,它有嗎? 或者有什么方法可以獲取樹莓派 4 的設備模板?

在此處輸入圖像描述

這是有意的。 設備模板描述了設備的功能。 例如,MXChip 將發送溫度、濕度和運動事件(除其他外),這在設備模板中進行了描述。 您還在屏幕截圖中發布的 ReButton 將具有按鈕按下等功能(支持單/雙/三/長單擊)。

這給我們帶來了 Raspberry Pi 沒有模板的原因,該設備本身沒有開箱即用的功能將其連接到 IoT Central。 我可能決定為其添加一個溫度傳感器,因此我將構建一個描述該功能的模板。 但是您可能決定為其添加一個按鈕和一個 LED,因此您將構建一個描述這些功能的模板。

正如您在評論中所說,如果您想要一個起點,您將從最基本且幾乎為空的功能 model 開始,但是您不能沒有任何接口的功能 model,因此您可以添加 Microsoft 提供的 DeviceInformation 接口. 您需要編寫 Raspberry 將運行的代碼來實際填寫這些字段!

{
  "@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"
  ]
}

我的建議是在 IoT Central 中創建您自己的接口,雖然以上是一個不錯的起點,但在 IoT Central 中創建您自己的接口只需一分鍾,然后您就可以添加自己的接口。

希望這能解釋一下。 如果您需要任何澄清,請告訴我。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM