Skip to content

Latest commit

 

History

History
98 lines (61 loc) · 3.55 KB

windows-10-iot-core-pdsb-325-csharp.md

File metadata and controls

98 lines (61 loc) · 3.55 KB
platform device language
windows 10 iot core
pdsb 325
csharp

Run a simple Csharp sample on PDSB 325 device running Windows 10 IoT Core


Table of Contents

Introduction

About this document

This document describes how to connect PDSB 325 device running Windows 10 IoT Core with Azure IoT SDK. This multi-step process includes:

  • Configuring Azure IoT Hub
  • Registering your IoT device
  • Build and deploy Azure IoT SDK on device

Step 1: Prerequisites

You should have the following items ready before beginning the process:

Install Visual Studio 2015 and Tools

  • To create Windows IoT Core solutions, you will need to install Visual Studio 2015. You can install any edition of Visual Studio, including the free Community edition.

    Make sure to select the Universal Windows App Development Tools, the component required for writing apps Windows 10:

Step 2: Prepare your Device

  • Nothing specific.

Step 3: Build and Run the Sample

## 3.1 Connect the Device
  • Connect the board to your network using an Ethernet cable. This step is required, as the sample depends on internet access.

  • Plug the device into your computer using a micro-USB cable.

## 3.2 Build the Samples
  • Clone Azure IoT SDK repository to your machine.

  • Start a new instance of Visual Studio 2015. Open the iothub_csharp_client.sln solution (/azure-iot-sdks/csharp) from your local copy of the repository.

  • In Visual Studio, from Solution Explorer, navigate to the UWPSample(Universal Windows) project.

  • Locate the following code in the ConnectionStrings.cs file:

    public const string DeviceConnectionString = "<replace>";
    
  • Replace the above placeholder with device connection string you obtained in Step 1 and save the changes.

  • Choose the right architecture (x86 or ARM, depending on your device) and set the debugging method to "Remote Machine":

  • To deploy the binaries on your device, right-click on the UWPSample project in the Solution Explorer, select Properties and navigate to the Debug tab:

    Type in the name of your device. Make sure the "Use authentication" box is unchecked.

  • Build the solution.

## 3.3 Run and Validate the Samples
  • In Visual Studio, from Solution Explorer, right-click the UWPSample(Universal Windows) project, click Debug −> Start new instance to build and run the sample.

  • See Manage IoT Hub to learn how to observe the messages IoT Hub receives from the application.

3.3.2 Receive messages from IoT Hub

  • See Manage IoT Hub to learn how to send cloud-to-device messages to the application.