我正在做一个机器人技术和云计算相结合的项目。 简单地说,我现在使用的是一个带有Ubuntu和ROS Kinectic的raspberry py,通过一些伺服电机和传感器来控制一个arduino。为了监视传感器数据,我想使用pythonsdk for Azure IoT Hub将我的Raspberry连接到microsoftazure云。你知道吗
这可以通过创建订阅“传感器”主题并将接收到的数据发送到Azure IoT Hub的节点来实现。你知道吗
我在Github上找到了一个Azure IoT HuB节点,但无法找到如何使用它或找到它的文档:https://github.com/microsoft/ros_azure_iothub
我想知道是否有人对此节点有一些建议/经验?有文件吗?你知道吗
谢谢你的帮助!你知道吗
下面是使用python将raspberry pi连接到Azure IOT hub所需的步骤
1)设置PI
对于安装程序,可以使用这个link在pi上启用SSH。你知道吗
在Pi上启用I2C 使用下面的链接启用I2C。 https://www.raspberrypi.org/documentation/configuration/raspi-config.md
2)将传感器与PI连接
3)下载和设置参考模块
将客户端应用程序克隆到本地:
git克隆https://github.com/Azure-Samples/iot-hub-python-raspberrypi-client-app.git
因为Azure IoT sdk for Python是[sdk for C][Azure-IoT-sdk-C]之上的包装器,所以如果您想要或需要从源代码生成Python库,您将需要编译C库。你知道吗
在上面的脚本中,我们运行/设置.sh不带参数,因此shell将自动检测并使用已安装的python版本(搜索序列2.7->;3.4->;3.5)。或者,可以使用一个参数来指定要使用的python版本,如下所示:sudo/设置.sh[python版本|-p][2.7 | 3.4 | 3.5]
您可以参考示例代码here。你知道吗
希望有帮助。你知道吗
相关问题 更多 >
编程相关推荐