Skip to content

Files

Latest commit

3944aaa · Apr 4, 2025

History

History

AzureIoTPnP

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Nov 25, 2021
Aug 4, 2023
Apr 4, 2025
Nov 25, 2021
Aug 4, 2023
Nov 13, 2023
Aug 4, 2023
Aug 4, 2023
Nov 25, 2021
Nov 25, 2021
Apr 29, 2022
Nov 25, 2021
Apr 4, 2025
Nov 25, 2021
Nov 25, 2021
Nov 25, 2021
Nov 25, 2021

🌶️🌶️ - Azure IoT Plug & Play with MQTT protocol

This sample uses the .NET nanoFramework Azure IoT Plug & Play. You can find it here: https://github.com/nanoframework/nanoFramework.Azure.Devices. You will find in the main readme the detailed information as well.

Note: the samples include the Azure IoT certificate. You can as well upload it into your device as explained in the main readme.

The sample is located here.

Testing the sample

This sample uses a specific DTDL as an example, you'll find it here. The Model ID is dtmi:com:example:Thermostat;1. This is what is going to be used in this sample.

You can use Azure IoT Explorer to run tests on the device.

When your device will connect, you'll see on the IoT Plug and Play components the Model ID. You'll have to import the model. You can download it from here and place it in a folder. Just use that folder for the source.

P&P config

Here are examples of the results.

  • Reporting the Writable Property:

Writable Property

  • Sending a command and receiving the results:

command result

Note: in the code the payload contains the parameters. In this case a simple date, we just ignore it for this sample purpose.

  • Telemetry is sent as expected and is received as well:

Telemetry

  • Reported properties will also show up. In this case, use the normal twin properties to report them.

Reported properties

Important: Method are case sensitive. Please make sure the way you call the method is the exact same way you name it in your C# code.