Azure IoT supports cloud-to-device messaging with Direct Methods. This is an important tool when you want to control your devices real-time or if you want to execute logic on the device real-time.
In the past I have written about Direct Methods a couple of times. like this blog. I then wrote about IoT Edge supporting Direct Methods too. To be more specific, Modules in an IoT Edge support Direct Methods.
But my colleague Heindirk pointed me at a little gem unknown to me.
The same logic used to communicate from Azure cloud to a module can also be used to communicate from one module to another module without IoT Edge routes!
In the past, it was already possible to add a location to your IoT Central devices. And these locations were shown on a map. But these locations were fixed, part of the device template properties. So it was only present in the metadata.
But now we can pass a location in the telemetry which is produced by your device.
Let’s see how it’s done and how the location is integrated into the various IoT Central dashboards.
If we look at the Azure IoT Reference Architecture we see how streaming data is the heart of the IoT platform:
Data arrives at the IoT Hub and can be routed to any Azure resource using eg. the IoT Hub routing, Stream Analytics jobs and Event Hubs.
This gives us the maximum flexibility to divide the data into three major data streams or storage:
Hot path – Event, Alert, Conditions
Warm path – aggregated data, data for reporting
Cold path – the raw data, mainly untouched and available in large quantities; great for data scientists
But there is an often unseen, even ignored forth stream. And that is the stream of data for monitoring.
In my earlier blogs, I wrote several times hoe heartbeats en watchdogs can tell the story about the quality of the data. And I have shown how eg. Azure Functions and notification services can improve the insights about the quality of the communication.
Today I want to add a little gem to that list.
Let’s check out Monitoring Alerts in Event Hubs. It’s part of the overall Monitoring service in Azure.
This module makes it possible to extract data from a ‘local’ OPC-UA server and to expose this data to the Azure IoT Hub. The data is sent using the routing feature within Azure IoT Edge so before we sent the data to the cloud, we first can have an insight in the actual data, take actions locally and transform the data.
But the OPC Publisher connects to the OPC-UA server based on local settings. Here is the configuration, taken from my c:\iiot\pn.json file:
Once you are working with the Azure IoT platform, there comes a moment where you want to add notifications.
In a previous blog, we looked at how to send notifications when telemetry values did not match certain ranges. Although this is great, there are even more cases where we want notifications.
Here I am referring to watchdog functionality. When no telemetry is arriving anymore or devices are disconnected, the complete IoT platform is not working as designed. So we want to be informed when something fails.
In this blog, we will build a simple watchdog using Azure Functions.