使用 Node-RED 连接到 Google Cloud Platform
本指南将引导您将 IoT Cloud 仓库添加到您的 Intel® IoT Gateway,并添加对 Google Cloud Platform 的支持。
获取新的 Intel® IoT Developer Kit,这是一种完整的硬件和软件解决方案,允许开发者使用 Intel® Galileo 和 Intel® Edison 板创建令人兴奋的新解决方案。请访问 Intel® Developer Zone for IoT。
本指南将引导您将 IoT Cloud 仓库添加到您的 Intel® IoT Gateway,并添加对 Google Cloud Platform* 的支持。
先决条件
- 运行 IDP 3.1 或更高版本的 Intel® IoT Gateway 技术,并具有互联网访问权限
- 一台与 Intel® IoT Gateway 在同一网络中的开发设备(例如笔记本电脑)
- 从您的开发设备访问 Intel® IoT Gateway 的终端权限
请参阅以下文档以了解如何 设置您的 Intel® IoT Gateway。
将 IoT Cloud 仓库添加到您的 Intel® IoT Gateway
1. 使用网关的 IP 地址在浏览器中加载 IoT Gateway Developer Hub 界面,并使用用户名 root 和密码 root 登录。
2. 检查您安装的镜像版本(例如 WR7.0.0.13)
3. 添加 IoT cloud 仓库。
4. 转到 Administration 部分并启动 Cloud Commander Web 控制台。如果需要,使用用户名 root 和密码 root 登录。
5. 向页面底部滚动,然后单击窗口右下角的 Console 按钮。
6. 在控制台中输入以下内容并按 Enter 键
rpm --import http://iotdk.intel.com/misc/iot_pub2.key
7. 向页面顶部滚动,转到 Packages 部分,然后单击 Add Repo + 按钮。
8.
使用以下信息填充字段,然后单击 Add Repository
名称:IoT_Cloud
URL:http://iotdk.intel.com/repos/iot-cloud/wrlinux7/rcplXX(其中 XX 是您在步骤 2 中检查的镜像版本的最后 2 位数字)[例如 http://iotdk.intel.com/repos/iot-cloud/wrlinux7/rcpl13/ ]
最后,单击 Update Repositories 按钮以更新软件包列表。
安装 Google Cloud Platform* IoT Gateway SDK 软件包
Developer Hub
1. 单击 Add Packages + 按钮以调出您可以安装的软件包列表。
使用顶部搜索框搜索 cloud-google。单击 packagegroup-cloud-google 软件包旁边的 Install 按钮。
软件包成功安装后,重新启动您的网关以使更改生效。
命令行
运行以下命令以安装对 Google Cloud Platform 的支持
smart update
smart install packagegroup-cloud-google
reboot
Google Cloud Platform* 与 Node-RED*
安装 Google 软件包组后,您的 Node-RED 调色板中将有一个新的输入和输出节点,名为 pubsub。
有关如何使用这些节点从 Google Cloud Platform 项目发布和接收数据,请参阅此处:https://github.com/GoogleCloudPlatform/node-red-contrib-google-cloud#google-cloud-pubsub
有关编译器优化的更完整信息,请参阅我们的 优化声明。