How to Run Azure IoT Edge Runtime on RevPi Devices

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.

Required Hardware

  • RevPi device (at least 8 GB)
  • Your PC incl. Internet access

Preparations

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
provisioning:
source: “manual”
device_connection_string: “HostName=XXX.azure-devices.net;DeviceId=rpi-1;SharedAccessKey=XXXXc=”

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

Troubleshooting

If you have problems, you can find help here. You can get in touch with our experts and other RevPi users in our forum.

Further Information

KUNBUS RevPi website

What is Azure IoT Edge?

Azure IoT Edge 1.0.10 release is now available

Azure IoT Edge supported systems

Develop your own IoT Edge modules