物联网集线器模块“Modbus”看起来健康并且参数化良好,但没有收到数据

发布于 2025-01-12 20:43:12 字数 18220 浏览 2 评论 0原文

我正在将“Janitza UMG96RM-E”设备连接到 Windows 笔记本电脑,在其中我使用 Hyper-V 来使用 Linux cmd。我将笔记本电脑注册为边缘设备,并将 Modbus 添加到模块组中。我阅读了 Janitza 文档(起始地址、位的 nbre ...),并在模块双胞胎文件中添加了正确的 Ip 地址...一切看起来都很健康,除了我没有从 Modbus 模块接收到任何数据...我没有能弄清楚出了什么问题吗?这是来自edgeHub模块的一些日志。

<6> 2022-03-08 18:32:01.503 +00:00 [INF] - Add node: myEdgeDevice/DefenderIotMicroAgent
<6> 2022-03-08 18:32:01.711 +00:00 [INF] - Add node: myEdgeDevice/Modbus
<6> 2022-03-08 18:32:01.868 +00:00 [INF] - Done refreshing device scope identities cache. Waiting for 60 minutes.
<6> 2022-03-08 18:32:01.956 +00:00 [INF] - Obtained edge hub config from module twin
<6> 2022-03-08 18:32:02.377 +00:00 [INF] - Set the following 1 route(s) in edge hub
<6> 2022-03-08 18:32:02.377 +00:00 [INF] - modbusToIoTHub: FROM /messages/modules/Modbus/outputs/modbusOutput INTO $upstream
<6> 2022-03-08 18:32:02.378 +00:00 [INF] - Updated message store TTL to 7200 seconds
<6> 2022-03-08 18:32:02.379 +00:00 [INF] - Updated the edge hub store and forward configuration
<6> 2022-03-08 18:32:02.391 +00:00 [INF] - Started operation Get EdgeHub config
<6> 2022-03-08 18:32:02.395 +00:00 [INF] - Initialized edge hub configuration
<6> 2022-03-08 18:32:02.397 +00:00 [INF] - Starting protocol heads - (MQTT, AMQP, HTTP)
<6> 2022-03-08 18:32:02.410 +00:00 [INF] - Starting MQTT head
<6> 2022-03-08 18:32:02.524 +00:00 [INF] - Initializing TLS endpoint on port 8883 for MQTT head.
<6> 2022-03-08 18:32:02.845 +00:00 [INF] - Starting AMQP head
<6> 2022-03-08 18:32:02.873 +00:00 [INF] - Started MQTT head
<6> 2022-03-08 18:32:03.251 +00:00 [INF] - Started AMQP head
<6> 2022-03-08 18:32:03.255 +00:00 [INF] - Starting HTTP head
<4> 2022-03-08 18:32:04.026 +00:00 [WRN] - Overriding address(es) '"http://+:80"'. Binding to endpoints defined in "UseKestrel()" instead.
<6> 2022-03-08 18:32:04.063 +00:00 [INF] - Started HTTP head
<6> 2022-03-08 18:32:05.529 +00:00 [INF] - New token received on the Cbs link
<6> 2022-03-08 18:32:05.727 +00:00 [INF] - Client myEdgeDevice/Modbus in device scope authenticated locally.
<6> 2022-03-08 18:32:05.745 +00:00 [INF] - New device connection for device myEdgeDevice/Modbus
<6> 2022-03-08 18:32:05.746 +00:00 [INF] - Client myEdgeDevice/Modbus connected to edgeHub, processing existing subscriptions.
<6> 2022-03-08 18:32:05.750 +00:00 [INF] - Attempting to connect to IoT Hub for client myEdgeDevice/Modbus via AMQP...
<6> 2022-03-08 18:32:05.767 +00:00 [INF] - Bind device proxy for device myEdgeDevice/Modbus
<6> 2022-03-08 18:32:05.767 +00:00 [INF] - Initialized device listener in the AMQP protocol head for myEdgeDevice/Modbus
<6> 2022-03-08 18:32:05.786 +00:00 [INF] - Opened link Events for myEdgeDevice/Modbus
<6> 2022-03-08 18:32:05.827 +00:00 [INF] - Cloud connection for myEdgeDevice/Modbus is True
<6> 2022-03-08 18:32:05.827 +00:00 [INF] - Connection status for myEdgeDevice/Modbus changed to ConnectionEstablished
<6> 2022-03-08 18:32:05.827 +00:00 [INF] - Client myEdgeDevice/Modbus connected to cloud, processing existing subscriptions.
<6> 2022-03-08 18:32:05.827 +00:00 [INF] - Skipping myEdgeDevice/Modbus for subscription processing, as it is currently being processed.
<6> 2022-03-08 18:32:05.827 +00:00 [INF] - Created cloud proxy for client myEdgeDevice/Modbus via AMQP, with client operation timeout 20 seconds.
<6> 2022-03-08 18:32:05.828 +00:00 [INF] - Initialized cloud proxy 9450b673-5293-4c0b-830f-5c564f317321 for myEdgeDevice/Modbus
<6> 2022-03-08 18:32:05.828 +00:00 [INF] - Created cloud connection for client myEdgeDevice/Modbus
<6> 2022-03-08 18:32:06.116 +00:00 [INF] - Opened link TwinReceiving for myEdgeDevice/Modbus
<6> 2022-03-08 18:32:06.126 +00:00 [INF] - Processing pending subscriptions for myEdgeDevice/Modbus
<6> 2022-03-08 18:32:06.129 +00:00 [INF] - Opened link TwinSending for myEdgeDevice/Modbus
<6> 2022-03-08 18:32:06.659 +00:00 [INF] - Processing pending subscriptions for myEdgeDevice/Modbus
<6> 2022-03-08 18:32:06.661 +00:00 [INF] - Opened link ModuleMessages for myEdgeDevice/Modbus
<6> 2022-03-08 18:32:06.760 +00:00 [INF] - Updated reported properties for myEdgeDevice/$edgeHub
<6> 2022-03-08 18:32:12.133 +00:00 [INF] - Updated reported properties for myEdgeDevice/Modbus
<6> 2022-03-08 18:36:56.469 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 18:41:56.461 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 18:46:56.461 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 18:51:56.464 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 18:56:56.464 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:01:53.016 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint iothub
<6> 2022-03-08 19:01:53.083 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint iothub and 0 messages from message store.
<6> 2022-03-08 19:01:56.460 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:06:56.460 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:11:56.463 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:16:56.463 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:21:56.463 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:26:56.464 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:30:05.794 +00:00 [INF] - New token received on the Cbs link
<6> 2022-03-08 19:30:05.800 +00:00 [INF] - Token updated for myEdgeDevice/Modbus
<6> 2022-03-08 19:30:57.126 +00:00 [INF] - Request starting HTTP/1.1 GET http://172.18.0.3:9600/metrics
<6> 2022-03-08 19:30:57.203 +00:00 [INF] - Request finished in 76.276ms 200 text/plain; version=0.0.4; charset=utf-8
<6> 2022-03-08 19:31:53.089 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint iothub
<6> 2022-03-08 19:31:53.157 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint iothub and 0 messages from message store.
<6> 2022-03-08 19:31:56.459 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:32:01.877 +00:00 [INF] - Starting refresh of device scope identities cache
<6> 2022-03-08 19:32:02.390 +00:00 [INF] - Starting periodic operation Get EdgeHub config...
<6> 2022-03-08 19:32:02.781 +00:00 [INF] - Obtained edge hub config from module twin
<6> 2022-03-08 19:32:02.939 +00:00 [INF] - Set the following 1 route(s) in edge hub
<6> 2022-03-08 19:32:02.940 +00:00 [INF] - modbusToIoTHub: FROM /messages/modules/Modbus/outputs/modbusOutput INTO $upstream
<6> 2022-03-08 19:32:02.941 +00:00 [INF] - Updated message store TTL to 7200 seconds
<6> 2022-03-08 19:32:02.941 +00:00 [INF] - Updated the edge hub store and forward configuration
<6> 2022-03-08 19:32:02.941 +00:00 [INF] - Successfully completed periodic operation Get EdgeHub config
<6> 2022-03-08 19:32:03.056 +00:00 [INF] - Updated reported properties for myEdgeDevice/$edgeHub
<6> 2022-03-08 19:32:04.404 +00:00 [INF] - Not changed node: myEdgeDevice
<6> 2022-03-08 19:32:04.405 +00:00 [INF] - Not changed node: myEdgeDevice/$edgeAgent
<6> 2022-03-08 19:32:04.405 +00:00 [INF] - Not changed node: myEdgeDevice/$edgeHub
<6> 2022-03-08 19:32:04.405 +00:00 [INF] - Not changed node: myEdgeDevice/DefenderIotMicroAgent
<6> 2022-03-08 19:32:04.406 +00:00 [INF] - Not changed node: myEdgeDevice/Modbus
<6> 2022-03-08 19:32:04.406 +00:00 [INF] - Done refreshing device scope identities cache. Waiting for 60 minutes.
<6> 2022-03-08 19:36:56.459 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:41:56.461 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:46:56.462 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:51:56.460 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:56:56.460 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 20:01:53.157 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint iothub
<6> 2022-03-08 20:01:53.159 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint iothub and 0 messages from message store.
<6> 2022-03-08 20:01:56.463 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 20:06:56.461 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 20:11:56.460 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 20:16:56.463 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 20:21:56.461 +00:00 [INF] - Entering periodic task to reauthenticate connected clients 

Modbus 模块孪生:

{
    "deviceId": "myEdgeDevice",
    "moduleId": "Modbus",
    "etag": "AAAAAAAAAA4=",
    "deviceEtag": "Mzc5OTQzNzE5",
    "status": "enabled",
    "statusUpdateTime": "0001-01-01T00:00:00Z",
    "connectionState": "Connected",
    "lastActivityTime": "0001-01-01T00:00:00Z",
    "cloudToDeviceMessageCount": 0,
    "authenticationType": "sas",
    "x509Thumbprint": {
        "primaryThumbprint": null,
        "secondaryThumbprint": null
    },
    "modelId": "",
    "version": 33,
    "properties": {
        "desired": {
            "PublishInterval": 2000,
            "SlaveConfigs": {
                "Slave01": {
                    "SlaveConnection": "192.168.151.50",
                    "HwId": "HwId1",
                    "Operations": {
                        "Op01": {
                            "PollingInterval": "100",
                            "UnitId": "1",
                            "StartAddress": "19000",
                            "Count": "32",
                            "DisplayName": "Voltage",
                            "CorrelationId": "MessageType1"
                        }
                    },
                    "TcpPort": "502",
                    "RetryCount": "10",
                    "RetryInterval": "100"
                }
            },
            "routes": {
                "modbusToIoTHub": "FROM /messages/modules/Modbus/outputs/modbusOutput INTO $upstream"
            },
            "$metadata": {
                "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                "$lastUpdatedVersion": 14,
                "PublishInterval": {
                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                    "$lastUpdatedVersion": 14
                },
                "SlaveConfigs": {
                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                    "$lastUpdatedVersion": 14,
                    "Slave01": {
                        "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                        "$lastUpdatedVersion": 14,
                        "SlaveConnection": {
                            "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                            "$lastUpdatedVersion": 14
                        },
                        "HwId": {
                            "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                            "$lastUpdatedVersion": 14
                        },
                        "Operations": {
                            "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                            "$lastUpdatedVersion": 14,
                            "Op01": {
                                "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                                "$lastUpdatedVersion": 14,
                                "PollingInterval": {
                                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                                    "$lastUpdatedVersion": 14
                                },
                                "UnitId": {
                                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                                    "$lastUpdatedVersion": 14
                                },
                                "StartAddress": {
                                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                                    "$lastUpdatedVersion": 14
                                },
                                "Count": {
                                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                                    "$lastUpdatedVersion": 14
                                },
                                "DisplayName": {
                                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                                    "$lastUpdatedVersion": 14
                                },
                                "CorrelationId": {
                                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                                    "$lastUpdatedVersion": 14
                                }
                            }
                        },
                        "TcpPort": {
                            "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                            "$lastUpdatedVersion": 14
                        },
                        "RetryCount": {
                            "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                            "$lastUpdatedVersion": 14
                        },
                        "RetryInterval": {
                            "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                            "$lastUpdatedVersion": 14
                        }
                    }
                },
                "routes": {
                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                    "$lastUpdatedVersion": 14,
                    "modbusToIoTHub": {
                        "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                        "$lastUpdatedVersion": 14
                    }
                }
            },
            "$version": 14
        },
        "reported": {
            "PublishInterval": 2000,
            "SlaveConfigs": {
                "Slave01": {
                    "Operations": {
                        "Op01": {
                            "PollingInterval": 100,
                            "UnitId": 1,
                            "StartAddress": "19000",
                            "Count": 32,
                            "DisplayName": "Voltage",
                            "CorrelationId": "MessageType1"
                        }
                    },
                    "SlaveConnection": "192.168.151.50",
                    "RetryCount": 10,
                    "RetryInterval": 100,
                    "TcpPort": 502,
                    "HwId": "HwId1"
                }
            },
            "$metadata": {
                "$lastUpdated": "2022-03-08T18:32:11.9932421Z",
                "PublishInterval": {
                    "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                },
                "SlaveConfigs": {
                    "$lastUpdated": "2022-03-08T18:32:11.9932421Z",
                    "Slave01": {
                        "$lastUpdated": "2022-03-08T18:32:11.9932421Z",
                        "Operations": {
                            "$lastUpdated": "2022-03-08T18:32:11.9932421Z",
                            "Op01": {
                                "$lastUpdated": "2022-03-08T18:32:11.9932421Z",
                                "PollingInterval": {
                                    "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                                },
                                "UnitId": {
                                    "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                                },
                                "StartAddress": {
                                    "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                                },
                                "Count": {
                                    "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                                },
                                "DisplayName": {
                                    "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                                },
                                "CorrelationId": {
                                    "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                                }
                            }
                        },
                        "SlaveConnection": {
                            "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                        },
                        "RetryCount": {
                            "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                        },
                        "RetryInterval": {
                            "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                        },
                        "TcpPort": {
                            "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                        },
                        "HwId": {
                            "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                        }
                    }
                }
            },
            "$version": 19
        }
    }
} 

以下是我使用 Janitza 文档中的信息来配置模块孪生: Modbus 地址列表

I am connecting a "Janitza UMG96RM-E" device to a Windows Laptop where I am using Hyper-V to use Linux cmds. I registered the Laptop as an Edge device and added Modbus to the set of modules. I read the Janitza documentation (start Address, nbre of bits ...) and I Added the correct Ip Address the Module Twins file... Everything looks heathy except I am not receiving any data from the Modbus module... I am not able to figure out what is wrong ? Here is some logs from edgeHub module.

<6> 2022-03-08 18:32:01.503 +00:00 [INF] - Add node: myEdgeDevice/DefenderIotMicroAgent
<6> 2022-03-08 18:32:01.711 +00:00 [INF] - Add node: myEdgeDevice/Modbus
<6> 2022-03-08 18:32:01.868 +00:00 [INF] - Done refreshing device scope identities cache. Waiting for 60 minutes.
<6> 2022-03-08 18:32:01.956 +00:00 [INF] - Obtained edge hub config from module twin
<6> 2022-03-08 18:32:02.377 +00:00 [INF] - Set the following 1 route(s) in edge hub
<6> 2022-03-08 18:32:02.377 +00:00 [INF] - modbusToIoTHub: FROM /messages/modules/Modbus/outputs/modbusOutput INTO $upstream
<6> 2022-03-08 18:32:02.378 +00:00 [INF] - Updated message store TTL to 7200 seconds
<6> 2022-03-08 18:32:02.379 +00:00 [INF] - Updated the edge hub store and forward configuration
<6> 2022-03-08 18:32:02.391 +00:00 [INF] - Started operation Get EdgeHub config
<6> 2022-03-08 18:32:02.395 +00:00 [INF] - Initialized edge hub configuration
<6> 2022-03-08 18:32:02.397 +00:00 [INF] - Starting protocol heads - (MQTT, AMQP, HTTP)
<6> 2022-03-08 18:32:02.410 +00:00 [INF] - Starting MQTT head
<6> 2022-03-08 18:32:02.524 +00:00 [INF] - Initializing TLS endpoint on port 8883 for MQTT head.
<6> 2022-03-08 18:32:02.845 +00:00 [INF] - Starting AMQP head
<6> 2022-03-08 18:32:02.873 +00:00 [INF] - Started MQTT head
<6> 2022-03-08 18:32:03.251 +00:00 [INF] - Started AMQP head
<6> 2022-03-08 18:32:03.255 +00:00 [INF] - Starting HTTP head
<4> 2022-03-08 18:32:04.026 +00:00 [WRN] - Overriding address(es) '"http://+:80"'. Binding to endpoints defined in "UseKestrel()" instead.
<6> 2022-03-08 18:32:04.063 +00:00 [INF] - Started HTTP head
<6> 2022-03-08 18:32:05.529 +00:00 [INF] - New token received on the Cbs link
<6> 2022-03-08 18:32:05.727 +00:00 [INF] - Client myEdgeDevice/Modbus in device scope authenticated locally.
<6> 2022-03-08 18:32:05.745 +00:00 [INF] - New device connection for device myEdgeDevice/Modbus
<6> 2022-03-08 18:32:05.746 +00:00 [INF] - Client myEdgeDevice/Modbus connected to edgeHub, processing existing subscriptions.
<6> 2022-03-08 18:32:05.750 +00:00 [INF] - Attempting to connect to IoT Hub for client myEdgeDevice/Modbus via AMQP...
<6> 2022-03-08 18:32:05.767 +00:00 [INF] - Bind device proxy for device myEdgeDevice/Modbus
<6> 2022-03-08 18:32:05.767 +00:00 [INF] - Initialized device listener in the AMQP protocol head for myEdgeDevice/Modbus
<6> 2022-03-08 18:32:05.786 +00:00 [INF] - Opened link Events for myEdgeDevice/Modbus
<6> 2022-03-08 18:32:05.827 +00:00 [INF] - Cloud connection for myEdgeDevice/Modbus is True
<6> 2022-03-08 18:32:05.827 +00:00 [INF] - Connection status for myEdgeDevice/Modbus changed to ConnectionEstablished
<6> 2022-03-08 18:32:05.827 +00:00 [INF] - Client myEdgeDevice/Modbus connected to cloud, processing existing subscriptions.
<6> 2022-03-08 18:32:05.827 +00:00 [INF] - Skipping myEdgeDevice/Modbus for subscription processing, as it is currently being processed.
<6> 2022-03-08 18:32:05.827 +00:00 [INF] - Created cloud proxy for client myEdgeDevice/Modbus via AMQP, with client operation timeout 20 seconds.
<6> 2022-03-08 18:32:05.828 +00:00 [INF] - Initialized cloud proxy 9450b673-5293-4c0b-830f-5c564f317321 for myEdgeDevice/Modbus
<6> 2022-03-08 18:32:05.828 +00:00 [INF] - Created cloud connection for client myEdgeDevice/Modbus
<6> 2022-03-08 18:32:06.116 +00:00 [INF] - Opened link TwinReceiving for myEdgeDevice/Modbus
<6> 2022-03-08 18:32:06.126 +00:00 [INF] - Processing pending subscriptions for myEdgeDevice/Modbus
<6> 2022-03-08 18:32:06.129 +00:00 [INF] - Opened link TwinSending for myEdgeDevice/Modbus
<6> 2022-03-08 18:32:06.659 +00:00 [INF] - Processing pending subscriptions for myEdgeDevice/Modbus
<6> 2022-03-08 18:32:06.661 +00:00 [INF] - Opened link ModuleMessages for myEdgeDevice/Modbus
<6> 2022-03-08 18:32:06.760 +00:00 [INF] - Updated reported properties for myEdgeDevice/$edgeHub
<6> 2022-03-08 18:32:12.133 +00:00 [INF] - Updated reported properties for myEdgeDevice/Modbus
<6> 2022-03-08 18:36:56.469 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 18:41:56.461 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 18:46:56.461 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 18:51:56.464 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 18:56:56.464 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:01:53.016 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint iothub
<6> 2022-03-08 19:01:53.083 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint iothub and 0 messages from message store.
<6> 2022-03-08 19:01:56.460 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:06:56.460 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:11:56.463 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:16:56.463 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:21:56.463 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:26:56.464 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:30:05.794 +00:00 [INF] - New token received on the Cbs link
<6> 2022-03-08 19:30:05.800 +00:00 [INF] - Token updated for myEdgeDevice/Modbus
<6> 2022-03-08 19:30:57.126 +00:00 [INF] - Request starting HTTP/1.1 GET http://172.18.0.3:9600/metrics
<6> 2022-03-08 19:30:57.203 +00:00 [INF] - Request finished in 76.276ms 200 text/plain; version=0.0.4; charset=utf-8
<6> 2022-03-08 19:31:53.089 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint iothub
<6> 2022-03-08 19:31:53.157 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint iothub and 0 messages from message store.
<6> 2022-03-08 19:31:56.459 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:32:01.877 +00:00 [INF] - Starting refresh of device scope identities cache
<6> 2022-03-08 19:32:02.390 +00:00 [INF] - Starting periodic operation Get EdgeHub config...
<6> 2022-03-08 19:32:02.781 +00:00 [INF] - Obtained edge hub config from module twin
<6> 2022-03-08 19:32:02.939 +00:00 [INF] - Set the following 1 route(s) in edge hub
<6> 2022-03-08 19:32:02.940 +00:00 [INF] - modbusToIoTHub: FROM /messages/modules/Modbus/outputs/modbusOutput INTO $upstream
<6> 2022-03-08 19:32:02.941 +00:00 [INF] - Updated message store TTL to 7200 seconds
<6> 2022-03-08 19:32:02.941 +00:00 [INF] - Updated the edge hub store and forward configuration
<6> 2022-03-08 19:32:02.941 +00:00 [INF] - Successfully completed periodic operation Get EdgeHub config
<6> 2022-03-08 19:32:03.056 +00:00 [INF] - Updated reported properties for myEdgeDevice/$edgeHub
<6> 2022-03-08 19:32:04.404 +00:00 [INF] - Not changed node: myEdgeDevice
<6> 2022-03-08 19:32:04.405 +00:00 [INF] - Not changed node: myEdgeDevice/$edgeAgent
<6> 2022-03-08 19:32:04.405 +00:00 [INF] - Not changed node: myEdgeDevice/$edgeHub
<6> 2022-03-08 19:32:04.405 +00:00 [INF] - Not changed node: myEdgeDevice/DefenderIotMicroAgent
<6> 2022-03-08 19:32:04.406 +00:00 [INF] - Not changed node: myEdgeDevice/Modbus
<6> 2022-03-08 19:32:04.406 +00:00 [INF] - Done refreshing device scope identities cache. Waiting for 60 minutes.
<6> 2022-03-08 19:36:56.459 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:41:56.461 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:46:56.462 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:51:56.460 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 19:56:56.460 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 20:01:53.157 +00:00 [INF] - Started task to cleanup processed and stale messages for endpoint iothub
<6> 2022-03-08 20:01:53.159 +00:00 [INF] - Cleaned up 0 messages from queue for endpoint iothub and 0 messages from message store.
<6> 2022-03-08 20:01:56.463 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 20:06:56.461 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 20:11:56.460 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 20:16:56.463 +00:00 [INF] - Entering periodic task to reauthenticate connected clients
<6> 2022-03-08 20:21:56.461 +00:00 [INF] - Entering periodic task to reauthenticate connected clients 

Modbus Module Twin:

{
    "deviceId": "myEdgeDevice",
    "moduleId": "Modbus",
    "etag": "AAAAAAAAAA4=",
    "deviceEtag": "Mzc5OTQzNzE5",
    "status": "enabled",
    "statusUpdateTime": "0001-01-01T00:00:00Z",
    "connectionState": "Connected",
    "lastActivityTime": "0001-01-01T00:00:00Z",
    "cloudToDeviceMessageCount": 0,
    "authenticationType": "sas",
    "x509Thumbprint": {
        "primaryThumbprint": null,
        "secondaryThumbprint": null
    },
    "modelId": "",
    "version": 33,
    "properties": {
        "desired": {
            "PublishInterval": 2000,
            "SlaveConfigs": {
                "Slave01": {
                    "SlaveConnection": "192.168.151.50",
                    "HwId": "HwId1",
                    "Operations": {
                        "Op01": {
                            "PollingInterval": "100",
                            "UnitId": "1",
                            "StartAddress": "19000",
                            "Count": "32",
                            "DisplayName": "Voltage",
                            "CorrelationId": "MessageType1"
                        }
                    },
                    "TcpPort": "502",
                    "RetryCount": "10",
                    "RetryInterval": "100"
                }
            },
            "routes": {
                "modbusToIoTHub": "FROM /messages/modules/Modbus/outputs/modbusOutput INTO $upstream"
            },
            "$metadata": {
                "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                "$lastUpdatedVersion": 14,
                "PublishInterval": {
                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                    "$lastUpdatedVersion": 14
                },
                "SlaveConfigs": {
                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                    "$lastUpdatedVersion": 14,
                    "Slave01": {
                        "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                        "$lastUpdatedVersion": 14,
                        "SlaveConnection": {
                            "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                            "$lastUpdatedVersion": 14
                        },
                        "HwId": {
                            "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                            "$lastUpdatedVersion": 14
                        },
                        "Operations": {
                            "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                            "$lastUpdatedVersion": 14,
                            "Op01": {
                                "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                                "$lastUpdatedVersion": 14,
                                "PollingInterval": {
                                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                                    "$lastUpdatedVersion": 14
                                },
                                "UnitId": {
                                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                                    "$lastUpdatedVersion": 14
                                },
                                "StartAddress": {
                                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                                    "$lastUpdatedVersion": 14
                                },
                                "Count": {
                                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                                    "$lastUpdatedVersion": 14
                                },
                                "DisplayName": {
                                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                                    "$lastUpdatedVersion": 14
                                },
                                "CorrelationId": {
                                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                                    "$lastUpdatedVersion": 14
                                }
                            }
                        },
                        "TcpPort": {
                            "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                            "$lastUpdatedVersion": 14
                        },
                        "RetryCount": {
                            "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                            "$lastUpdatedVersion": 14
                        },
                        "RetryInterval": {
                            "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                            "$lastUpdatedVersion": 14
                        }
                    }
                },
                "routes": {
                    "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                    "$lastUpdatedVersion": 14,
                    "modbusToIoTHub": {
                        "$lastUpdated": "2022-03-08T18:30:17.436628Z",
                        "$lastUpdatedVersion": 14
                    }
                }
            },
            "$version": 14
        },
        "reported": {
            "PublishInterval": 2000,
            "SlaveConfigs": {
                "Slave01": {
                    "Operations": {
                        "Op01": {
                            "PollingInterval": 100,
                            "UnitId": 1,
                            "StartAddress": "19000",
                            "Count": 32,
                            "DisplayName": "Voltage",
                            "CorrelationId": "MessageType1"
                        }
                    },
                    "SlaveConnection": "192.168.151.50",
                    "RetryCount": 10,
                    "RetryInterval": 100,
                    "TcpPort": 502,
                    "HwId": "HwId1"
                }
            },
            "$metadata": {
                "$lastUpdated": "2022-03-08T18:32:11.9932421Z",
                "PublishInterval": {
                    "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                },
                "SlaveConfigs": {
                    "$lastUpdated": "2022-03-08T18:32:11.9932421Z",
                    "Slave01": {
                        "$lastUpdated": "2022-03-08T18:32:11.9932421Z",
                        "Operations": {
                            "$lastUpdated": "2022-03-08T18:32:11.9932421Z",
                            "Op01": {
                                "$lastUpdated": "2022-03-08T18:32:11.9932421Z",
                                "PollingInterval": {
                                    "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                                },
                                "UnitId": {
                                    "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                                },
                                "StartAddress": {
                                    "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                                },
                                "Count": {
                                    "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                                },
                                "DisplayName": {
                                    "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                                },
                                "CorrelationId": {
                                    "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                                }
                            }
                        },
                        "SlaveConnection": {
                            "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                        },
                        "RetryCount": {
                            "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                        },
                        "RetryInterval": {
                            "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                        },
                        "TcpPort": {
                            "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                        },
                        "HwId": {
                            "$lastUpdated": "2022-03-08T18:32:11.9932421Z"
                        }
                    }
                }
            },
            "$version": 19
        }
    }
} 

Here are the info that I used from the Janitza docs to configure the Module Twin:
Modbus address list

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

青芜 2025-01-19 20:43:12

我发现问题出在我正在读取的寄存器起始地址上。
就我而言,我在开头添加了 4(持有寄存器),在末尾添加了 +1。
示例:如果在从设备的文档中,我可以从地址 19000 读取电源:在 Modbus 模块孪生中,我将地址指定为 419001!
我希望这可以帮助将来的人们。

I have found that the problem was the register start-address that I am reading from.
In my case I had the add a 4 in the beginning (Holding Register) and +1 in the end.
example: if in the documentation of the slave device I can read the Power from the address 19000 : in the Modbus Module twin I specify the address to be 419001 !
I hope this can help people in the future.

昔日梦未散 2025-01-19 20:43:12

你检查过模块的日志吗?使用 iotedge list 检查模块的名称。

sudo iotedge list
sudo iotedge logs Modbus

您需要指定 路线 从 modbus 模块发送到 edgeHub 的 $upstream 通道,将数据路由到与部署清单中的模块名称匹配的 Azure IoT 中心。它看起来是正确的,但 doublechek 不会造成伤害。

要查看通过 IoT 中心的数据,可以使用 Azure IoT 资源管理器

Have you checked the logs of the module? Check the name of the module with iotedge list.

sudo iotedge list
sudo iotedge logs Modbus

You need to specify a route from the modbus module to the $upstream channel of edgeHub to have the data routed to Azure IoT Hub that matches the name of the module from the deployment manifest. It looks correct, but doublechek won't hurt.

To see the data going through the IoT Hub, you can use the Azure IoT explorer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文