message = client.receive_message()
这段代码现在已被弃用,在搜索解决方案时,似乎只有我一个人有这个问题。 我得到这个警告:
DeprecatedWarning: receive_message is deprecated as of 2.3.0. We recommend that you use the .on_message_received property to set a handler instead of message = client.receive_message()
如果你有一个可能的解决方案,请张贴在这里。 我正在运行最新的python 3.9和最新的Azure IoT设备库
您正在尝试使用不再受支持的方法(因为它已被弃用)。正如错误消息所说,处理C2D消息的正确方法是使用事件处理程序。有一个很好的例子here
您将感兴趣的部分是:
相关问题 更多 >
编程相关推荐