1
2

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.

Azure IoT Edgeランタイムインストール - Raspberry Pi OS Buster編

Last updated at Posted at 2021-03-11

2021/04/09 : 最新化しました。

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.8

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

$ 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,now 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

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

2021年3月11日時点としてバージョン1.1が最新とLTSです。
1.2はまだプレビューとなり別手順でインストールしなければいけないです。

$ apt list -a iotedge
Listing... Done
iotedge/stretch 1.1.1-1 armhf
iotedge/stretch 1.1.0-1 armhf
iotedge/stretch 1.0.10.4-1 armhf
iotedge/stretch 1.0.10.2-1 armhf
...
$ sudo apt install -y iotedge
$ sudo usermod -aG docker ${USER}
$ sudo reboot now

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

簡単なコマンドのみ掲載して説明は緩和します。

$ sudo vi /etc/iotedge/config.yaml
$ sudo systemctl restart iotedge
$ sudo systemctl status iotedge
$ sudo journalctl -u iotedge | grep "Starting module edgeAgent"
$ iotedge list
NAME             STATUS           DESCRIPTION      CONFIG
edgeAgent        running          Up 18 seconds    mcr.microsoft.com/azureiotedge-agent:1.1
$ $ docker ps
CONTAINER ID        IMAGE                                      COMMAND                  CREATED              STATUS              PORTS               NAMES
b851a8db4d43        mcr.microsoft.com/azureiotedge-agent:1.1   "/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

1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?