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”

“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”

Connecting your SenseCAP sensor to The Things Network

If you are interested in measuring IoT telemetry using an ultra low power wide area sensor network solution, the Seeed SenseCAP is an viable choice.

Seeed offers a number of sensors for agriculture and industrial environments, connected to a LoRa network.

I got my hand on this TH sensor, able to read air temperature and air humidity, sending it to the nearest LoRa gateway:

Image result for sensecap TH sensor

Seeed provides a portal for thier sensors called SenseCAP Software. But other LoRa platforms are supported too.

In this blog, I show you how to connect this sensor to The Things Network LoRa backend.

Doorgaan met het lezen van “Connecting your SenseCAP sensor to The Things Network”

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.png

To the left, we see a OPC-UA server and an IoT Edge gateway. It 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”

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”

Handling relais measurements with Modbus

I recently had to measure the number of products passing a light emitting sensor. I got this Photo Electric switch E3JK-DS30M1 which has a relais to indicate if something is reflecting the infrared light it emits or not.

The schema is pretty simple:

You just attach 24V DC to the BLUE (-) and BROWN (+) wires. Then the sensor device behaves like a relais where the WHITE and BLACK wires resemble the ‘normally open’ state. The WHITE and GREY wires are used for the ‘normally closed’ state.

I tested the relais with my multimeter (set to Ohm). The relais was truly indicating objects passing by the beam of the photo electric switch.

The measuring distance can differ. My device has a range from 5 to 40 centimeters (it is adjustable with a potentiometer). But white and shiny objects reflect the beam better than dark objects. And do not hold the sensor directly into the sun, you get a lot of false readings!

I used an Advantech Wise 4012E IO module to measure the state of the relais. Let’s check out the settings.

Doorgaan met het lezen van “Handling relais measurements with Modbus”

Connecting simple devices to IoT Central

Once you start collecting data in an IoT solution, you will need some kind of dashboard to represent the raw or aggregated data.

IoT projects typically start as a POC to validate IoT scenarios. When the POC success, a pilot project is started to check scalability, monitoring, maintainability, etc.

Microsoft provides multiple solutions for these various scenarios. The most lightweight solution is IoT Central.

Experience the simplicity of SaaS for IoT (Internet of Things), with no cloud expertise required—Azure IoT Central is a fully managed global IoT SaaS (software-as-a-service) solution that makes it easy to connect, monitor, and manage your IoT assets at scale. Bring your connected products to market faster while staying focused on your customers.”

You can start with a 7-day trial or with pay-as-you-go. This last option is free if you limit yourself to 5 actual or simulated devices.

At this moment, Microsoft has examples for the Raspberry Pi, the MX Chip IoT Devkit and Windows 10 IoT Core.

But what if you want to connect your own device? Is this simple to do too?

Let’s check this out.

Doorgaan met het lezen van “Connecting simple devices to IoT Central”

A new batch of OPCPublisher direct methods

Recently, Microsoft put some real effort into updating the OPCPublisher project. This application/IoT Edge Module ingests telemetry from an OPC-UA Server.

I already wrote two blogs about it: Getting started with OPC-UA on Azure IoT Edge and Managing nodes from the cloud in the OPC-UA Publisher Edge. The seconds one showed how to connect to the OPCPublisher as an IoT Edge module using DirectMethods.

New methods have arrived, this time we get information about the module itself.

Let’s check them out.

Doorgaan met het lezen van “A new batch of OPCPublisher direct methods”

Adding offline capabilities to your IoT Edge device

Azure IoT Edge makes it possible to send messages to your IoT Hub using the extremely flexible IoT Edge runtime and modules.

The runtime also supports temporary offline capabilities in case the IoT Hub is unreachable.

Starting with runtime 1.0.5, it is possible to set a custom location (folder) in which messages are stored before they are sent to the IoTHub.

Let’s see how this turns out.

Doorgaan met het lezen van “Adding offline capabilities to your IoT Edge device”