Belgische Rijksregisternummer checksum testen (Dutch)

Note: This text is written in Dutch, one of the three official Belgian languages. The code example is annotated in English.

Iedere Belgsiche inwoner heeft een rijksregister nummer. De Belgische overheid kan hiermee alle persoongegevens achterhalen van die persoon. Dit is dus een uniek nummer.

Bij ‘unieke’ nummers in het algemeen is het verstandig om deze nummers slim te kiezen. Als deze direct opvolgend zouden zijn (1, 2, 3, etc.) dan is een typefout snel gemaakt en niet direct op te merken. Daarom worden unieke nummers (zoals nummers op papiergeld of bankrekeningnummers) versterkt met bijvoorbeeld een 11-proef. Het idee is dat alleen correcte nummers dan deelbaar moeten zijn door een priemgetal, zoals elf in dit geval. Als dan toch een typefout wordt gemaakt, wordt dit direct opgemerkt. Een typefout die nog steeds uitkomt op een getal dat ook door 11 deelbaar is, is dan heel klein.

Het Belgische rijksregisternummer is echter niet zomaar een ‘willekeurig’ uniek. Het is opgebouwd uit oa. de geboortedatum.

Hoe is dan het nummer ‘beveildigd’ tegen typefouten?

Doorgaan met het lezen van “Belgische Rijksregisternummer checksum testen (Dutch)”

Deploy Azure IoT Edge deployment manifest programmatically

Azure IoT Edge is based on the concept of modules. A module is a container holding some logic executed on the edge device. These containers are actual Docker containers.

These can both be generic containers like a NodeJS that you have produced yourself, an open-source container, or a commercial container. In can also be a container supporting Azure IoT Edge module twins and the routing between modules using one of the Azure IoT Edge SDKs.

Anyway, the modules have to be deployed at one point in time.

By default, Azure IoT Edge devices are constructed with two basic modules registered, the edgeAgent (which is responsible for life-and-death of other modules) and the edgeHub (for enabling message routing between modules and the local gateway towards the cloud):

With life-or-death of other modules I mean the EdgeAgent is responsible for keeping the module configuration on the Azure IoT Edge device in sync with the registration and configuration in the IoT Hub device registration.

For this purpose, the Edge Agent is keen on receiving the so-called ‘deployment manifest‘.

Each time the configuration of an edge device registration in the IoT Hub changes, a new version of the deployment manifest is offered to the Edge Agent. It contains both the module descriptions and their configuration and a description of the message routing on the edge.

The Edge Agent then picks up the deployment manifest and checks for changes with the last manifest it received. If there are any configuration changes, or modules added or modules deleted, the edgeAgent will start the process of synchronizing the deployment.

If you check the documentation, three ways of altering the IoT Edge configuration (and thus deploying a new deployment manifest) are documented:

  1. Command Line Interface (CLI)
  2. The Azure portal
  3. Visual Studio Code

Notice these deployments are effectuated by hand.

For those seeking a CI/CD solution two other ways are offered:

  1. Azure DevOps
  2. Jenkins

These are advised if you want to automate the deployment in a CI/CD pipeline.

If you prefer to do everything by programming source code, you can deploy your manifest using REST calls.

Let’s see how that is done.

Doorgaan met het lezen van “Deploy Azure IoT Edge deployment manifest programmatically”

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”