Posting telemetry data to an IoT Hub from an Arduino device via a Blazor Service

The previous post demonstrated that all a device needs to be able do to send telemetry data to an Azure IoT Hub, is the ability to Http POST that data to a Blazor Service. In that article, the device was a Raspberry Pi running Raspian and .NET core was used to read sensors and to do the Http POST. This article demonstrates that the same functionality can be implemented on any device that can do the POST, in this case with an Arduino device.

The Mechanism

AS covered previously, there is a Blazor Service that is configured to comminucate with an IoT Hub using the Azure IoT Hub SDK. As such it has has the Azure IoT Hub connection credentials. It is able to directly submit telemetry data to the hub. Multiple devices submit the telemetry to the service as an Http POST. Whether the devices are Arduino, RPi, a bare bone CPU or a more complex device, all the device needs to be able to do besides generate telemetry data, is action an http POST of the telemetry data as a json string.

Another perspective of this is that the Blazor Service acts as an IoT Hub Edge with the devices as its peripheral devices:

Arduino to IOT Huv via Blazor

The Sketches mirror the set of .NET Core Console apps for the RPi in djaus2/SensorBlazor:

  • Simulated Sensor
  • BME280
  • DHT22

About the Sketches

These require an Arduino Uno with an inbuilt Ethernet or and Ethernet Shield. They are not implemented for WiFi, which the RPi versions can be used with. A subsequent blog will cover issues with using WiFi with an Arduino Uno.


 TopicSubtopic
<  Prev:   Blazor-IoT
This Category:Blazor
<  Prev:   Blazor-IoT