【发布时间】:2021-02-17 20:34:40
【问题描述】:
我试图在 Azure Edge 上实现从 c# 模块到 python 模块的模块到模块通信,
Using Ubuntu as OS
Edge Runtime: 1.0.8
EdgeAgent 1.0.10
EdgeHub 1.0.10
发送数据的c#代码
{
Console.WriteLine($"Received message: [{cloudtoDeviceMessages}]"); // cloudtoDeviceMessages is a string
await moduleClient.SendEventAsync("serialmoduleoutput", new Message(Encoding.UTF8.GetBytes(cloudtoDeviceMessages)));
Console.WriteLine("Sent The Method Body To Serial Module");
部署文件中的路由,我也有其他模块路由,但只给出相关的一个
Fromc2dcommunicationmoduleToTestModule": "FROM /messages/modules/c2dcommunicationmodule/outputs/serialmoduleoutput INTO BrokeredEndpoint(\"/modules/TestModule/inputs/input1\")",
Python 代码:与此 GitHub 示例 https://github.com/Azure/azure-iot-sdk-python/blob/master/azure-iot-device/samples/sync-samples/receive_message_on_input.py 相同
在 C# 代码中我没有收到任何异常,但在 python 模块中我也没有收到任何数据。
【问题讨论】:
-
接收模块的日志中是否有任何有用的信息?或者如果接收模块崩溃,可能会记录 edgeAgent。包含您的部署文件也可能很有用。
-
好的,我还将包括边缘代理、集线器和部署文件的日志
标签: python c# azure azure-iot-edge azure-iot-sdk