Skip to content

Code samples for the Learn module: Remotely monitor and control devices with IoT Hub. The scenario in this example is monitoring a wine cellar.

License

Notifications You must be signed in to change notification settings

MicrosoftDocs/mslearn-remotely-monitor-and-control-devices-with-iot-hub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

page_type languages products description urlFragment
sample
javascript
csharp
azure-iot-hub
This sample is the source code created in the Remotely monitor and control devices with IoT Hub Learn module. The scenario is monitoring and controlling an IoT device in a cheese cave.
remotely-monitor-and-control-devices-with-iot-hub

Remotely monitor and control devices with IoT Hub Learn module

The sample here provides the source code that is created with the Remotely monitor and control devices with IoT Hub Learn module. This module creates an Azure IoT Hub app, to monitor the temperature and humidty of a cheese cave. A device app, written in Node.js, sends telemetry to the IoT Hub, which uses device twins and direct method technologies to control the settings of the cheese cave.

Contents

File/folder Description
Device/app.js Sample Node.js source code for the device
Hub/app.js Sample Node.js source code for the back-end service
Device/Program.cs Sample C# source code for the device
Hub/Program.cs Sample C# source code for the back-end service
.gitignore Define what to ignore at commit time.
CHANGELOG.md List of changes to the sample.
CONTRIBUTING.md Guidelines for contributing to the sample.
README.md This README file.
LICENSE The license for the sample.

Prerequisites

The student of the module will need familiarity with the Azure IoT Hub portal. The code development can be done using Visual Studio, or Visual Studio Code. The code itself is written in either Node.js, or C#.

Setup

The setup is explained in the text for the module. The module does not require the student to download the code from this location, the code is listed and explained in the Learn module. The code here is a resource if the student needs it.

Running the sample

Running the sample requires that the student go through all the steps of the Learn module.

Key concepts

The sample simulates monitoring and controlling the temperature and humidity of a cheese cave. A device app communicates telemetry from a device to the IoT Hub. The sample also includes code for a back-end service app. This app is used to send desired properties to the remote device. The back-end service utilizes Azure device twins and direct methods technology to perform the synchronization.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Code samples for the Learn module: Remotely monitor and control devices with IoT Hub. The scenario in this example is monitoring a wine cellar.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published