AWS GreengrassチュートリアルをRaspberry Pi 3(Stretch)で実践するに当たって、ハマったところのメモです。
RaspberryPiにSDカードを挿す前にすること
以下の/Volumes/boot
はMacの場合です。Windowsの場合は、そのままbootという名前でディスクが見えていると思います。
ネットワーク設定
SDカードにイメージを書き込んで/Volumes/boot
にssh
というファイルを作成した後、同じく/Volumes/boot
にwpa_supplicant.conf
を作成します。
こちらのツールを使うと簡単にファイルを作成することができます。
Raspberry Piの無線LANをmicroSDで簡単に設定するためのツールを作った
cmdline.txtの修正(ハマりどころ)
/Volumes/boot/cmdline.txt
にcgroup_memory=1
を追記します。
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=37665771-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh cgroup_memory=1
これをしないと、GreengrassCoreを起動するときに、runtime.logこのようなエラーが発生して起動できません。
Started all system components
Deployment agent connected to cloud
Started Deployment Agent and listening for updates
Started Deployment Agent and listening for updates
Runtime execution error: unable to start lambda container. container_linux.go:259: starting container process caused "process_linux.go:345: container init caused \"process_linux.go:286: setting cgroup config for ready process caused \\\"no such directory for memory.limit_in_bytes\\\"\""
failed to start worker: container_linux.go:259: starting container process caused "process_linux.go:345: container init caused \"process_linux.go:286: setting cgroup config for ready process caused \\\"no such directory for memory.limit_in_bytes\\\"\""
Runtime failed to start: post-start check failed, error: a check has timed out, check
参考:Greengrass v1.1.0 ARMv7l runtime execution error
上記Forumの議論でsudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel
が出てきますが、これはやらなくても大丈夫でした。
必要なファイルを入れておく(Optional)
チュートリアルの中で、Greengrasscoreと証明書類をSCPでRaspberryPiに送るという手順がありますが、これらのファイルを/Volumes/boot
に入れておくと、起動後のRaspberryPiの/boot
にこのファイルが残っているので、ちょっと楽できます。
残りの手順
後は、チュートリアルのページ通りに進めるだけです。