Reading Temperature and Humidity from a RPI and DHT22 Sensor in C#

I recently found out that DotNet and the Microsoft ecosystem for C# had builds for arm architecture, which meant I could run Dotnet and C# programs in a Raspberry Pi.  I found this very interesting so I decided to go with it.


The repo with code and explanation you can find in the button below

I had to recreate a driver that read from the sensor in C, and then run it as a background task on the C# application. The code is relatively clear and of course I separated the test suites to both run in the RPI as well as in the rest of the CI.


Parameters can be found in the appsettings.dist, and the .env.dist file is used by the docker compose to create a blank database where to find the information.


You can find the Final URL that displays the sensor information for the DHT22 sensor in the following link. The angular frontend is built with Ionic Framework and connects to the Raspberry Pi via an nginx reverse proxy (to preserve the https secure connection) in the local network.


And of course, all of the CI/CD is built in using a local Team City server.