Azure Percept DK is an easy-to-use platform for creating edge AI solutions. It combines different Azure services (e.g., Azure Cognitive Services and Machine Learning) to deliver real-time audio and vision insights. The device comes pre-built with Azure Percept Studio, a service which makes deploying on this device even easier to do. To find out more about the Azure Percept DK visit this page.
Previously, we successfully managed deploying a custom azure stream analytics edge module on the Azure Percept DK. Now, our question was – how do we replicate the modules with their configuration on multiple Azure Percept DK at large scale? One way is to deploy and configure each module on devices separately - but this would be very time consuming. The answer to this is: Azure IoT Edge automatic deployments.
Azure IoT Edge provides two different methods to configure modules for IoT Edge devices. The method we are outlining today is to create a deployment manifest and then apply the configuration to a particular device by its name. The configuration can be applied on multiple devices at the same time by using device twin tags.
All you need to do is to provide the device connection string (from IoT Hub) to your end Azure Percept DK user. You can go through the Azure Percept DK setup and use this connection string to get connected to Azure IoT hub. The reference architecture containing the AzureEye, StreamAnalytics, HostIp, ImageCapturing and WebStream modules is showed in the diagram below:
We can talk hours about the features of Azure Percept DK, but now it’s time to get things working. In order to get started, log onto the Azure portal, navigate to your IoT Hub resource and follow the below instructions:
4. Go on the ‘modules’ tab
5. Click on Runtime Settings button and configure the Edge Agent and Edge Hub, if not already configured by default (configuration template available at the end of the article)
6. Under IoT Edge Modules click on add and select ‘IoT Edge Module’. Give it a name, in this case: azureeyemodule and paste the Image URI under ‘Module Settings’ tab (links available at the end of the document)
7. Select ‘Container Create Option’ tab and paste the Docker container configuration
8. Select the ‘Module Twin Settings’ tab and paste the module twin desired properties. Set the property to “properties.desired”
9. Save the newly created IoT Edge Module by selecting the ‘add’ button
10. If deploying ASA Edge follow this step, otherwise skip this step: Add the Azure Stream Analytics Edge module by selecting the ‘Azure Stream Analytics’ Module option, select the Edge Job you want to deploy and click ‘Save’
11. Add the ImageCapturingModule by following the same steps shown for azureyeemodule
12. Select the ‘Environment Variables’ tab and specify 3 variables as shown in the screenshot below
13. Press on ‘Add’ to save the module
14. Add the HostIpModule by following the same steps as for the ImageCapturingModule
15. Select ‘Container Create Option’ tab and paste the Docker container configuration
16. Click ‘Add’
17. Add the WebStreamModule by following the same steps as shown above
18. Click ‘Add’ to save the module
19. Select the ‘Routes’ tab to specify how the device will route the data (we are specifying two routes – one route from azureeyemodule to the ASA job and the second route from ASA job to IoT Hub). In case you are planning to receive telemetry from the azureeyemodule only, use the third route only which is shown below (AzureEyeModuleToIoTHub)
20. Optionally, you can specify some metrics to monitor IoT Edge deployments. In our case we have specified one metric to state if the device has been successfully configured
21. Click on ‘Target Devices’ tab and specify the priority number for the deployment (higher values indicate higher priority) and the target condition by specifying the device/s you want to apply the deployment manifest on (in our case deviceid = ‘Percept_Excalibur’). You can click on view devices to check if the target condition is correct
22. Select ‘Review + create’ tab – if the validation passed, you are ready to create the deployment manifest by clicking on the create button
23. Now you can get the IoT Edge Device Connection string, using Azure IoT Hub, and pass it on to the Azure Percept DK user. The user will need to configure the Azure Percept DK to use the connection string
24. You should see the newly created deployment listed in ‘IoT Edge Deployments’ tab – wait a few minutes for the deployment manifest to be applied to the target device
25. If successfully, the system metrics will report success
26. The modules should be deployed on the device up and running showing no errors
--------------------------------------------------------------------------------------------------------------------------------------------------------
Edge deployment configuration template:
Edge Hub settings
Image URI: mcr.microsoft.com/azureiotedge-hub:1.1
Environment variables:
OptimizeForPerformance (Text) - False
mqttSettings__ThreadCount (Text) - 4
SslProtocols (Text) - tls1.2
Container Create Options:
{
"HostConfig": {
"PortBindings": {
"443/tcp": [
{
"HostPort": "443"
}
],
"5671/tcp": [
{
"HostPort": "5671"
}
],
"8883/tcp": [
{
"HostPort": "8883"
}
]
}
}
}
Edge Agent settings
Image URI: mcr.microsoft.com/azureiotedge-agent:1.0
Environment Variables:
BackupConfigFilePath (Text) - /tmp/edgeAgent/backup.json
Azureeyemodule settings
IoT Edge Module Name: azureeyemodule
Image URI: mcr.microsoft.com/azureedgedevices/azureeyemodule:preload-devkit
Container Create Options:
{
"ExposedPorts": {
"8554/tcp": {}
},
"HostConfig": {
"Binds": [
"/dev/bus/usb:/dev/bus/usb"
],
"DeviceCgroupRules": [
"c 189:* rmw"
],
"PortBindings": {
"8554/tcp": [
{
"HostPort": "8554"
}
]
}
}
}
Module Twin Settings:
{
"ExposedPorts": {
"8554/tcp": {}
},
"HostConfig": {
"Binds": [
"/dev/bus/usb:/dev/bus/usb"
],
"DeviceCgroupRules": [
"c 189:* rmw"
],
"PortBindings": {
"8554/tcp": [
{
"HostPort": "8554"
}
]
}
}
}
ImageCapturingModule
IoT Edge Module Name: ImageCapturingModule
Image URI: mcr.microsoft.com/azureedgedevices/imagecapturingmodule:latest-arm64v8
Environment Variables:
RTSP_IP – azureeyemodule
RTSP_PORT – 8554
RTSP_PATH – raw
HostIpModule
IoT Edge Module Name: HostIpModule
Image URI: mcr.microsoft.com/azureedgedevices/hostipmodule:latest-arm64v8
Container Create Options:
{
"NetworkingConfig": {
"EndpointsConfig": {
"host": {}
}
},
"HostConfig": {
"NetworkMode": "host"
}
}
WebStreamModule
IoT Edge Module Name: WebStreamModule
Image URI: mcr.microsoft.com/azureedgedevices/webstreammodule:preload-devkit
Environment Variables:
RTSP_IP – azureeyemodule
RTSP_PORT – 8554
RTSP_PATH – raw
Container Create Options:
{
"ExposedPorts": {
"2999/tcp": {},
"3000/tcp": {},
"3002/tcp": {},
"3004/tcp": {},
"3006/tcp": {},
"3008/tcp": {},
"3010/tcp": {}
},
"HostConfig": {
"PortBindings": {
"2999/tcp": [
{
"HostPort": "2999"
}
],
"3000/tcp": [
{
"HostPort": "3000"
}
],
"3002/tcp": [
{
"HostPort": "3002"
}
],
"3004/tcp": [
{
"HostPort": "3004"
}
],
"3006/tcp": [
{
"HostPort": "3006"
}
],
"3008/tcp": [
{
"HostPort": "3008"
}
],
"3010/tcp": [
{
"HostPort": "3010"
}
]
}
}
}
Deployment routes
{
"routes": {
"telemetrytoAsa": "FROM /messages/modules/azureeyemodule/* INTO BrokeredEndpoint(\"/modules/perceptasa/inputs/edgeinput\")",
"asatoiothub": "FROM /messages/modules/perceptasa/* INTO $upstream",
"AzureEyeModuleToIoTHub": "FROM /messages/modules/azureeyemodule/outputs/* INTO $upstream"
}
}
--------------------------------------------------------------------------------------------------------------------------------------------------------
Now Try out Azure Percept yourself
To get started on building your own solutions with Azure Percept, it’s easy to purchase a developer kit to try out pilot projects before deciding to deploy at scale. You also can visit the Azure Percept YouTube channel for videos about getting started with the developer kit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.