Friday, October 9, 2015

Windows 10 IoT Core – A good choice for building IoT Gateway Device


Recently Insider preview for Windows 10 IoT Core is released, which shows that Microsoft Windows 10 IoT Core team is continuously working to bring a new OS for a specific purpose and providing a series of releases with useful updates. This version of Windows 10 supports x86/x64 and ARM based SOCs thereby providing low cost and small foot print IoT devices. As an Embedded/IoT enthusiastic/ professional, I was curious to know the special features of this version of Windows claimed with a suffix “IoT”. Interestingly I went through an Intel Gateway fact sheet where Windows 10 IoT Core is mentioned as an OS for their gateways.  So I thought to evaluate the OS from this aspect. I share my findings here.

A basic functionality of the IoT Gateway includes devices/sensors connectivity, device management, cloud connectivity, Edge or local computing and data security in various levels. 


Device Connectivity

IoT Gateway support device connectivity protocol which differs from basic connectivity protocol like a TCP/UDP etc. In addition to providing basic connectivity it should be able to connect and handle smart devices. Microsoft integrates a wonderful fast growing IoT framework called Alljoyn , currently maintained by Allseen Alliance .Microsoft is a premier member of this alliance. Of course Alljoyn has SDK for variety of OS and languages but the advantage here is, Windows 10 IoT  has adopted the Alljoyn framework as an inbuilt services and developed a set of managed Alljoyn APIs which can be accessed through Universal Windows Platform  APIs (UWP).  Alljoyn support two type of framework, One is Standard and another is thin client. The difference is, Standard has a router layer available which is opt choice to run on gateway devices. Thin client has small foot print and opt choice for small devices which has limitation on processing and memory capabilities ( For example, a micro controller based device with low memory  running on .NetMF has a support of Alljoyn Thin client), it doesn’t have a router and it is depending on a gateway device which routes to other connect devices. You can see a top level picture of device connectivity on Windows 10 IoT Core gateway.


Fig: Device Connectivity through Alljoyn


All Alljoyn compliance devices (devices running Alljoyn standard/thin client on top of it native firmware) can be connected between them through the Windows 10 IoT Core Gateway device either through Wired or Wireless.  Bluetooth LE stack, Wi-Fi are supported to connect wireless devices/sensors and also supports wired sensors through UART, I2C, SPI, GPIO and  PWM buses. In fact all the legacy OS supporting these buses through drivers but have to develop custom API set to expose it for application. Otherwise it has to use a standard stream APIs suchs as CreateFile, Open, DeviceIoControl etc. from your application which requires dedicated guidance for each OEM/device vendors for accessing these buses (It is a pain point in even earlier version of Windows Embedded OSs ) in their devices. The advantage on Windows 10 IoT Core is, all these buses can be accessed through a pre-defined managed APIs through UWP (for example Windows.Devices.I2c is a namespace for I2C bus) ). 

Device Management

Adding devices to gateway network
Device management involves on-boarding new devices, it provides a standard way to get Alljoyn compliance devices into a Wireless network (Gateway’s network). You can find the Sample application for on boarding the devices from the below github link.

Configure devices
Next step is to configure the device added in to the Gateway network. Configuration services allows you to configure certain attributes of the devices. To know more about this, see the Configuration services in Allseen Alliance. I couldn’t find a sample code for this configuration services for Windows 10 IoT Core but we have an excellent tool to generate the library code for alljoyn services using Alljoyncodegenerator.exe, by simply providing the introspection file as an input to this tool. You can find the introspection file for alljoyn configuration services in the below link.
Copy the content and save it as an org.alljoyn.Config.xml and provide this file as an input to the alljoyncodegenerator.exe command. See the link to know more information about alljoyn code generator tool.

Alternatively, Alljoyn code generator tool is now an add-in for visual studio which make your work more simple. you can see the below channel 9 msdn post for more details.

In addition to that we have alljoyn support notification services which allows text-based notifications to be sent and received by devices on the AllJoyn network and a control panel services which allows devices to advertise a virtual control panel to be controlled remotely.

Support for Legacy devices
Okay. We can connect and manage the devices which are compliance with Alljoyn framework. How about connecting the existing devices which is already adopting legacy protocols?  To address these challenges and broaden the reach of AllJoyn, Microsoft developed the concept of a Device System Bridge (henceforth DSB). The DSB enables non-AllJoyn devices to be included in the AllJoyn ecosystem.  You can find the white paper related to Alljoyn DSB here. Microsoft provided DSB samples for Zwave Adapters, BACNet Adapters and a Mock Adapaters. You can find the samples of the Alljoyn DSB in the github here.


Fig: Connecting Legacy Devices through Alljoyn DSB

Cloud Connectivity

Microsoft Azure show cases an end to end dedicated service for IoT such us service bus, event hub and recently Azure IoT suite is released which includes a special service called IoThub. We can access these services through HTTP/s, AMQP/s protocols. In fact, the IoT hub can be accessed through MQTT protocol, where legacy devices are using this. Azure SDKs are available for accessing these services from Windows 10 IoT Core. Azure also covers services like stream analysis for real data analytics (collected through the above services from the gateway/ sensors Devices) and Machine Learning based on predictive analysis. Okay, Let’s stop here on IoT cloud services because that the topic to discuss separately. Here is the SDK links.
Nuget package for Services Bus & Event hub SDK that can work for Windows 10 IoT Core - https://www.nuget.org/packages/AzureSBLite/ .This is  developed by fellow Windows Embedded MVP Paolo Patierno.
Azure IoT Hub SDK - https://github.com/Azure/azure-iot-sdks/blob/master/csharp/readme.md 
Also I have done a demo project for accessing Eventhubs from Windows 10 IoT Core. Here is the link - Windows 10 IoT Core on Raspberry Pi 2 – Adafruit Sensor data to Event Hubs

Local/Edge Computing

Gateway should have a capability of performing edge/local computation on the data collected from sensors for decision making, filtering the data to be pushed to cloud etc. Windows 10 IoT Core application development is based on Universal Windows Platform application which allows you to develop variety of head/headless application. The advantage of UWP is you can re-use the same application in all version of Windows 10 covering from PC, mobile to devices like gateways etc.  Some useful links related to UWP apps.

Security

Security can be provided at various level in the gateway. Device connectivity/ Management required security which is provided by Alljoyn Framework. See the below link to know more about security provided by the Alljoyn framework.

Cloud Connectivity requires security features which is supported by Microsoft Azure while accessing the cloud from the Gateway. You can information about Azure IoThub security here.

Windows 10 IoT provides certified application installation. Windows IoT Team is committed to provide Enterprises grade security for IoT devices, Soon you will see secured Boot and Bitlocker encryption in the IoT builds. Please refer the blog “What’s next for Windows 10 IoT Core” for future updates.

 Bottom Line

 Hope I have provided an insight about the capabilities of Windows 10 IoT Core and why it can be a good choice for building the IoT Gateway devices. But still Windows 10 IoT Core is under development and at present it supports the limited number of SOCs like Raspberry Pi 2 and Minnowboard Max. We can expect more SOCs support for Windows 10 IoT Core in near future hopefully.

2 comments:

Unknown said...

How does Microsoft define the internet of things (IoT)?

Vinoth said...

Please refer this page for details. you can visit this page for cloud based solutions
http://www.microsoft.com/en-in/server-cloud/internet-of-things/overview.aspx
This is for windows On devices.
https://dev.windows.com/en-us/iot