azure - 适用于 Raspberry Pi 4 的 Azure IoT Central 设备模板
解决方案
这是有意的。设备模板描述了设备的功能。例如,MXChip 将发送温度、湿度和运动事件(除其他外),这在设备模板中进行了描述。您还在屏幕截图中发布的 ReButton 将具有按钮按下等功能(支持单/双/三/长单击)。
这给我们带来了 Raspberry Pi 没有模板的原因,该设备本身没有开箱即用的功能将其连接到 IoT Central。我可能决定为其添加一个温度传感器,因此我将构建一个描述该功能的模板。但是您可能决定为其添加一个按钮和一个 LED,因此您将构建一个描述这些功能的模板。
正如您在评论中所说,如果您想要一个起点,您将从最基本且几乎是空的能力模型开始,但是您不能没有任何接口的能力模型,因此您可以添加微软提供的 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 中创建您自己的接口只需一分钟,然后您就可以添加自己的接口。
希望这能解释一下!如果您需要任何澄清,请告诉我。
推荐阅读
- python - 确定文本语言和纠正 Python 中的拼写错误的最佳算法是什么?
- c# - 我怎样才能扔掉捡到的物体?
- react-native - 如何使用 useFocusEffect 挂钩
- google-my-business-api - 无法获取任何帐户信息或评论信息
- spatial - 如何在适合逻辑回归正交方案的泊松品脱过程模型中包含调查权重?
- css - Flexbox 父级比其子级高
- php - 如何将这些自定义字段组合为 wordpress 中的链接
- python - 无法在python中打开docx
- javascript - 为 nodejs/express 创建我自己的 sql 包装器
- c++ - 如何安全地将 uint32_t 中的有符号字段提取为有符号数(int 或 uint32_t)