简体   繁体   English

Azure 虚拟下游设备的物联网边缘模块身份转换

[英]Azure IoT Edge Module Identity Translation for virtual Downstream Devices

I have the following setup:我有以下设置:

  • Multiple modbus sensors多个 modbus 传感器
  • 1 Gateway connected to these sensors via ModbusTCP. 1 网关通过 ModbusTCP 连接到这些传感器。 On this gateway, one Azure IoT Edge module is running (using the NodeJS SDK), that reads all values of each connected sensor在这个网关上,一个 Azure IoT Edge 模块正在运行(使用 NodeJS SDK),它读取每个连接传感器的所有值
  • Azure IoT Central for device management Azure IoT Central 用于设备管理

In IoT Central, I would like to represent each modbus sensor with a separate device template.在 IoT Central 中,我想用一个单独的设备模板来表示每个 modbus 传感器。 This way, I can configure dashboards that are unique for each sensor.这样,我可以为每个传感器配置唯一的仪表板。 These sensor device templates should then be configured to be child devices of the device template for the gateway.然后应将这些传感器设备模板配置为网关设备模板的子设备。 So one device template for the gateway and one unique device template for each modbus sensor.因此,网关需要一个设备模板,每个 modbus 传感器需要一个唯一的设备模板。 This way, I can provision multiple gateways with a different sensor setup without the need of creating a new device template for each of these gateways (I would only need to configure a different amount of child devices for each gateway).这样,我可以为多个网关配置不同的传感器设置,而无需为每个网关创建新的设备模板(我只需要为每个网关配置不同数量的子设备)。

The Azure IoT Edge modbus module running on the gateway should then read all values from each connected sensor and send them to the IoT Central instance in the name of the sensor, so it looks like that the sensor had sent this message.然后,网关上运行的 Azure IoT Edge modbus 模块应从每个连接的传感器读取所有值,并将它们以传感器的名称发送到 IoT Central 实例,因此看起来传感器已发送此消息。 However, I am not sure on how to implement this behaviour inside my Azure IoT Edge module.但是,我不确定如何在我的 Azure IoT Edge 模块中实现此行为。

The documentation states that this behaviour can be implemented ( IoT Edge gateway device connected to downstream devices with identity provided by the IoT Edge gateway ), however I could not find any documentation on HOW to implement this.该文档指出可以实现此行为( IoT Edge 网关设备连接到具有 IoT Edge 网关提供的身份的下游设备),但是我找不到任何有关如何实现此操作的文档。 I hope someone can help.我希望有人能帮帮忙。

The short answer is: there is no native support in the Azure IoT stack that supports that scenario.简短的回答是:在支持该场景的 Azure 物联网堆栈中没有本机支持。 The documentation you have linked to has been under discussion for a while now and a feature request has been created.您链接到的文档已经讨论了一段时间,并且已经创建了一个功能请求 That doesn't mean it's impossible though, but it involves some workarounds that might not be acceptable to your use case.这并不意味着它是不可能的,但它涉及一些您的用例可能无法接受的变通方法。

One way to provide identity to your sensor is to create a device for each sensor in IoT Central and to pass their connection information to the module twin of a module you need to build.向传感器提供身份的一种方法是为 IoT Central 中的每个传感器创建一个设备,并将它们的连接信息传递给您需要构建的模块的模块孪生。 That module would receive the sensor values, figure out what connection information to use and send telemetry straight to IoT Central (so not through the Edge Runtime).该模块将接收传感器值,确定要使用的连接信息并将遥测数据直接发送到 IoT Central(因此不通过边缘运行时)。

Update: Microsoft created a sample module that shows how to provide a basic implementation of identity translation.更新:微软创建了一个示例模块,展示了如何提供身份转换的基本实现。 Other than that, no native support in the runtime yet.除此之外,运行时还没有原生支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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