.NET Internet of Things Melissa Houghton melissahoughton.dev melissahoughton melissahoughton meliss_houghton

About Me Lead Software Engineer Developer Technologies melissahoughton.dev melissahoughton melissahoughton meliss_houghton

What is IoT? @meliss_houghton

How can you use .NET for IoT @meliss_houghton

Libraries System.Device.Gpio Hardware Platform Device Bindings Core APIs .NET IoT Libraries • Analog Converters • Digital Logic • Display Controller • • • ADC CAN GPIO • • • Tooling • I/O Expanders • Sensors • LED Drivers • Memory • Motor Drivers • Real Time Clocks Futures • I2C PWM SPI System.Device.* Windows 10 IoT / Linux • • X86 X64 • • ARM32 ARM64 • • BeagleBone Black Custom Hardware Maker Boards • • Raspberry Pi HummingBoard @meliss_houghton • CLI • Docker • Templates • Testing

System.Device.Gpio Protocols Including: • General-purpose I/O (GPIO) • Inter-Integrated Circuit (I2C) • Serial Peripheral Interface (SPI) • Pulse Width Modulation (PWM) • Serial port @meliss_houghton

Iot.Device.Bindings https://github.com/dotnet/iot/tree/main/src/devices @meliss_houghton

@meliss_houghton

Tools @meliss_houghton

Deployment @meliss_houghton

Framework-dependent

Install .NET on the device curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin —channel Current # Publish the app with Deployment mode = Framework-dependent and Target runtime = Portable dotnet publish # Copy the files from the computer to the device scp -r /publish-location/* pi@raspberrypi:/home/pi/deployment-location/ # Run the app on the device dotnet HelloWorld.dll

Self-contained

Publish the app with Deployment mode = Self-contained and Target runtime = linux-arm dotnet publish -r linux-arm # Copy the files from the computer to the device scp -r /publish-location/* pi@raspberrypi:/home/pi/deployment-location/ # Run the app on the device chmod +x HelloWorld

./HelloWorld @meliss_houghton

Debugging @meliss_houghton

@meliss_houghton

.NET nanoFramework @meliss_houghton

@meliss_houghton

.NET IoT nanoFramework Powerful boards Low-level microcontrollers All .NET core libraries Specific .NET libraries Iot.Device.Bindings and System.Device.Gpio Specific packages per sensor Manual deployment setup Remote debugging experience Manual remote debugging Deploy the code via SSH connection Built-in deployment Deploy via wired connection @meliss_houghton

Meadow @meliss_houghton

Why use Meadow • Enterprise IoT • Full .NET on embeddable microcontrollers • Plug and Play IoT Library • Focused on Security • Cloud agnostic @meliss_houghton

using Meadow; Program.cs using Meadow; using Meadow.Devices; using System.Threading; using Meadow.Foundation.Leds; namespace HelloMeadow namespace HelloMeadow { { MeadowApp.cs class Program public class MeadowApp : App<F7Micro, MeadowApp> { { static IApp app; public MeadowApp() public static void Main(string[] args) { { var pwmLed = new PwmLed( // instantiate & run new meadow app Device, Device.Pins.D13, TypicalForwardVoltage.Blue); app = new MeadowApp(); // pulse the LED Thread.Sleep(Timeout.Infinite); pwmLed.StartPulse(); } } } } } } @meliss_houghton

Azure IoT SDK for .NET https://github.com/Azure/azure-iot-sdk-csharp @meliss_houghton

Azure IoT Hub // Create device client // And connect to IoT Hub using MQTT protocol DeviceClient deviceClient = DeviceClient.Create( iotHubHostName, deviceAuthentication, TransportType.Mqtt); … // Send the telemetry message. await deviceClient.SendEventAsync(message); @meliss_houghton

Time Series Insights @meliss_houghton

Digital Twins

@meliss_houghton

AI/ML for IoT with .NET @meliss_houghton

ML.NET @meliss_houghton

Azure Cognitive Services @meliss_houghton

Azure Video Analyser @meliss_houghton

How to get started @meliss_houghton

@meliss_houghton

Thanks for joining! https://bit.ly/dotnetconf-iot melissahoughton.dev melissahoughton meliss_houghton melissahoughton