Get on board of a Flight into IoT 2 – Long-Haul – Microsoft Tech Days UK

Update: Recordings are done, it was a Blizz! Check out the recording here.

After the very successful flight Into Azure IoT from last year, a new flight will take off on November 24, 2022: A Flight into IoT 2, the Long-Haul:

We have a lot of upgrades: a new route, new telemetry, new Azure services, etc.

This is an online event with live recordings. Please register here for free.

Doorgaan met het lezen van “Get on board of a Flight into IoT 2 – Long-Haul – Microsoft Tech Days UK”

Exploring full Azure IoT Hub device support using MQTT(s) only

Most of you Azure IoT developers are connecting devices to the Azure cloud using the Azure IoT Device SDKs.

Using these SDKs, you can connect a device to the cloud in an easy and secure way with your favorite programming language like C#, C, Java, Python, or Node.js.

This is the recommended way because it offers a convenient and optimized way to support all Azure IoT Hub features like Device Twin, Direct methods, and Cloud messages. It takes away a lot of the code wiring and you can focus on functionality.

Still, in a few instances, like working with very constrained devices, there could be a need for bare MQTT support:

MQTT is the de-facto standard for stateful communication in the IoT World (btw. Bare AMQP is offered too).

Let’s see how the Azure IoT Hub supports bare MQTT.

Doorgaan met het lezen van “Exploring full Azure IoT Hub device support using MQTT(s) only”

Extending the AZ-220 Digital Twins hands-on lab with 3D visualization

Azure Digital Twins is advertised as a “platform as a service (PaaS) offering that enables the creation of twin graphs based on digital models of entire environments, which could be buildings, factories, farms, energy networks, railways, stadiums, and more—even entire cities”.

This sounds promising but it does not really ring a bell, does it?

Fortunately, besides the excellent documentation, Microsoft provides a great learning path in MS Learn as part of the AZ-220 Azure IoT developer exam preparations.

There, you will learn how Azure Digital Twins offers new opportunities for representing an Internet of Things solution via twin models, twin relations, and a runtime environment.

You finish the learning path with a hands-on lab where you build a model around a cheese factory and ingest sensor telemetry:

In the demo, the telemetry flows through the runtime and ends up in Time Series Insights.

Yes, the learning path is a good start and will prepare you for the exam or the assessment (you need to pass this assessment for a free one-year certification renewal).

On the other hand, many extra features could be added to turn this good start into a great start!

Think about propagating Azure Digital Twins events and twin property changes through the graph and visualizing live updates of twins in a 3D model, complete with alerts.

Let’s check out some of these additional features and see what you need to do to extend the ADT example.

Doorgaan met het lezen van “Extending the AZ-220 Digital Twins hands-on lab with 3D visualization”

How to cope with IoT Hub enrichment restrictions

As seen in my previous post, The IoT Hub routing feature supports message enrichment, both for IoT devices and IoT edge modules.

Using the routing message enrichments, each incoming message gets extra user properties based on either static values, device twin tags, or device twin desired properties.

Unfortunately, only ten enrichments can be added:

If you want to pass more values, this will not work for you.

It would be great if nested JSON properties would count as one.

Again, unfortunately, only simple types (string, decimal, boolean, date/time, etc.) are supported so this excludes nested JSON (complex types).

Below, a viable solution to overcome both restrictions, using Azure Stream Analytics, is presented.

Let’s see how this works out.

Doorgaan met het lezen van “How to cope with IoT Hub enrichment restrictions”

Dynamic routing of IoT Hub telemetry to Azure Data Explorer

Azure Data Explorer (ADX) is a great data exploration tool for IoT developers building a full IoT solution. This could be a perfect target for the cold path.

As seen in my previous blog post, ADX even offers a native connector for the IoT Hub. This is based on the ‘default EventHub compatible endpoint’ offered by this cloud IoT gateway (optionally the built-in Events endpoint in the routing section of the IoT Hub or using the fallback mechanism).

Most of the documentation regarding this ADX connector is following this ‘happy flow’ where one connector stores incoming IoT telemetry in one ADX table using static routing.

This is a serious limitation where most IoT Hubs ingest multiple types of messages. These will not fit into that single table.

Luckily, the connector also offers the possibility to allow routing to other databases:

Here, we will check out this dynamic routing option and see how this provides much more flexibility.

Doorgaan met het lezen van “Dynamic routing of IoT Hub telemetry to Azure Data Explorer”

Azure IoT Device lifecycle events Part 2: modules

In my previous blog post, I showed how to use the Azure IoT device lifecycle events.

These events are emitted by the Azure IoT Hub as routing events next to the regular incoming device-to-cloud messages. Routing these device lifecycle events makes it possible for both persisting and reacting at the behavior of devices (creation, deletion, connected, disconnected) and registration changes (device identity twin changes).

This was first demonstrated using a regular direct internet-connected device.

But what about Azure IoT modules?

Doorgaan met het lezen van “Azure IoT Device lifecycle events Part 2: modules”

Azure IoT Hub device query language

The Azure IoT Hub can register thousands of devices. To manage them at scale, several kinds of tooling is made available.

First, using the Device Twin of each device, devices can store extra context (type, brand, vendor, version, location, features, etc.) using the Tags section.

In the Tags section of the device twin, you are free to add a number of (sub) nodes to this JSON document section:

The tags will never be readable by the device itself, these tags are used to query all devices in your IoT Hub and make subsets.

You, both as Azure portal user or as a programmer, can query all devices for specific features.

In the Azure portal, this ability to query is most visible when you open the list of (edge) devices:

This shows a new section where we can enter a SQL-ish query starting with “SELECT FROM devices WHERE”:

Let’s dive further into this query language.

Doorgaan met het lezen van “Azure IoT Hub device query language”

Azure IoT DeviceClient SDK Python demonstration, the basics

In the past, I wrote a blog about the Azure IoT device SDK. This example was written in C#.

Last year, I noticed an increased number of questions coming from Python users trying to connect devices to the cloud. Luckily, the driving force behind this is the growing community of ML developers using Python. They are increasingly involved in IoT projects.

That’s why I scrambled some samples together into one demonstration showing the capabilities of Azure IoT Hub-connected devices.

We will see how device-to-cloud messages are sent from the device to your IoT Hub. And we will see several ways of cloud-to-device communication so we can enforce actions on the device.

Update: recently, I added a second Python script with an individual Device Provisioning Service Enrollment based on a symmetric key. The example is exactly the same, you only need to provide other variables for this provisioning.

This introduction will get you started within a moment.

Doorgaan met het lezen van “Azure IoT DeviceClient SDK Python demonstration, the basics”

Azure IoT Device lifecycle events (part 1)

The Azure IoT Hub is the main gateway for Azure IoT-related device connectivity.

It features several useful features to make your IoT developer life easy.

It offers a registry for devices so each device has its own credentials. Each device is capable to ingest device-to-cloud telemetry data into Azure and the IoT Hub also offers several ways for cloud-to-device communication (e.g. desired properties and direct methods).

The IoT Hub is also capable to report any device change event during the lifecycle of that device:

It can generate messages when a device is created or deleted. It also generated messages when the device twin is changed. It even generates a message when the ‘digital twin’ is updated.

Note: The digital twin update is related to Azure IoT Plug and Play. This is out of scope for this post. Though, an example of the digital twin change event is seen here.

In this post, we will look at the format of these messages.

Doorgaan met het lezen van “Azure IoT Device lifecycle events (part 1)”

Azure Time Series Insights introduction

Just this week, I was part of the Microsoft Tech Days: Flight into IoT event.

With a whole team of MVPs, we all explained different parts of Azure IoT using a simulation of an airplane flight from London to Budapest.

I myself talked about the pros and cons of Azure Time Series Insights:

Because I only had twenty minutes for explaining what TSI is and for demonstrating how it works, I had to skip some topics.

In this blog, I give an overview of what I demonstrated plus I add some extra goodies and in-depth information because there luckily is no time limit to this blog 🙂

Doorgaan met het lezen van “Azure Time Series Insights introduction”