/SenseDotnetIoT

Simple C# code to collect data readings from Raspberry Pi SenseHat temperature & humidity sensors and send to Azure IoT Hub.

Primary LanguageC#MIT LicenseMIT

SenseDotnetIoT

Simple C# code to collect data readings from Raspberry Pi SenseHat temperature & humidity sensors and send to Azure IoT Hub.

Two repos were helpful when I put this together:

This could be expanded to include other sensors on the SenseHat device, I'm only using temperature and humidity.

Instructions to get this working:

  1. Install dotnet SDK
  2. Download the repo or copy the code in the Program.cs and SenseDotnetIoT.csproj files.
  3. Navidate into the directory where Program.cs and SenseDotnetIoT.csproj files are stored on the device.
  4. Modify the connection string near the top of Program.cs to be the connection string to your Azure IoT device (create one if needed).
  5. Save the Program.cs file with the updated connection string.
  6. Run dotnet build
  7. Run dotnet run
  8. Monitor sensor data flowing into Azure IoT Hub.

I'm happy to take suggestions or improvements to this code. Thank you!