This repo is a companion application for a video series from Visual Studio Toolbox! Check out the videos for how to get started with Windows IoT Core if you'd like to see this device in action and want more information.
We’ll create a Smart IoT Device application for deployment to your Windows 10 IoT Core device. This application has the following features:
- Waving in front of the proximity sensor will cause the application to recognize your face and greet you by name in the application UI. This is made possible by Microsoft Cognitive Services.
- The temperature of the room will be displayed on screen on the app's UI.
- The temperature will be reported to Azure IoT Hub and displayed in Azure IoT Central.
This is a headed sample. To better understand what headed mode is and how to configure your device to be headed, follow the instructions here.
Also, be aware that the GPIO APIs are only available on Windows 10 IoT Core, so this sample cannot run on your desktop.
You’ll need a few components:
-
a BME280 breakout board (soldering is required)
-
a VCNL4010 breakout board (soldering is required)
-
a 5" HDMI screen for portability
-
a HDMI cable and USB micro cable for the screen
-
an ethernet cable for connecting the Pi directly to your development computer if desired
- 3V pin to Cobbler's 3V pin
- GND to Cobbler's GND pin
- SCK to Cobbler's SCK pin
- SDI to Cobbler's SDL pin
- 3V pin to Cobbler's 3V pin
- GND to Cobbler's GND pin
- SCK to Cobbler's SCK pin
- SDI to Cobbler's SDL pin
- INT to Cobbler's GPIO 16 pin
- Create a Face API subscription key
- Train the Face API to recognize your face
- Create an Azure IoT Central application (or Azure IoT Hub directly if you'd prefer not to use IoT Central)
- Create a device via either Azure IoT Central, or Azure IoT Hub. Note down the device id and the connection string for that device.
The credentials needed are listed as empty string variables in Constants/CredentialsConstants.cs. Fill these in with your own created via the steps above.
-
With the application open in Visual Studio, set the architecture in the toolbar dropdown. As you’re building for Raspberry Pi 2 or 3, select
ARM
. -
Next, in the Visual Studio toolbar, click on the
Local Machine
dropdown and selectRemote Machine
-
At this point, Visual Studio will present the Remote Connections dialog. If you previously used PowerShell to set a unique name for your device, you can enter it here (in this example, we’re using my-device). Otherwise, use the IP address of your Windows IoT Core device. After entering the device name/IP select
Universal
for Windows Authentication, then click Select. -
You can verify or modify these values by navigating to the project properties (select Properties in the Solution Explorer) and choosing the
Debug
tab on the left:
When everything is set up, you should be able to press F5 from Visual Studio. If there are any missing packages that you did not install during setup, Visual Studio may prompt you to acquire those now. The SmartHomeDevice app will deploy and start on the Windows IoT device.
Congratulations! You controlled some advanced devices on your Windows IoT device.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.