The official documentation is very verbose and wordy, which is exactly how it should be, but this tutorial tries a more brief approach towards installing the IOT Runtime on the Raspberry Pi
- You are fairly comfortable with Cloud Service providers, AWS, Azure or GCP.
- You have worked with the Raspberry Pi and SSH before
- How to setup Azure IOT Edge using the Portal
- How to get a Raspberry Pi communicating with Azure
Here are some of these explained in laymen's terms
Managed service to enable bi-directional communication between IoT devices and Azure
Azure IoT Hub provides a cloud-hosted solution backend to connect virtually any device.
- Logical representation, or the identity which the IOT Hub assigns every physical hardware device connected to it.
- Enables custom and cloud logic on IoT Edge devices. The runtime sits on the IoT Edge device, and performs management and communication operations.
- Login to the Azure Portal
- Search for 'IOT Hub'
- Click Add, under Size and Scale select Free Tier, accept the defaults and create an IOT Hub
- Go to the IOT Hub you just created
- From the side panel under Automatic Device Management, click IoT Edge, then click New
- Add a device name, accept the defaults and click Save
- Refresh, click the Device you just created, unhide and copy the Primary Connection String, keep this handy for later.
- Ensure that the Raspberry Pi (RPi) is running Raspbian Stretch
- Ensure that Docker and Docker Compose are installed. Read More - Installing Docker and Docker Compose on the Raspberry Pi in 5 Simple Steps
1) Registering Microsoft key and software repository feed
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/
2) Installing Moby-Engine, and IOTEdge Runtime
sudo apt-get update -y sudo apt-get install libssl1.0.2 moby-engine moby-cli iotedge -y
3) Let's add the connection string to connect the RPi with Azure
sudo nano /etc/iotedge/config.yaml
Add the Primary Connection String from Step 1.2 in here, and it should look something like this.
# Manual provisioning configuration provisioning: source: "manual" device_connection_string: "HostName=XXX.azure-devices.net;DeviceId=rpi-1;SharedAccessKey=XXXXc="
4) Setup is done, restart the service.
sudo systemctl restart iotedge
5) Verify the installation.
sudo systemctl status iotedge sudo iotedge check # should return 1 check as failed 'Edge Hub can bind to ports on host' sudo iotedge list # No modules are running
In the next tutorial, we will Deploy a Module to Azure IOT Edge Runtime on Linux
I know It's frustrating when something works in the tutorial but not when you do it, I would hate if that happened to you. So, please leave a comment, or reach out to me. If any of this does not work for you.