SendTelemetry2Hub 0.9.3

dotnet add package SendTelemetry2Hub --version 0.9.3                
NuGet\Install-Package SendTelemetry2Hub -Version 0.9.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SendTelemetry2Hub" Version="0.9.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SendTelemetry2Hub --version 0.9.3                
#r "nuget: SendTelemetry2Hub, 0.9.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SendTelemetry2Hub as a Cake Addin
#addin nuget:?package=SendTelemetry2Hub&version=0.9.3

// Install SendTelemetry2Hub as a Cake Tool
#tool nuget:?package=SendTelemetry2Hub&version=0.9.3                

SendTelemetry2Hub

Send Telemetry to an Azure IoT Hub. Simple to include functionality in a Console app.

Include in a .NET project

dotnet add package SendTelemetry2Hub

Call

using SendTelemetry;

    ...
    ...

    await DeviceSendTelemetryToHub.SendDeviceToCloudMessageAsync(telemetryData, connectionString);

Parameters

  • telemetryData of type dynamic eg:
    double currentTemperature = minTemperature + rand.NextDouble() * 15;
    double currentHumidity = minHumidity + rand.NextDouble() * 20;

    // Create JSON message
    var telemetryData = new
    {
        temperature = currentTemperature,
        humidity = currentHumidity
    };

  • connectionString of type string
    • The Azure IoT Hub Device Connection string

Further

See the code repository for sample Console app where it is part of a Triggercmd app for Google Nest.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SendTelemetry2Hub:

Package Downloads
DNETCoreGPIO

Implements the various GPIO functionality .NET on a RPi such as LED, temperature sensor, realy and motor H-Bridge

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.9.3 465 3/28/2022
0.9.2 413 3/27/2022
0.9.1 895 3/25/2022
0.9.0 401 3/25/2022

Added try catch to code.