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”

Distributing IoTHub credentials using TPM

I bet, most of the time you have seen Azure IoT demos or most of the time you have programmed an IoT Uwp app yourself, you hard coded device credentials for the IoT hub. Yes, I’m guilty too ūüôā

And this is, of course, a bad practice.

Not only, there is a risk these¬†credentials are shared by checking them in into your version control system¬†(like public Git). But it’s also inconvenient because, for each device running that production code, you will have to alter the credentials in the code and deploy again.

We could use configuration files. But this is still worthless in perspective of distribution.

We would like to pass the credentials to known devices separately, apart from the applications. We want to use a second channel. And this is possible with the current Windows IoT Core infrastructure.

All we need is a TPM. This is a Trusted Platform Module:

Trusted Platform Module (TPM) is an international standard for a secure cryptoprocessor, which is a dedicated microcontroller designed to secure hardware by integrating cryptographic keys into devices. TPM’s technical specification was written by a computer industry consortium called Trusted Computing Group (TCG). International Organization for Standardization (ISO) and International Electrotechnical Commission (IEC) standardized the specification as ISO/IEC 11889 in 2009.[1]

Why do we need it? Microsoft provides a separate mechanism to write credentials into the module which acts like a vault.

In this example, we will look at Windows 10 Core running on a Raspberry Pi. And we will use IoT Hub device credentials stored in a TPM.

Doorgaan met het lezen van “Distributing IoTHub credentials using TPM”

Turn your Raspberry Pi into a Personal Assistant using Cortana

Microsoft is constantly updating its¬†latest version of Windows, version 10. For me, as a developer, it’s a wonderful operating system to program for. The UWP apps I build, run on both PC’s, laptops, Windows Surface Hub (up to 84 inches), The Xbox One and even on a Raspberry Pi. Yes, Windows 10 is running on a 35 dollar device.

But before you run to the store to replace your PC, I have to tell you it’s running the core of Windows 10, actually. There is no shell (no menu, no start bar etc.).

So this means you can run one visual (headed) UWP application and multiple background applications. And yes, you will love it!

This is a great interface for kiosk-like devices. And with the latest update (build 15063), it’s easy to add¬†Cortana support.

Cortana is the speech service, available in Windows 10. If you know Siri or Alexa, then you know Cortana. Just ask her a question and she will try to answer it. The answer will be provided by speech or supported by browsers or other visual help.

Let’s take a look on how to enable Cortana on a Raspberry Pi.

Doorgaan met het lezen van “Turn your Raspberry Pi into a Personal Assistant using Cortana”

Bulk import of IoTHub devices

This blog post is for hardcore IoTHub users. It’s even a bit boring, at first.

The Azure IoTHub does not accept anonymous telemetry. Telemetry has to be presented by devices that are enabled. So you need to have a list of all your devices. You have to manage it.

In this post, we start diving into registering a single device and we will end updating multiple devices in bulk.

Doorgaan met het lezen van “Bulk import of IoTHub devices”

Closing the Windows IoT Core feedback loop using Azure Functions

Windows IoT Core is my preferred solution for the proof of concepts I build. The IoT stack is both easy and powerful and it’s a good choice to build real world solutions on too.

Getting telemetry in the Cloud using Microsoft Azure IoT Hub is easy also. And in my previous blog, I showed that adding live charts for BI only takes a couple of minutes.

There is one other thing that is very typical to IoT Hub. And that is sending commands back to devices. I use Azure Functions for that purpose.

In this blog, I will show you how to make use of this new, cheap and handy feature in Azure.

Update: Azure Functions is still in preview. I fixed some blocking issues in this blog due to current changes in this Azure resource (and this is a good thing).

Doorgaan met het lezen van “Closing the Windows IoT Core feedback loop using Azure Functions”

Adding the power of BI to your IoT Hub

Once you are using Azure an IoT Hub, you are looking for ways to do something meaningful with the telemetry coming in.

You can try to build your own dashboards in a website eg. but you can also try to show the data using PowerBI.

In this blog, we will look at how to show some nice charts with live data.

Doorgaan met het lezen van “Adding the power of BI to your IoT Hub”

Passing data between Windows 10 IoT Core headed and headless apps

As shown in my last blog, Windows 10 IoT Core supports headed and headless apps. I can run only one headed (UWP) app at a time but running multiple headless apps is possible too.

But how do I deploy these apps? And can I pass information between apps while running?

In this blog, we dive deeper into the unseen world of background application.

Doorgaan met het lezen van “Passing data between Windows 10 IoT Core headed and headless apps”

Building a Windows 10 IoT Core background webserver

The RaspberryPi is running the core of Windows 10. This means that everything, not needed for running one app at a time, is left out of Windows 10. And with one app I mean, one visual app.

Until now I have always build a Windows UWP app to run something on the RaspberryPi.  And the fact it has a form which can represent visual elements in XAML, it gives away that it is a visual app. These kind of apps are running in headed mode.

But running one visual app, taking the whole screen occupied in headed mode, does not prevent the OS from running multiple background processes in headless mode.

Today we will build our first simple web server on the Raspberry Pi running Windows 10 IoT Core.

Doorgaan met het lezen van “Building a Windows 10 IoT Core background webserver”

Reading IBeacons using a UWP app on your Raspberry Pi

As you probably know, Bluetooth low energy (BT LE)  is a wireless personal area network technology which uses a minimum of power to broadcast messages to receivers nearby.

Bluetooth LE is a common standard but it is most popular under the name of IBeacons. IBeacons is a protocol coming from Apple, so it is just a class of Bluetooth low energy (LE) devices that broadcast their identifier to nearby portable electronic devices.

IBeacons can basically exchange two parts of data: that unique identifier and the signal strength. This makes it possible to figure out the (fixed) position of the IBeacon. And if you receive the signals of multiple beacons you can triangulate your own position between them.

In 2015 Google launched a competing, but similar, beacon standard called Eddystone. It has a richer functionality because it can exchange more information.

Far less known is that Windows 10 also supports the beacon technology, it’s not just Apple¬†and Android which are having fun with it. In Windows, there is¬†this¬†Windows.Devices.Bluetooth.Advertisement¬†library:
“It allows apps to send and receive Bluetooth Low Energy (LE) advertisements.”

Doorgaan met het lezen van “Reading IBeacons using a UWP app on your Raspberry Pi”

Control your Arduino Rover using Firmata and Xbox One Controller

A few month ago I bought a little rover (controlled by an Arduino Uno) for a very good price. The kit was very complete: Car chassis, 2 Car Wheels, 2 DC Gear Motors, a UNO R3, an L298N Dual H-Bridge Motor Controller and several other components.

This rover is meant to be programmed for autonomous operation. Hence an ultrasonic sensor and a servo is also added in the kit. Also a nice Arduino sensor shield 5 is in the kit. Yes, it was a real bargain ūüėČ

But my idea was to use both an Xbox One Controller and the Firmata protocol to drive this one by myself or one of my sons. And it works very well!

Here is a video of the final solution:

In this blog, I will show you how it’s done.

Doorgaan met het lezen van “Control your Arduino Rover using Firmata and Xbox One Controller”