Skip to content

Latest commit

 

History

History
100 lines (70 loc) · 4.92 KB

windows-10-enterprise-premioinc-RCO-3211-c-sharp.md

File metadata and controls

100 lines (70 loc) · 4.92 KB
platform device language
Windows 10 Enterprise LTSC
RCO-3211 Rugged Edge Computer
csharp

Run a simple Csharp sample on RCO-3211 Rugged Edge Computer device running Windows 10 Enterprise LTSC


Table of Contents

Introduction

About this document

This document describes how to connect RCO-3211 Rugged Edge Computer device running Windows 10 Enterprise LTSC 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:

Step 2: Prepare your Device

  • After powering up your RCO-3211 Rugged Edge Computer device, be sure that it has established a network connection whether it is through ethernet, Wi-Fi, or cellular. For more information, please download the device's User's Manual.

Step 3: Build and Run the sample

  • Download the Azure IoT SDK and the sample programs and save them to your local repository.

  • Open a device console (command prompt or a powershell window) and change to your local SDK azure-iot-sdk-csharp directory.

  • Add the Iot Hub device connection string on your device as an environment variable:

     setx IOTHUB_DEVICE_CONN_STRING <yourDeviceConnectionString>
    
  • Run the following command to build the SDK:

     build.cmd -config Release
    
  • From the device console, run the sample using following command:

    If HTTP protocol:

      cd iothub\device\samples\DeviceClientHttpSample\bin\Debug\netcoreapp2.0
      dotnet DeviceClientHttpSample.dll
    

    If MQTT protocol:

      cd iothub\device\samples\DeviceClientMqttSample\bin\Debug\netcoreapp2.0
      dotnet DeviceClientMqttSample.dll
    

    If AMQP protocol:

      cd iothub\device\samples\DeviceClientAmqpSample\bin\Debug\netcoreapp2.0
      dotnet DeviceClientAmqpSample.dll
    
  • Use the DeviceExplorer utility to observe the messages IoT Hub receives from the Device Client Sample application.

  • Refer "Monitor device-to-cloud events" in DeviceExplorer Usage document to see the data your device is sending.

  • Refer "Send cloud-to-device messages" in DeviceExplorer Usage document for instructions on sending messages to device.

Next Steps

You have now learned how to run a sample application that collects sensor data and sends it to your IoT hub. To explore how to store, analyze and visualize the data from this application in Azure using a variety of different services, please click on the following lessons: