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.
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.
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…):
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:
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.
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.
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.
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.