Azure IoT Workshop | Quality Assurance

End-to-end IoT workshop focusing on a quality assurance scenario powered by computer vision and AI.

View on GitHub

Jetson Nano and Azure IoT Edge initial setup

If you are attending a proctored lab, there are good chances that this step has already been taken care of for you, and that you have a Jetson Nano in front of you for which the following steps have already been performed. If not, read on to learn how to prepare a Jetson Nano for Azure IoT Edge development.

We’ll start from a blank Jetson installation (Jetpack v4.3 at the time of writing), install JetCard (a set of tools from NVIDIA to help enrich your AI development experience on Jetson Nano), copy a few files that are needed for the application (ex. pre-recorded video files to simulate RTSP cameras, configuration files, …), and finally install Azure IoT Edge.

Learning goals

Pre-requisites

NVIDIA Jetson Nano device used to run Deepstream with IoT Edge

Steps

Initial setup of the Jetson Nano

The initial setup of the Jetson Nano device consists in downloading and flashing a system image on the microSD card.

In both cases, you can use BalenaEtcher tool to flash your SD card. Both images are based on Ubuntu 18.04 and already include NVIDIA drivers, CUDA, and Nvidia-Docker. To check which version of JetPack you’re running, you can use the following command (JetPack 4.3 = Release 32, Revision 3):

head -n 1 /etc/nv_tegra_release

NOTE:

For the rest of this tutorial we will assume that you are using the device in USB Device Mode.

Installing files needed for the workshop (config files, sample video streams, …)

In order to facilitate development in the context of this workshop, let’s download some resources that will simplify your life, in particular, let’s copy locally some video files that will be used later to simulate real-time IP camera streams.

  1. On your Jetson Nano create a folder named data at the root of the filesystem:

     sudo mkdir /data
    
  2. Download extra setup files in the data directory:

     cd /data
     sudo wget -O setup.tar.bz2 --no-check-certificate "https://onedrive.live.com/download?cid=0C0A4A69A0CDCB4C&resid=0C0A4A69A0CDCB4C%21588625&authkey=ACUlRaKkskctLOA"
     sudo tar -xjvf setup.tar.bz2
    
  3. Make the folder accessible from a normal user account:

     sudo chmod -R 777 /data
    

Installing Azure IoT Edge

Run the following commands (copied from here for convenience) to install IoT Edge from Microsoft’s Debian package repository.

# Install the IoT Edge repository configuration
curl https://packages.microsoft.com/config/ubuntu/18.04/multiarch/prod.list > ./microsoft-prod.list
sudo cp ./microsoft-prod.list /etc/apt/sources.list.d/

# Install the Microsoft GPG public key
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo cp ./microsoft.gpg /etc/apt/trusted.gpg.d/

# Perform apt update
sudo apt-get update

# Install IoT Edge and the Security Daemon
sudo apt-get install iotedge

NOTE:

Azure IoT Edge modules are implemented as containers, therefore IoT Edge requires a container engine to run them. Microsoft typically recommends that you use moby-engine for production scenarios. Since NVIDIA Jetson Nano’s Ubuntu-based Linux distribution already ships with a Docker runtime, you don’t have to do anything else to install a container engine, since there already is one on the system.

Going further

If you are interested in exploring further, you might find the following resources useful:

Wrap-up and Next steps

In this section, we have created a new filesystem image and installed Azure IoT Edge on an NVIDIA Jetson Nano device.

In the next section, we will setup an IoT Central application that will allow us to remotely provision and configure the software components (IoT Edge modules) needed for performing computer vision tasks, and to operate our solution from a single pane of glass.