AWS IoT Greengrass 入門指南
目錄
1. 文件訊息
| 文件版本 | 1.0 |
| 日期 | |
| 描述 | 已發布文件 |
4. 搭建開發環境
AWS IoT Greengrass 同時支援 Windows 和 Linux:https://docs.aws.amazon.com/greengrass/v2/developerguide/operating-system-feature-support-matrix.html。
請參閱開發者指南,以了解所需的工具和正確設定:https://docs.aws.amazon.com/greengrass/v2/developerguide/what-is-iot-greengrass.html
建議安裝以下工具/SDK:
- Java 執行時期環境 (JRE) 版本 8 或更高版本
- Java Development Kit (JDK) Amazon Corretto 11 (https://aws.amazon.com/corretto/) or OpenJDK 11 (https://openjdk.java.net/)
- GNU C 函式庫 (https://www.gnu.org/software/libc/);(glibc) 版本 2.25 或更高版本
5. 設定硬體
請參考設備的使用手冊進行硬體設定。
6. 設定您的 AWS 帳戶和權限
請參閱 AWS 線上文件「設定您的 AWS 帳號」:https://docs.aws.amazon.com/iot/latest/developerguide/setting-up.html
請依照以下步驟建立您的帳戶和用戶,即可開始使用:
• 註冊 AWS 帳戶:
https://docs.aws.amazon.com/iot/latest/developerguide/setting-up.html#aws-registration• 建立使用者並授予其適當的權限:
https://docs.aws.amazon.com/iot/latest/developerguide/setting-up.html#create-iam-user• 開啟 AWS IoT 主控台:
https://docs.aws.amazon.com/iot/latest/developerguide/setting-up.html#iot-console-signin7. 在 AWS IoT 中建立資源
請參閱以下說明,以了解如何建立 AWS IoT 資源:https://docs.aws.amazon.com/iot/latest/developerguide/create-iot-resources.html
請依照以下各節中概述的步驟為您的設備配置資源:
- 建立 AWS IoT 策略
- 創建一個對象
8. 安裝 AWS 命令列介面
若要在您的主機上安裝 AWS CLI,請參考以下說明:https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
要完成本指南中的說明,需要安裝 CLI。安裝 AWS CLI 後,請依照以下說明進行設定:https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html#cli-configure-quickstart-config
根據您的 AWS 帳戶,設定存取金鑰 ID、秘密存取金鑰和 AWS 區域的對應值。您也可以根據需要將輸出格式設定為“json”。
9. 安裝 AWS IoT Greengrass
請依照線上指南使用自動設定安裝進行操作。請參考以下步驟中的說明:
向裝置提供 AWS 憑證。 對於開發環境,您可以使用「使用 IAM 使用者的長期憑證」選項。以下範例展示如何操作:
- export AWS_ACCESS_KEY_ID=<您的使用者的存取金鑰 ID>
- export AWS_SECRET_ACCESS_KEY=<您的使用者的秘密存取金鑰>
10. 建立一個 Hello World 元件
在 AWS IoT Greengrass v2 中,可以在邊緣裝置上建立元件並上傳到雲端,反之亦然。
若要在您的裝置上建立、部署、測試、更新和管理簡單元件,請按照「建立 Hello World 元件」部分下的說明進行操作:
https://docs.aws.amazon.com/greengrass/v2/developerguide/getting-started.html
若要將元件上傳到雲端,請按照「上傳元件」部分下的說明進行操作:
https://docs.aws.amazon.com/greengrass/v2/developerguide/upload-first-component.html
10.1 部署元件
請按照以下網址的線上說明進行操作:部署您的組件,以部署並驗證您的組件是否正在部署。
11. 故障排除
有關 AWS IoT Greengrass 的一般故障排除技巧,請參閱:https://docs.aws.amazon.com/greengrass/v2/developerguide/troubleshooting.html
如需針對特定設備的故障排除指南,請直接發送郵件至 techsupport@premioinc.com。