Turn your M5CAM into a webcam exposing RTSP stream

The ESP32 is a huge hit amongst makers. It’s both powerful and versatile and therefore a good starting point for many IoT projects and POCs.

Several spinoffs are offered where the ESP32 is combined with eg. extra connectivity (LoRa) or cameras.

These ESP32 boards with a camera are known as ESP32CAM but there are many types.

One of them is the M5CAM where an OV2640 Camera Module is mounted on the ESP32 development board:

In this blog, we look at how to turn this M5CAM device into a webcam supporting the RTSP protocol.

Doorgaan met het lezen van “Turn your M5CAM into a webcam exposing RTSP stream”

Using CrateDB on Azure IoT Edge

During the SPS IPC Drives of 2018, I was introduced to the team of CrateDB.

They offer this blazing fast database:

CrateDB is a distributed SQL database built on a NoSQL foundation. It is familiar to use, simple to scale, and versatile for handling any type of structured or unstructured data with real-time query performance.

It’s always nice being able to choose from several services like databases. So I checked out how to develop a simple application and Azure IoT Edge module against Crate if running in a container.

In this blog, we see how we can use the CrateDB in Azure IoT Edge.

Doorgaan met het lezen van “Using CrateDB on Azure IoT Edge”

Introducing The Things Network version 3 stack and portal

Since 2016, I have been involved in the world of LoraWan.

The combination of low powered devices together with long-range communication makes this protocol ideal for sending short messages from remote locations. It even supports two-way communication.

One of the most famous players in this knowledge area is The Things Network. They provide a set of open tools and a global, open network to build your next IoT application at low cost, featuring maximum security and ready to scale with LoraWan.

Its community is thriving on both enthusiastic makers, starters, and companies which are building their IoT solution on that backend.

The team behind The Things Network platform, The Things Industries, are now ramping up the third version of the backend stack.

This is not just an update. This is a completely new stack, built from the ground up and the team invests into a clean, portable, open-sourced backend. This new stack is standards-compliant by default and it will support the Lora 1.1 specification too. The V3 backend is designed for scale, for ‘N’ as they say (N customers, N regions, N devices, N versions):

We see the devices and gateways on the left, the V3 stack in the middle, and the third-party cloud integrations (eg. AWS, Azure) on the right.

In this blog, we look at registering a gateway and a device in the new TTN V3 Stack portal. And we integrate cloud connectivity.

Doorgaan met het lezen van “Introducing The Things Network version 3 stack and portal”

Access Azure API with a bearer token for impersonation

In the past, I wrote an article on how to get Azure service tags. Back then, I was not able to access the Rest API provided.

A service tag represents a group of IP address prefixes from a given Azure service.

This week I revisited the API and dived a little deeper into this call.

In this blog, I show you how to read service tags using the Azure Rest API and we learn how to cope with the bearer token if we want to access the Access API. I show it both in Postman and using C# code.

Doorgaan met het lezen van “Access Azure API with a bearer token for impersonation”

Access COM ports with Docker containers on Windows

Microsoft supports a Modbus module for Azure IoT Edge. This module handles both Modbus TCP (over the local network) and Modbus RTU (over serial ports).

In the past, I have already blogged about using serial ports on Linux with this module. But I did not check out Windows support until recently. Why? The documentation stated, “RTU is currently not available in Windows environment, please use Linux host + Linux container to play with RTU mode”.

And if something is documented in the readme, it’s true, isn’t it?

This is not entirely correct, though. It is possible to use this module on devices running Windows 10!

Let’s see how.

Doorgaan met het lezen van “Access COM ports with Docker containers on Windows”

“node-red-contrib-azure-iot-hub” considered harmful?

Node-Red is a flow-based development tool for visual programming.

It is intensely popular as a programming environment for controlling events. It’s even built in into hardware for flow-base programming and control and has a large community of proud users.

A library is available also with many nodes for al kinds of use cases. If you search for ‘azure’, three pages of nodes and flows are available.

One of them is this node-red-contrib-azure-iot-hub which is one of the most popular nodes:

This project is open-source and available on GitHub. It comes with sufficient documentation.

I used this for a small project and checked out all features. It works as documented but still, I have some doubt using it in production.

The main issue is that it mixes both the Azure IoT Device SDK and the Azure IoT server-side SDK. This makes it a “Jack of all trades, master of none”.

Let me show what I mean with some examples.

Doorgaan met het lezen van ““node-red-contrib-azure-iot-hub” considered harmful?”

Azure IoT Central bridge for The Things Network

During the last The Thing Conference back in January in Amsterdam, The Netherlands, I spoke with the team of Tektelic. I got this smart room sensor from them to experiment with:


This sensor works with Lora and has some neat features. The sensor reads eg. temperature and humidity of the room it is placed in, but it also has a few other sensors. One of these is a magnetic switch.

It’s this sensor I am interested in. I want to see if a door is left open (and maybe putting a big, loud horn next to it…):

Today, I decided to connect this module to Azure IoT Central. For this, we use the Azure IoT Central Bridge.

I already blogged about this bridge where I connected to the Partical cloud. This time, I show how to connect to The Things Network cloud:

These are the steps we have to execute when connecting:

  1. Connect the Tektelic Room sensor to The Things Network
  2. Convert the byte array with data into a JSON message
  3. Setup an IoT Central App
  4. Setup the IoT Central Bridge
  5. Modify the bridge so it can handle TTN messages
  6. Setup a TTN webhook integration to the bridge
  7. Create a Device capability model for our room sensor
  8. See the influx of telemetry in IoT Central

Yes, there are a lot of small steps to perform. But I did the heavy lifting for you so it should be easy to follow.

Let’s see how to detect if a kitchen door is left open…

Doorgaan met het lezen van “Azure IoT Central bridge for The Things Network”

Attach Blazor to Azure IoT Edge routing, showing live message feed

In the last couple of months, I have fallen in love with Blazor. I can almost shout out: “imma firin mah Blazor!”

ASP.NET Blog | Blazor now in official preview!

Blazor makes it possible to produce interactive web UIs using C# instead of JavaScript:

The Blazor Bet

Blazor is a web framework based on Asp.Net core:

Blazor apps are composed of reusable web UI components implemented using C#, HTML, and CSS

In the past, I have already shown how to deploy a Blazor app as a container using the Azure IoT Edge deployment mechanism. This makes it possible to deploy and run a Blazor app on the Edge. There is no interaction with the Azure IoT Edge routing mechanism, though.

Wouldn’t it be nice if a Blazor app could actually receive IoT Edge messages or even could send IoT Edge messages to the cloud using that same routing mechanism?

This is what we want:

tldr; yes, this can be done.

Let’s see how this you can pull this off too.

Doorgaan met het lezen van “Attach Blazor to Azure IoT Edge routing, showing live message feed”

Adding local persisted state to IoT Edge modules using Module twin

Each Azure IoT Edge module, deployed to a device, has its own Module twin.

A Module twin is the same concept as a Device twin for an Azure IoT Device, it stores state information including metadata, configurations, and conditions.

A Module twin is essentially a JSON document which lives both in the cloud (in the IoT Hub) and on the device and is kept in sync when communication between device and cloud is possible:

In the IoT Hub, the tags are writable and readable. These can be used to identify a specific device with an alternative key and/or to filter subsets of devices.

Also in the cloud, the desired properties can be written with updated values. These (updated) values (eg. properties or settings) are picked up by the device when it is connected. So it could take days or weeks for the updated desired property to be picked up because the device is offline in the meanwhile.

But the desired properties are patient…

Once the updated values of changed desired properties are arriving at a device, a notification method on the device is triggered to handle them.

As a good citizen, an IoT Edge module should report back to the cloud how it is updated by the desired properties. This is done using the reported properties in the Module twin.

This closes the loop for the administrator. I can publish a desired property change for one or more devices. And after a while, the reported properties can be checked to see which devices have picked them up and which devices need some attention.

Do you notice that it’s also possible to read reported properties, on the module side?

Write data, read data… that is enough to persist data on the edge, isn’t it?

Let’s see how we can use this for persisting local state.

Doorgaan met het lezen van “Adding local persisted state to IoT Edge modules using Module twin”