This project is maintained by gloveboxes
Module 6: Build and deploy the solution
As we will be building Docker images on the Raspberry Pi 4 so I would recommend a fast SD Card or a high speed USB3 Flash or SSD drive.
This project depends on ARM64 support and the recommended platform is Ubuntu Server 20.04 or 20.10 for Raspberry Pi. See How to install Ubuntu Server on your Raspberry Pi.
Update and reboot
sudo apt update && sudo apt full-upgrade && sudo reboot
Optionally overclock the Raspberry Pi 4.
Though not a requirement, the machine learning inference times will be improved by overclocking the Raspberry Pi 4. You will need a Raspberry Pi heat sink if you overclock. See the How to overclock Raspberry Pi 4 article for more information.
I use the following settings in the /boot/firware/config.txt
.
over_voltage=6
arm_freq=2000
gpu_freq=700
and reboot.
Follow the steps outlined in the Install or uninstall Azure IoT Edge for Linux guide. Follow the guidance for Ubuntu 18.04.
You need to configure the Azure IoT Edge connection string.
Open the Azure IoT Edge config file.
sudo nano /etc/iotedge/config.yaml
Scroll down to the Manual provisioning configuration section.
# Manual provisioning configuration
provisioning:
source: "manual"
device_connection_string: "<ADD DEVICE CONNECTION STRING HERE>"
Update the device_connection_string property with the Azure IoT Edge Connection string you saved to Notepad.
Press Enter to confirm the file name
Reboot the Raspberry Pi
sudo reboot
Azure IoT Edge relies on Docker images being distributed from a Docker Registry. In production you would deploy Docker images from a registry such as Azure Container Registry.
When you are developing an Azure Iot Edge module it is faster to install a local container registry on the Raspberry Pi and deploy Docker images from the local registry to Azure IoT Edge.
Log into your Raspberry Pi
From the SSH session, run the following command.
docker run -d -p 5000:5000 --restart=always --name registry registry:2
Do NOT close the SSH session.
Log into your Raspberry Pi
ssh pi@raspberrypi.local
From the SSH session, install the git client.
sudo apt install -y git
From the SSH session, clone the solution repository to the Raspberry Pi
git clone --depth 1 https://github.com/gloveboxes/Create-a-talking-image-recognition-solution-with-Azure-IoT-Edge-Azure-Cognitive-Services.git