A technical preview for Windows 10 is available and can be used to run custom Windows Universal Applications on a Raspberry Pi! If you are anything like me (and I know I am), this is a very exciting time. So, here I'll step through how to get a “Hello, World” Windows Universal App up and running on the Raspberry Pi 2.
Prerequisites:
- Raspberry Pi 2
- PC with Windows 10 and Visual Studio 2015
Installing Windows 10 on the Raspberry Pi:
First we need to install Windows 10 on the Raspberry Pi. Fortunately, there is already a detailed set of instructions here:
https://ms-iot.github.io/content/win10/SetupRPI.htm
Once that is installed and you fire up the Raspberry Pi 2, you should see an image like this:
Admittedly, this isn't the most exciting thing in the world. However, it is about to get a lot more exciting when we run our own Windows Universal Application on it.
Creating a Windows Universal Application:
Fire up Visual Studio 2015 and create a New Project. On the New Project screen, choose “Blank App (Windows Universal)”.
(If it prompts you about source control, you can just hit Cancel.)
Then, once the new project opens, double click on the MainPage.xaml file in the Solution Explorer:
That will open up the MainPage.xaml file for editing. By default, the file will open with the design view on top and the XAML view on the bottom:
In the XAML view, put the following code within the <Grid> element:
Once it is done, it should look like this:
(You might need to scroll down a bit in the design view in order to see the “Hello, World!” text.)
Awesome, once you have that, it is time to deploy it to the Raspberry Pi 2. First, to do this, set the architecture drop down to “ARM”. (It says “x86” by default.) To the right of that will be a green play button with the words “Local Machine” and a small arrow pointing downwards. Click that arrow and set it to “Remote Machine”:
That will pop up a menu asking you where you would like to debug the application. In my case, the IP Address of my Raspberry Pi 2 is 192.168.1.8. Enter that and be sure to select an Authentication Mode of None:
Even though there is a Raspberry Pi 2 running on your network, Visual Studio 2015 might not be able to find it. (Mine at least could not detect it.) Don't despair, it does exist.
If you need help finding the IP Address of the Raspberry Pi 2, there are a couple of ways to figure that out. The easiest is the screen that comes up on the Raspberry Pi 2 contains the IP Address. Another way is to use the Windows IoT Core Watcher that comes within the Windows_IoT_Core_RPI2_BUILD.zip file that you downloaded while installing Windows 10 on your Raspberry Pi 2.
Once that is all configured, you can click on the green play button and watch your application get deployed and run on the Raspberry Pi 2!
Top Comments