2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Raspberry PiでAzure IoT Edge v1.2ランタイムインストール - Raspberry Pi OS Buster 32bit編

Posted at

Azure IoT Edge v1.2 ランタイムからは既存インストール手順と異なるため、新たに整理します。
v1.1以下のランタイムインストールについては下記の手順をご参照ください。

そして、v1.1からv1.2へアップデートについては下記の手順をご参照ください。

Azure IoT EdgeランタイムをRaspberry Piにインストールする手順についてなるべく簡単にまとめます。
公式ドキュメントではRaspberry Pi OS StretchをTier 1としてサポートしていますが、最新OSのRaspberry Pi OS BusterはTier 2としてサポートしてます。

Tier 1 : Microsoft社が確認とインストールパッケージを提供
Tier 2 : Microsoft社は非公式サポート、Azure IoT Edgeと互換性あるので使用可能

image.png

不要な内容とゴミが残らないような手順で整理しておきます。
基本、Raspberry Pi OS Stretch手順をBusterでもそのまま使えます。
(去年までは追加手順が必要でしたが、現在は不要です)

ARM64向けのUbuntu Server 20.04.X 64bit OSがインストールされているRaspberry Piはこちらの手順を参考してください。

バージョン確認

最新のRaspberry Pi OS with Desktopをインストールしてください。
https://www.raspberrypi.org/software/operating-systems/

image.png

Debian Buster確認
https://www.debian.org/releases/

$ cat /etc/debian_version
10.9

インストールパッケージのリポジトリ設定

$ curl https://packages.microsoft.com/config/debian/stretch/multiarch/prod.list > ./microsoft-prod.list
$ sudo mv ./microsoft-prod.list /etc/apt/sources.list.d/
$ curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
$ sudo mv ./microsoft.gpg /etc/apt/trusted.gpg.d/

コンテナーエンジンのインストール

$ sudo apt update
$ apt list -a moby-engine
...
moby-engine/stretch 3.0.13+azure-0 armhf
moby-engine/stretch 3.0.12+azure-0 armhf
moby-engine/stretch 3.0.11+azure-2 armhf
...
$ sudo apt install -y moby-engine
$ sudo usermod -aG docker ${USER}

IoT Edgeセキュリティデーモンのインストール

$ apt list -a aziot-edge
Listing... Done
aziot-edge/stretch 1.2.0-1 armhf
aziot-edge/stretch 1.2.0~rc4-1 armhf
...
$ sudo apt install -y aziot-edge
$ sudo reboot now

デバイスのプロビジョニング

v1.2からは二つ方式について設定可能です。
こちらはテンプレートファイルから設定ファイルを作成する方式で説明します。

$ sudo cp /etc/aziot/config.toml.edge.template /etc/aziot/config.toml
$ sudo vi /etc/aziot/config.toml
...
# Manual provisioning with connection string
[provisioning]
source = "manual"
connection_string = "<ADD DEVICE CONNECTION STRING HERE>"
...
$ sudo iotedge config apply
Note: Symmetric key will be written to /var/secrets/aziot/keyd/device-id
Azure IoT Edge has been configured successfully!

Restarting service for configuration to take effect...
Stopping aziot-edged.service...Stopped!
Stopping aziot-identityd.service...Stopped!
Stopping aziot-keyd.service...Stopped!
Stopping aziot-certd.service...Stopped!
Stopping aziot-tpmd.service...Stopped!
Starting aziot-edged.mgmt.socket...Started!
Starting aziot-edged.workload.socket...Started!
Starting aziot-identityd.socket...Started!
Starting aziot-keyd.socket...Started!
Starting aziot-certd.socket...Started!
Starting aziot-tpmd.socket...Started!
Starting aziot-edged.service...Started!
Done.
$ sudo iotedge system status
System services:
    aziot-edged             Running
    aziot-identityd         Running
    aziot-keyd              Running
    aziot-certd             Running
    aziot-tpmd              Ready

Use 'iotedge system logs' to check for non-fatal errors.
Use 'iotedge check' to diagnose connectivity and configuration issues.
$ iotedge list
NAME             STATUS           DESCRIPTION      CONFIG
edgeAgent        running          Up a minute      mcr.microsoft.com/azureiotedge-agent:1.2
$ docker ps
CONTAINER ID   IMAGE                                      COMMAND                  CREATED              STATUS              PORTS     NAMES
5eb7fc0czb8a   mcr.microsoft.com/azureiotedge-agent:1.2   "/bin/sh -c 'exec /a…"   About a minute ago   Up About a minute             edgeAgent

注意点

ありません。わずか数分でインストールできます。
最新のRaspberry Pi OS Busterでインストールしてある状態なら、問題なくAzure IoT Edgeランタイムをインストールできます。

One more thing

IoT EdgeデバイスにDeployment Manifestを作成するには下記のウェブサイトで作成することをお勧めします。
フローダイアグラムでIoT Edgeモジュールを配置してDeployment Manifestをダウンロードできます。

image.png

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?