Raspberry Pi 2 - Windows 10 IoT - Getting Started

Unfortunately Windows 10 IoT only works on the Raspberry Pi 2 (which is ARM7). It will not work on the “original” Raspberry Pi models (as these are ARM11).

I bought a Rasbperry Pi 2, case, 8GB micro SD cardand power cable (standard Micro USB lead – commonly used for phone chargers) from amazon. Amazingly, the price of this came to about £38.

Windows 10

To write programs/deploy to Windows 10 IoT onthe Raspberry Pi 2 you’ll need a Windows 10 Machine – it’s currently a free upgrade, what are you waiting for?

Last, but not least, you’ll need to make sure your Windows 10 install is in “Developer Mode”. To do this, press the “windows key” and choose Settings>Update & Security>For Developers and click “Developer Mode”:

Go to Settings, choose Update and security and then choose For developers to view your options

Visual Studio 2015

You’ll also need a copy of Visual Studio 2015. If you have an MSDN subscription then head over there and get it downloaded (if you’ve not got it already). Make sure to do a custom install and choose “Universal Windows App Development Tools -> Tools and Windows SDK“. If you don’t, well Microsoft have provided a free “full featured” Visual Studio experience using the Visual Studio Community Edition– get that!

For Windows 10 IoT background applications, which run in headless mode, among other project templates, download and Install Windows 10 IoT Core Project Templates to get these in the New Project window in Visual Studio.

To get Windows 10 IoT installed on your Raspberry Pi 2 you should follow the steps on the official Microsoft website. I could re-hash them, however, there’s loads of great screen grabs and it’s really detailed – head over here then come back!!

Now that you’ve got Window 10 IoT running – you’ll hopefully see the IP address on screen. I didn’t have the screen connected, so logged onto my router to find it.

Running an App

We’re now going to get a simple Windows “Universal” App running on Windows 10 IoT.

Start a new project in Visual Studio like so…

Create Windows 10 IoT Universal App

Once the project has loaded, we’re going to modify the main page to show a simple message to prove we’ve deployed our app.

Add this line into the grid in MainPage.xaml so the grid looks like this:

Hello from my first App

Now, we can run the app locally on our machine. But, we’re not interested in that.
So change the Visual Studio build processor architecture to ARM (the Raspberry Pi 2 processor architecture). Now, where the “Debug” button says Device, choose the drop down and select “Remote Machine”.

You’ll be presented with this screen.

Connecting to Windows 10 IoT Remote Machine auto detected

You should see you Raspberry Pi 2 device in the “Auto Detected” section of the screen. I’ve not renamed my device, so I’m seeing minwinpc.

If you can’t see your device, make sure its plugged in etc, make sure you have the correct IP address for it, also try pinging it (using cmd). If you’re getting a response from the ping then you can add your device to the screen above manually.

Just type the ip address in the Address field and set the Authentication *field to *None. And hit Select.

Connecting to Windows 10 IoT Remote Machine - manual configuration

After a short break while it builds and deploys you should see performancestats about the app in the diagnostics view.

If you have your device plugged in (via HDMI) to a screen, you should see this…

A working Universal App on Windows 10 IoT

And there we have it, universal apps in .Net on a Windows 10 IoT device. If you’re developing an application, make sure you keep an eye on this page to see if there’s any APIs that haven’t yet been implemented.

In later posts we’ll try and get a web server runningand connect to GPIO pins.

ryansouthgate

Software developer, living in Coventry, loves .Net, JavaScript and learning new languages.

Coventry