Add an IoT Edge Device on Windows with Multipass
Prerequisites
- Before you begin, ensure you have the following:
-
An IoT Edge device added to the Datalogic Connect and noted down the Device ID of the edge device.
-
The device credentials from the edge device credentials page:
-
Scope ID: This is your DPS (Device Provisioning Service) scope identifier
-
Device Primary Key: The device's primary authentication key
-
Your Organization ID: This identifies your tenant in the IoT Platform
-
SAS Devices Key: Used for device authentication (this is the "SAS-IoT-Devices primaryKey")
-
SAS Smart Enrollment Key: Required for communication between the device and the platform (this is the "API token")
-
SAS Blob Storage URL: The URL for the blob storage associated with your edge device.
-
You'll need to note these values as they'll be required during the installation and configuration process.
When you see these fields in the Edge Device Credentials page:
- Scope ID → Use directly as
id_scopein configuration - Device Primary Key → Use as
symmetric_keyvalue in IoT Edge config - Organization ID → Use as
tenantIdin Redis configuration - SAS Devices Key → Use as
modulePrimaryKeyin Redis configuration - SAS Smart Enrollment Key → Use as
deviceHubApiKeyin Redis configuration
Network Requirements
To ensure proper communication between your IoT Edge device and Datalogic Connect services, make sure the following network endpoints are accessible:
| Endpoint | Port | Protocol | Notes |
|---|---|---|---|
| *.azure-devices.net | 8883, 443 | MQTT, HTTPS | Send diagnostic data, receive cloud commands |
| global.azure-devices-provisioning.net | 443 | HTTPS | Device provisioning |
| *.blob.core.windows.net | 443 | HTTPS | File upload, Docker image pull |
| crsolinfraprodeuw.azurecr.io | 443 | HTTPS | Container registry |
If your device is behind a corporate firewall, ensure these endpoints are whitelisted to allow proper IoT Edge functionality.
Windows requirements
- A Windows 10 or Windows 11 machine with Hyper-V enabled. You can enable Hyper-V by following the instructions on the Microsoft Hyper-V installation guide.
Add an IoT Edge Device on Windows with Multipass
-
Install Multipass:
- Download and install Multipass from the official website.
- Follow the installation instructions for Windows.
-
Create a Bridged Network:
- Open PowerShell or Command Prompt and run the following command to create a bridged network:
multipass networks
multipass set local.bridged-network="Default Switch"
- Open PowerShell or Command Prompt and run the following command to create a bridged network:
-
Update the Cloud-Init File with Edge Device Parameters:
- Download the cloud-init-edge.yaml script for configuring the Edge device.
- Open the file in a text editor and replace the placeholder values with the actual values you noted earlier:
REPLACE_WITH_YOUR_SCOPE_IDwith your Scope IDREPLACE_WITH_YOUR_EDGE_DEVICE_IDwith your Device IDREPLACE_WITH_YOUR_EDGE_DEVICE_PRIMARY_KEYwith your Device Primary KeyREPLACE_WITH_YOUR_ORGANIZATION_IDwith your Organization IDREPLACE_WITH_YOUR_SAS_DEVICES_KEYwith your SAS Devices KeyREPLACE_WITH_YOUR_SAS_SMART_ENROLLMENT_KEYwith your SAS Smart Enrollment KeyREPLACE_WITH_YOUR_EDGE_BLOB_STORAGE_URLwith your SAS Blob Storage URL
- Save the changes to the file.
-
Create an Ubuntu VM:
- Open PowerShell or Command Prompt and run the following command to create a new Ubuntu 22.04 VM:
multipass launch 22.04 --name edge-vm --cpus 1 --disk 5G --memory 2G --cloud-init cloud-init-edge.yaml --bridged - This command creates a VM named
edge-vmwith 1 CPU, 5GB disk space, and 2GB memory, using the specified cloud-init file and bridged network. After running the command, wait a few minutes for the VM to be fully set up. - You can check the status of the VM with:
multipass listor you can run Multipass app to see the status.
- Open PowerShell or Command Prompt and run the following command to create a new Ubuntu 22.04 VM:
-
Check the Edge Device Status:
- After the VM is created, you can check the status of your IoT Edge device in the Datalogic Connect portal under the Devices section. It may take a few minutes for the device to appear as "Connected".
Troubleshooting
- Multipass Waiting for Daemon:
- If you encounter an error stating "Waiting for daemon...", ensure that the Multipass service is running. Additionally, you can open a power shell as administrator and run (the Y is for Yes and if you have a different language on your Windows you might need to change it accordingly):
You can find more information on the issue page
takeown /a /r /d Y /f "C:\ProgramData\Multipass"
- If you encounter an error stating "Waiting for daemon...", ensure that the Multipass service is running. Additionally, you can open a power shell as administrator and run (the Y is for Yes and if you have a different language on your Windows you might need to change it accordingly):