| title | description | services | keywords | author | manager | ms.author | ms.reviewer | ms.date | ms.topic | ms.service |
|---|---|---|---|---|---|---|---|---|---|---|
Simulate Azure IoT Edge on Windows | Microsoft Docs |
Install the Azure IoT Edge runtime on a simulated device in Windows and deploy your first module |
iot-edge |
kgremban |
timlt |
kgremban |
elioda |
10/05/2017 |
article |
iot-edge |
Azure IoT Edge moves the power of the cloud to your Internet of Things (IoT) devices. This tutorial walks you through creating a simulated IoT Edge device that generates sensor data. You learn how to:
[!div class="checklist"]
- Create an IoT hub
- Register an IoT Edge device
- Start the IoT Edge runtime
- Deploy a module
- View generated data
The simulated device that you create in this tutorial is a monitor on a wind turbine that generates temperature, humidity, and pressure data. You're interested in this data because your turbines perform at different levels of efficiency depending on the weather conditions. The other Azure IoT Edge tutorials build upon the work you do here by deploying modules that analyze the data for business insights.
This tutorial assumes that you're using a computer or virtual machine running Windows to simulate an Internet of Things device.
Tip
If you're running Windows in a virtual machine, enable nested virtualization and allocate at least 2GB memory.
Docker for Windows can run either Windows containers or Linux containers. The steps for the tutorial are the same regardless of which container type you use, but the software prerequisites are different.
-
Make sure you're using a supported Windows version:
- Windows 10
- Windows Server
-
Install Docker for Windows and make sure it's running.
-
Install Python 2.7 on Windows and make sure you can use the pip command.
-
Run the following command to download the IoT Edge control script.
pip install -U azure-iot-edge-runtime-ctl
-
Make sure you're using a supported Windows version:
- Windows IoT Core (Build 16299) on a x64-based device
- Windows 10 Fall Creators Update
- Windows Server 1709 (Build 16299)
-
Run the following command in an Admin PowerShell console to install and configure the prerequisites:
Invoke-Expression (Invoke-WebRequest -useb https://aka.ms/iotedgewin)
This script provides the following:
- Docker, configured to use Windows containers. If you already have Docker on your machine, go through the steps to switch to Windows containers.
- Python 3.6
- The IoT Edge control script (iotedgectl.exe)
[!INCLUDE iot-hub-create-hub]
[!INCLUDE iot-edge-register-device]
The IoT Edge runtime is deployed on all IoT Edge devices. It comprises two modules. First, the IoT Edge agent facilitates deployment and monitoring of modules on the IoT Edge device. Second, the IoT Edge hub manages communications between modules on the IoT Edge device, and between the device and IoT Hub.
Use the following steps to install and start the IoT Edge runtime:
-
Configure the runtime with your IoT Edge device connection string from the previous section.
iotedgectl setup --connection-string "{device connection string}" --auto-cert-gen-force-no-passwords -
Start the runtime.
iotedgectl start -
Check Docker to see that the IoT Edge agent is running as a module.
docker ps
[!INCLUDE iot-edge-deploy-module]
You can monitor your new IoT Edge device's status by clicking on it in IoT Edge Explorer page of your IoT hub.
You can view the telemetry the device is sending by using the IoT Hub explorer tool.
In this tutorial, you created a new IoT Edge device and used the Azure IoT Edge cloud interface to deploy code onto the device. Now, you have a simulated device generating raw data about its environment.
This tutorial is the prerequisite for all of the other IoT Edge tutorials. You can continue on to any of the other tutorials to learn how Azure IoT Edge can help you turn this data into business insights at the edge.
[!div class="nextstepaction"] Deploy your own code as a module Deploy Azure Stream Analytics as a module