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!
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:
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.
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.
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.”
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!