title | description | author | ms.author | ms.date | ms.topic | ms.service | services | manager |
---|---|---|---|---|---|---|---|---|
Connect a Windows IoT Core device to your Azure IoT Central application | Microsoft Docs |
As a device developer, learn how to connect an MXChip IoT DevKit device to your Azure IoT Central application. |
miriambrus |
miriamb |
04/09/2018 |
conceptual |
iot-central |
iot-central |
peterpr |
This article describes how, as a device developer, to connect a Windows IoT Core device to your Microsoft Azure IoT Central application.
To complete the steps in this article, you need the following:
- An Azure IoT Central application created from the Sample Devkits application template. For more information, see the create an application quickstart.
- A device running the Windows 10 IoT Core operating system. For this walkthrough, we will use a Raspberry Pi.
An application created from the Sample Devkits application template includes a Windows IoT Core device template with the following characteristics:
- Telemetry which contains the measurements for the device Humidity, Temperature and Pressure.
- Settings showing Fan Speed.
- Properties containing device property die number and location cloud property.
For full details on the configuration of the device template refer to Windows IoT Core Device template details
In your Azure IoT Central application, add a real device from the Windows IoT Core device template and make a note of the device connection string. For more information, see Add a real device to your Azure IoT Central application.
To set up a Windows IoT Core device please follow the step by step guide at Set up a Windows IoT Core device.
In your Azure IoT Central application, add a real device from the Windows IoT Core device template and make a note of the device connection details(Scope ID, Device ID, Primary key). For more information, see Add a real device to your Azure IoT Central application.
Note
Azure IoT Central has transitioned to using Azure IoT Hub Device Provisioning service (DPS) for all device connections, follow these instrustions to get the device connection string and continue with the rest of the tutorial.
To set up a physical Windows 10 IoT Core device, you will need to first have a device running Windows 10 IoT Core. Learn how to set up a Windows 10 IoT Core device here.
You will also need a client application that can communicate with Azure IoT Central. You can either build your own custom application using the Azure SDK and deploy it to your device using Visual Studio, or you can download a pre-built sample and simply deploy and run it on the device.
To deploy the client application from the previous step to your Windows 10 IoT device in order to prepare it:
Ensure the connection string is stored on the device for the client application to use
- On the desktop, save the connection string in a text file named connection.string.iothub.
- Copy the text file to the device’s document folder:
[device-IP-address]\C$\Data\Users\DefaultAccount\Documents\connection.string.iothub
Once you've done that, you'll need to open the Windows Device Portal by typing in http://[device-IP-address]:8080 into any browser.
From there and, as shown in the if below, you'll want to:
- Expand the "Apps" node on the left.
- Click "Quick-run samples".
- Click "Azure IoT Hub Client".
- Click "Deploy and run".
When successful, the application will launch on the device and look like this:
In Azure IoT Central, you can see how the code running on the Raspberry Pi interacts with the application:
- On the Measurements page for your real device, you can see the telemetry.
- On the Properties page, you can see the value of the reported Die Number property.
- On the Settings page, you can change various settings on the Raspberry Pi such as voltage and fan speed.
If you want to explore and modify the source code for the client application, you can download it from GitHub here. If you plan to modify the code, you should follow these instructions in the readme file here for your desktop operating system.
Note
If git is not installed in your development environment, you can download it from https://git-scm.com/download.
An application created from the Sample Devkits application template includes a Windows IoT Core device template with the following characteristics:
Field name | Units | Minimum | Maximum | Decimal places |
---|---|---|---|---|
humidity | % | 0 | 100 | 0 |
temp | °C | -40 | 120 | 0 |
pressure | hPa | 260 | 1260 | 0 |
Numeric settings
Display name | Field name | Units | Decimal places | Minimum | Maximum | Initial |
---|---|---|---|---|---|---|
Fan Speed | fanSpeed | RPM | 0 | 0 | 1000 | 0 |
Type | Display name | Field name | Data type |
---|---|---|---|
Device property | Die number | dieNumber | number |
Text | Location | location | N/A |