This tutorial describes how to use Microsoft IoT Edge to connect a RevPi device to Azure IoT Hub. This process involves configuring Azure IoT Hub and registering your IoT device.
- RevPi device (at least 8 GB)
- Your PC incl. Internet access
Setting up Azure
Creating the Hub
- Log in to the Azure Portal.
- Click on “Create a resource” to search for “IoT Hub”.
- Click on “Create”.
- Select the region that is closest to you.
Please note: Not all Azure services are available in all regions.
- Select the tier that corresponds to your needs under “Management”.
- Click “Review + Create.”
- Click on “Create”.
Creating the Edge Device
- Go to the IoT hub you just created.
- Click on “IoT Edge” in the sidebar under “Device management”.
- Click on “Add IoT Edge Device”.
- Enter a “Device ID”.
- Accept the defaults.
- Click on “Save”.
- Click on “Refresh”.
- Click on the device you just created.
- Show the “Primary Connection String” and copy it to have it ready for later.
Setting up the RevPi Device
You can also watch this procedure on this screencast:
- Install the configuration package using the following commands to add the Microsoft package repository and the GPG public key:
curl https://packages.microsoft.com/config/debian/stretch/multiarch/packages-microsoft-prod.deb > ./packages-microsoft-prod.deb
sudo apt install ./packages-microsoft-prod.deb
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
- Install “moby container engine” with the following input:
sudo apt-get install moby-engine -y
sudo apt-get install iotedge -y
- Enter the connection string for your Azure account to your configuration to assign the cloud identity to the device:
sudo nano /etc/iotedge/config.yaml
- Edit config.yaml, scroll down to “connection string” and paste the string you copied before.
# Manual provisioning configuration
- Restart the service with:
sudo systemctl restart iotedge
- Check the installation using:
sudo systemctl status iotedge
sudo iotedge check
- Execute the command “iotedge check” twice until only one red error is left: “Production readiness: Edge hub”s storage directory”.
Your installation is now ready.