November 2, 2015 // By Eric Anderson
Over the past few years a new trend has been the emergence of small single board computers that serve as the basis for electronics projects ranging from the hacker space all the way up to the commercial sphere. One of the most popular boards for these purposes are the Arduino boards which contain a micro-controller, small amounts of random access memory and headers to be used as electronics interfaces. As the years have gone on, prices have come down and more powerful single board computers have become available in the consumer price range. One of these boards is called the Raspberry PI. While there are certainly other boards of comparable capabilities to the PI, this one has seemingly become the most popular.
In my personal opinion, what really sets these moderately powerful boards apart is the ability to run full operating systems on them and use them for functions that are typically not associated with electronics. Examples include PLEX media servers, file servers, web servers, amateur weather balloons, etc. Up until recently the only option for running an operating system on one of these boards was a Linux flavor. With the release of Windows 10, Microsoft has now released a POSIX based operating system called Windows IoT. Presently this is able to run on the Raspberry PI and the MinnowBoard Max. This brings the capability of running applications developed using Visual Studio via universal applications.
The following is a very simple guide for deploying a Windows IoT core application that runs on a Rasberry PI and talks via WCF using NetTcpBinding to another computer. I was originally hoping to develop a sample application in which the PI acts as a server using WCF but I found out that the API's presently do not include ServiceHost capability.
The Rasberry PI package I chose to purchase is the CanaKit presently available from Amazon for $69.99. The package includes the following components:
Per description from Amazon.com:
- Includes New Raspberry Pi 2 (RPi2) Model B Quad-Core 900 MHz 1 GB RAM
- 8 GB Micro SD Card (Class 10) - Raspberry Pi Recommended Micro SD Card pre-loaded with NOOBS
- CanaKit WiFi Adapter 150 Mbps - Supports Access Point Mode (AP) to allow for WiFi Hotspot hosting
- CanaKit 2.5A USB Power Supply with Micro USB Cable and Noise Filter - Specially designed for the Raspberry Pi 2 (UL Listed)
- High Quality Raspberry Pi 2 Case, Premium Quality HDMI Cable, Heat Sink, GPIO Quick Reference Card, CanaKit Full Color Quick-Start Guide
I specifically chose this kit because of the included WiFi adapter. Unfortunately the default implementation of Windows IoT does not recognize this specific WiFi adapter.
Assembly took approximately 10 minutes. For installing Windows IoT core I followed the directions located at https://ms-iot.github.io/content/en-US/win10/SetupRPI.htm. Setup was extremely simple and Windows IoT loaded with no problems with the exception of the failure to recognize WiFi adapter.
Once that was complete I followed the directions located at https://ms-iot.github.io/content/en-US/win10/samples/HelloWorld.htm while adding my own code for the WCF communications. The layout of the code is as follows:
I have a contracts project that is serving as a housing container for my WCF contracts. This project is referenced by the server side console application as well as the Windows Universal IoT client side application. The project is a portable class library targeting .Net Framework 4 and Windows 8. The contract is a straight forward contract and looks like the following:
The service is hosted in a .NET 4.5 console application and looks like the following:
Notice that instead of using a more typical BasicHttpBinding, I used a NetTcpBinding. I used it simply because I like it and I was curious if I could use it in Windows IoT. As you can see from the code below, it is possible. The Windows IoT client side code looks like the following:
While extremely simplistic the coding example above is working and it gave me a good start with developing Windows IoT Core applications in C# and XAML. It is interesting to note that deployment of this code example did take several seconds each time. The purpose of this project was simply to introduce myself to the new abilities Microsoft has created for deploying code to IoT devices. Some of the pros that I see from this are as follows:
- I am able to deploy code written in C# using Visual Studio 2015. Being a .NET developer this is a significant win for me.
- The Windows IoT Core platform is relatively simple to install.
- Remote management as described at https://www.hackster.io/windowsiot/powershell-to-connect-to-a-machine-running-windows-10-16a479 seems to work extremely well. This is functionality that I've longed for since college when I was working with SSH and Linux. According to https://ms-iot.github.io/content/en-US/win10/samples/SSH.htm, I should be able to SSH to my device as well, although I haven't tried that yet.
Some of the cons I see are as follows:
- Compared to Rasbian, it seems like Windows IoT is extremely simplistic. This is probably fine in instances in which the device is being used as an electronics interface.
- Right now Windows IoT only supports a small number of one WiFi device for the Rasberry PI and five WiFi devices for the MinnowBoard Max. These are listed here: https://ms-iot.github.io/content/en-US/win10/SetupWiFi.htm
- Rasbian has a very rich community. Right now this appears to not be the case for Windows IoT. That may yet change.
If you’d like to contact Magenic directly, email us or call us at 877-277-1044.