Subscribe your IoTHub to EventGrid as event source

Azure has all sorts of Publisher/Subscriber resources available to allow sending and receiving messages (events) within Azure. Think of the Service Bus, EventHub, Storage Queue, Stream Analytics, Azure Functions, etc.

At some point, Microsoft realized that a more formal way of the eventing abilities of these resources was needed.

This let to the introduction of the EventGrid, one overall solution to send and receive messages. Azure Event Grid relatively new.

The Azure Event Grid allows you to easily build applications with event-based architectures

The Azure resources are divided into two groups:

  • Event sources. Resources which produce events (or pass-through events)
  • Event handlers. Resources which are able to pick up events and do something with them

These resources all come together in the Event Grid.

Event Grid model of sources and handlers

The Azure IoT Hub can act like an Event Source too. The events exposed are:

Let’s see how we can put this to use.

Doorgaan met het lezen van “Subscribe your IoTHub to EventGrid as event source”

Using OPC-Twin for OPC-UA discovery and sending back commands

In the past, I have written multiple blogs about implementing OPC-UA on IoT Edge.

Until now I have written about collecting OPC-UA values and sending them to the cloud using the OPC Publisher.

But this OPC Publisher is actually just a small part of what Microsoft is actually offering regarding OPC-UA.

Microsoft has a team in both Redmond (USA) and Munich (Germany) working on Industrial IoT. Everything they produce is open source. You can find thier work on github.

With the OPC Twin, they also make it possible to discover, register and manage your Industrial Assets with Azure IoT and most of it can be done zero-touch.

Look at this diagram covering OPC-AU on Azure:

architecture

To the left, we see a OPC-UA server and an IoT Edge gateway. This is ‘living’ on the factory network. In the middle we see the Azure IoT Hub acting as cloud gateway and to the right, we see the OPC-UA backend which is provided by the IIoT team.

Of course, all of this is open source. And out of the box, a lot is already working.

OPC-UA, the full round trip

In this blog, I want to show how we can discover OPC-UA servers, update the OPC Publisher to read new nodes (exposed by the discovered servers) and I want to send commands back to the OPC-UA servers.

Doorgaan met het lezen van “Using OPC-Twin for OPC-UA discovery and sending back commands”

Alternatives for the default IoT Edge VM based on Ubuntu 16.04

In a recent blog, I showed how to set up an Azure IoT Edge Virtual Machine. These VMs are great for testing your IoT platform with ‘actual’ gateways.

This default, recommended, Azure VM is based on 16.04 LTS version of Ubuntu:

This is still a great solution but just this month, Microsoft announced .Net Core 3.1. This is the next long-term supported (LTS) release.

The current IoT Edge is based on .Net Core 2.1, the current LTS version. That’s why sourcecode, specifically written in .Net Core 2.2, was not able to be used in the Module templates.

So it’s safe to assume, that in the near future IoT Edge will have an upgrade towards .Net Core 3.1.

The release blog came with this little note with a rather big impact:

Note: Please ensure that .NET Core 3.1 ARM64 deployments use Linux kernel 4.14 version or later. For example, Ubuntu 18.04 satisfies this requirement, but 16.04 does not.

So the current VM will not last very long anymore. You will need a new VM template, based on eg. Ubuntu 18.04.

Note: current IoT Edge Gateways rolled out with the Ubuntu 16.04 OS in test, acceptance or even production situations have te be upgraded soon to before the IoT Edge Runtime can be upgraded. So check the operating systems that come with the Industrial PCs you buy from your hardware vendor.

Let’s see how to start with Ubuntu 18.04 LTS on a VM.

Doorgaan met het lezen van “Alternatives for the default IoT Edge VM based on Ubuntu 16.04”

Uploading an image to Azure Blob storage

Adding an image to the Azure Blob storage is a basic skill for developers. But working with images is not something developers do on a regular basis.

If you are using hardware independent code, .Net Core does not make it any simpler, a lot of the examples found on the internet are written for the regular .Net framework.

Image handling was bound to a lot of OS related features. But Microsoft had to learn .Net Core some GDI tricks.

Here is a simple example of how to construct and send images, created in memory, to Azure Blob storage.

Doorgaan met het lezen van “Uploading an image to Azure Blob storage”

Sending telemetry from IoT Edge to IoT Central

After writing my last post, I kept thinking about sending messages to the Azure IoT Central Bridge from Azure IoT Edge.

Eventually, I started building this IoT Edge module which passes incoming route messages to the IoT Central Bridge of your choice.

This module is now available in Docker Hub.

Use it in your IoT device with tag:

svelde/iot-edge-ic-bridge:1.1.0-amd64

Let’s check this module out.

Doorgaan met het lezen van “Sending telemetry from IoT Edge to IoT Central”

Bridging the gap from third party cloud to IoT Central

A few years ago I blogged about my open source project which makes it possible to connect The Things Network LoraWan cloud to Azure. It runs as a Webjob and provides a stateful bi-directional communication channel so devices from the third party (TTN) cloud are automatically registered in your IoTHub, can communicate their messages to the Azure cloud and they can receive commands back.

Recently Microsoft announced their generic bridge between third party IoT clouds for IoT Central. It is called: IoT Central Device Bridge.

Basically, it supports all cloud services which are able to send device telemetry to a REST endpoint.

Let’s check out how it works.

Doorgaan met het lezen van “Bridging the gap from third party cloud to IoT Central”