【 Edge 】安裝 Azure IoT Edge 於 Raspberry Pi 4
內容
- 學習目標
 - 前置準備作業
 - 安裝 
Azure IoT Edge 
學習目標
- 於 
Raspberry Pi 4的Raspbian Buster OS安裝 Azure IoT Edge 
前置準備作業
- 已於 
Raspberry Pi 4安裝Raspbian Buster - 已設定網路連線
 - 相關設備 
- 準備一台 
Raspberry Pi 4 - 準備一條 
Raspberry Pi 4專用的電源線 - 準備一張 
Micro SD Card - 準備 
鍵盤與滑鼠 - 準備一台 
螢幕 - 準備一條 
HDMI 母轉Mini HDMI 公的線 - 準備一台 電腦 ( Windows 或 macOS )
 
 - 準備一台 
 
安裝 Azure IoT Edge
 Step 1. 開啟終端機
- 點選上方的 
終端機

 
Step 2. 開始安裝
-  
2.1 安裝 Docker ( 請在終端機輸入下方指令 )
curl -sSL get.docker.com | sh && sudo usermod pi -aG docker && sudo reboot
 -  
2.2 安裝版本為
1.0.2的libssl( 請在終端機輸入下方指令 )sudo apt-get install libssl1.0.2
 -  
2.3 安裝
Azure IoT Edge( 請在終端機輸入下方指令 )curl https://packages.microsoft.com/config/debian/stretch/multiarch/prod.list > ./microsoft-prod.list && \ sudo cp ./microsoft-prod.list /etc/apt/sources.list.d/ && \ curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg && \ sudo cp ./microsoft.gpg /etc/apt/trusted.gpg.d/ && \ sudo apt-get update && sudo apt-get -y install iotedge
 -  
2.4 設定
Azure IoT Hub的Connection String( 請在終端機輸入下方指令 )- 將 
<ADD DEVICE CONNECTION STRING HERE>改成 Ref 設定 Azure IoT Hub 中的 IoT Edge 文章中Primary Connection String所取得的字串 
sudo nano /etc/iotedge/config.yaml-  
修改前

 -  
修改後

 -  
存檔並離開
-  
同時按 ctrl 與 X

 -  
再輸入
Y
 -  
再按 enter

 
 -  
 
 - 將 
 -  
2.5 重新啟動
IoT Edge( 請在終端機輸入下方指令 )sudo systemctl restart iotedge
 -  
2.6 查看
IoT Edge狀態 ( 請在終端機輸入下方指令 )sudo systemctl status iotedge
 -  
2.7 查看
Container狀態 ( 請在終端機輸入下方指令 )sudo docker ps