With an IoT Device sending Telemetry to an IoT Hub there are tools that can monitor the system and message it. Also apps can be used to so do.

Console Apps

These are been mentioned in previous posts and elaborated upon in posts that are relevant. There are APIs in Nuget that enable .NET interactions with an IoT System. Other programming platforms are available. There are 4 .NET (6) Console apps here for interacting with the IoT Hub and Device

  • Monitor Device to Cloud Telemetry Messages _(as previous)
  • Cloud to Device Messaging
  • Invoke Direct Method
  • Device Twin Properties

To use these use get-iothub to create an IoT HUb and Device, if not already. Then …

  • Option 6. –> Option 2.
  • When done, Option 6. –> 7.
    • set-env.ps1
  • Then Option 6. –> 8.
    • launchSettings.json
    • For both no need to regenerate. Place in Root (That’s the root of the get-iothub)
  • Replace setenv.ps1 in the root of a project
    • When run standalone run this is the shell first
  • Replace launchSettings.json in the Properties folder.
    • Used when run in Visual Studio

These filescripts contain all (and more) of the connection strings required for various contexts.

Azure IoT Explorer

  • Can monitor Telemetry.
  • Can send Cloud to Device Messages. (See Messaging post).
  • Can also make Method calls. (See Direct Methods post)
  • And Device Twinning can be enacted (See Device Twins post)
  • Install the most recent version of Azure IoT Explorer.
  • More instructions on its usage can be found here

Monitoring Telemetry.

Nb The base device functionality so far discussed does not implement the advanced features, See the subsequent blogs posts in thiis series.

In VS Code

Besides Telemetry monitoring, you can also send CD Messages, action Direct Methods and do Device Twinining.

Telemetry:

  • In VS Code, open a terminal and do az login
  • Add the Azure IoT Hub Extension
    • From the Extension Tab enter Azure IoT Hub
    • Select Azure IoT Hub and install.
    • Ignore message about Azure IT Tools extension pack.
  • In the Explorer on left expand Azure IoT Hub
    • Click on dots on right and choose Select IoT Hub
    • You need to select the Subscription _(in middle at top)
    • You may be prompted for connefction details
    • Then select the Hub
  • Back in the Explorer pane expand the Hub
    • Expand devices and select the device
  • Right click on that and select “Start Monitoring Built-In Endpoint”
  • You should now see Telemetry in VS Code:

Sample Telemetry output

Subscription selected: Visual Studio Ultimate with MSDN
IoT Hub selected: Pico137Hub
[IoTHubMonitor] Start monitoring message arrived in built-in endpoint for device [Pico137Dev] ...
[IoTHubMonitor] Created partition receiver [0] for consumerGroup [$Default]
[IoTHubMonitor] Created partition receiver [1] for consumerGroup [$Default]
[IoTHubMonitor] Created partition receiver [2] for consumerGroup [$Default]
[IoTHubMonitor] Created partition receiver [3] for consumerGroup [$Default]
[IoTHubMonitor] [10:53:03 PM] Message received from [Pico137Dev]:
{
  "msgCount": 0
}
[IoTHubMonitor] [10:53:06 PM] Message received from [Pico137Dev]:
{
  "msgCount": 1
}
[IoTHubMonitor] [10:53:08 PM] Message received from [Pico137Dev]:
{
  "msgCount": 2
}
[IoTHubMonitor] [10:53:10 PM] Message received from [Pico137Dev]:
{
  "msgCount": 3
}

 TopicSubtopic
<  Prev:   Jekyll
   
 This Category Links 
Category:Pico W AzSDK Index:Pico W AzSDK
  Next: > RPI-Pico-Arduino-AzSDK
<  Prev:   RPI-Pico-Arduino-AzSDK