Internet of Things Maker News
Tips and Tricks: Using Windows 10 IoT Core for Raspberry Pi 2

B15

Microsoft has officially opened access Windows 10 support for the Raspberry Pi 2 as of last night — coming through on their February announcement that they’d be offering the OS for the diminutive computer. With the installed release, you can now build and deploy apps from a Windows 10 PC running Visual Studio.

The B15 robot, shown above, is powered by a Raspberry Pi 2 running Windows along with an Arduino. It made an appearance at yesterday’s BUILD keynote, and merged with a Hololens overlay that the audience was able to see through some camera magic.

We took a few hours to go through the setup so we could take Windows 10 IoT Core for a spin on Raspberry Pi; here are our initial impressions and notes.

Before You Get Started

You’ll need to be running the Windows 10 Insider Build before you can develop or deploy code to the Pi. You can sign up for free at the Windows Insider Program. Download and install the latest build, and get settled into your shiny new operating system.

Next, you’ll need to install the free Visual Studio 2015 Preview. Once that’s up and running, you’ll have everything you need on your PC to start playing with Windows 10 IoT Core on Raspberry Pi 2. When you install the preview, be sure to do a custom install and choose the Tools and Windows SDK for Windows 10.

Note: If you receive the error “Windows 10 SDK 10.0.10069 : The installer failed. User cancelled installation”, don’t worry… you didn’t cancel the installation. But you have tripped over a known problem with the preview. If this happens, download and install the Standalone Windows SDK for Windows 10 from the Windows 10 developer tools preview download page.

Windows 10 IoT Core apps are based on the same Universal App Platform that powers apps on phones, tablets, PCs, Hololens, and other Windows-10 powered devices. Earlier today, Microsoft’s Terry Myerson announced their intention to bring the Windows 10 app platform to 1 billion devices by next year. Getting Windows on Raspberry Pi 2 is a big step toward making that real.

Dan Rosenstein designed and built a bunch of Raspberry Pi robots running Windows 10 IoT Core
Dan Rosenstein designed and built a bunch of Raspberry Pi robots running Windows 10 IoT Core; bot software by Tom Kennard

Set Up the Raspberry Pi 2

Head over to Windows IoT and choose Raspberry Pi 2. Follow the instructions on the Raspberry Pi page to:

  • Download the Windows_IoT_Core_RPI2_BUILD.zip file and extract it. If you see an empty list of downloads on the download page, follow the instructions at the top of this page to sign up for the Microsoft Connect program.
  • Use the dism.exe command shown on the setup page to deploy the image to the card. You cannot write the image to the card using dd or any other disk imager; it will not work because dism prepares the partitions on the card as well as copies files.
  • Install the SD card, connect your peripherals, and plug your Pi into the same Ethernet network that your Windows 10 computer’s connected to. If your computer has an Ethernet port, you may be able to connect them directly. The PC setup page, which should be your next stop, has some tips on configuring connection sharing if you do a direct Ethernet connection between your PC and Pi.

Note: The PC setup page will tell you to install Windows 10 Insider Preview and Visual Studio 2015 RC. If you’ve done that already, you just need to install the WindowsDeveloperProgramForIoT.msi file and configure networking between the Pi and the PC, both of which are explained on this page.

The first time you power on the Pi, the activity LED will flash for a few seconds, then stop for a couple minutes. After Windows finishes its initial configuration, the LED should start flashing again, and you should see the Ethernet link lights come on as well.

You are all set up now: you’ve installed Windows 10 Insider Preview on your PC, along with Visual Studio 2015 Release Candidate, the Windows 10 SDK, and WindowsDeveloperProgramForIoT.msi package. If your Windows machine can see the Raspberry Pi, you’re good to go to the next step, Blink an LED.

Windows IoT Core Watcher
When the Windows IoT Core Watcher program finds your Raspberry Pi, you’re ready to program

Blink an LED

You’ll want to download all the samples from the MS-IOT Github repository. After you have them downloaded and unpacked on your hard drive, navigate to the Blinky->CS subdirectory to find the C# Blink example. Double-click Blinky.csproj to open it in Visual Studio. You may get a warning about opening projects from random places on the Internet. Toss caution to the wind and open it up! Next, do the following:

  • In the Solution window, open the Mainpage.xaml folder and double-click the Mainpage.xaml.cs file to open it. This is the main program, and you’re going to make a change to it: Solution Explorer
  • Scroll down to the bottom of the file, and change the value of LED_PIN to 47. This is the onboard activity LED, and saves you from having to connect an LED (you can do that later if you’d like!):pin47
  • Next, look for the toolbar options to the right of Debug. Make sure that ARM is selected, and change Device to remote machine. If your Pi doesn’t appear in the list, paste in its IP address here and change Authentication mode to None, then click Select:Selecting the remote Pi
  • “Device” will change to “Remote Machine” in the toolbar. Click the green play button to the left of “Remote Machine”, wait a bit, and your onboard LED should be blinking!

When you downloaded that Github repository, you got a bunch more examples to play with. Happy hacking!

Blinking LED

17 thoughts on “Tips and Tricks: Using Windows 10 IoT Core for Raspberry Pi 2

  1. Hi
    I want know that can i use a dll that is used in x86 platform for programming for raspberry pi 2 ??
    I don’t have dll’s source code ….
    Thanks alot

    1. Depends on the type of DLL. If it is a managed DLL with AnyCPU target, you might be able to use it so long as its dependencies are on the target. Unmanaged or specifically targeting an Intel, and obviously that won’t work.

  2. but it´s only for rapi2, right? So I won´t have to try it with my version1 raspi, not? thank you

  3. Thank you very much for this guide. How can I publish these app on my Raspberry Pi 2? I tried to upload it via the Webbrowser, but I get always the error: “unsigned package or missing certificate” … I right-clicked on the Project in VS2015 -> Store -> Create App package … So I got the .appx-file and the .cer-file und selected both in the upload pathes, but it didn’t worked … Did you experienced some the same? Is there any other way (i.e. from within VS2015) to publish the app on the rasp?

  4. Thanks for a great guide! I am getting an error when I double click on blinky.csproj that my version of Visual Studio (VS 2015 Community) is unable to open the project file. I manually installed the W10 SDK. Is there another step I missed? I installed VS 2015 with typical so maybe I need to select custom.
    Running 10074 build of Windows 10 Insider Preview and the Windows IoT Core Watcher finds my Raspberry Pi 2 fine.

    Here is the full error message: “Unsupported
    This version of Visual Studio is unable to open the following projects. The project types may not be installed or this version of Visual Studio may not support them.
    For more information on enabling these project types or otherwise migrating your assets, please see the details in the “Migration Report” displayed after clicking OK.
    – Blinky, “C:UsersnetbobDesktopW10 IoT samples-developBlinkyCSBlinky.csproj”

    No changes required
    These projects can be opened in Visual Studio 2015, Visual Studio 2013, Visual Studio 2012, and Visual Studio 2010 SP1 without changing them.
    – Blinky, “C:UsersnetbobDesktopW10 IoT samples-developBlinkyCSBlinky.sln”

    I guess I need more training… ;-)
    Nb

    1. Hi netbob, I asked the Microsoft folks about this, and they said:

      The community edition is supported, but a custom install is needed. Please make sure you use the “Custom” setup option and install “Universal Windows App Development Tools” & emulators.

      1. For some reason, I am getting an error installing the emulators and discovering its a problem for a few folks. I uninstalled VS 2015 Community and tried it with VS 2015 Enterprise and got the same issue. ” Emulators for Windows Mobile 10.0.10069 : The installer failed. User cancelled installation. Error code: -2147023294″ is the error I get during the install of either VS community or Enterprise.

        Of course with no SDK, the deploy fails with “Warning No SDKs were found. SDKReference items will not be resolved. If your application requires these references there may be compilation errors” and “Deploy started: Project: Blinky, Configuration: Debug ARM ——
        Error: Unable to connect to the Microsoft Visual Studio Remote Debugger named ‘192.168.1.16’. The Visual Studio 2015 Remote Debugger (MSVSMON.EXE) does not appear to be running on the remote computer. This may be because a firewall is preventing communication to the remote computer. Please see Help for assistance on configuring remote debugging.
        ========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
        I’ll keep at it and report back the problem.

        Thanks for looking into it from your end.
        Nb

        1. Hello NetBob!
          This is @IotDan here from the Microsoft IoT Team.
          The community edition is supported, but a custom install is needed.

          Please make sure you use the “Custom” setup option and install “Universal Windows App Development Tools” & emulators.

          Thanks,
          @IotDan

          1. I uninstalled the community edition and installed the enterprise version with the custom option as well as the universal tools and emulators. At first the emulators failed to install but a second modify fixed that. I still get the no sdk error so I’m thinking I need to download the sdk separately again.
            Thanks for the update!
            Nb

          2. I was finally successful in getting the project to work. The additional step I needed to perform was to enable developer mode on my windows 10 device that vs 2015 rc was installed on. I used gpedit to modify the group policies as follows:
            Open a cmd prompt with administrator privileges.
            Run Gpedit.msc.
            Go to Local Computer Policy > Computer Configuration > Administrative Templates > Windows Components > App Package Deployment
            Edit the policies to enable the following:
            Allow all trusted apps to install (Enables your device for sideloading apps)
            Allows development of Windows Store apps and installing them from an integrated development environment (IDE) (Enables your device for development from Visual Studio)
            Reboot your machine.

            I hope this will prove helpful for someone else. Thanks to all who gave me awesome advice!
            Nb

          3. Thanks @IotDan, I have got it working and happy to start working on my project list for the pi 2. Also w10 build 10074 hosed my iotwatcher app and after installing build 10122, it works even better now. Will there be an update process for the iOt core build (like apt-get update) or is that only to be updated from an image?
            Thanks in advance!
            Nb

  5. Finally have made a little more progress. I reinstalled w10 iOt core as well as a fresh install of w10. No more sdk errors but now I’m getting a dep0100 error stating that ‘deployment failed due to a developer licensing issue. Could not obtain a developer license due to error 800704C7.’
    I am signed into vs2015 (I even installed every option on the professional rc) with my valid and up to date developer user. Is there a step on the raspberry pi 2 to enable developer mode?mseeing as this is the only error I am getting, I feel I am so close.
    Oy.
    Nb

    1. This is a different license than your VS license, On Windows 10 there doesn’t seem to be an automatic way to obtain the developer’s license other than opening the PC Settings app, clicking Update and Recovery and then clicking Developer, then choosing Developer Mode. That should give Windows the Windows Store Developer License it needs for you to make a Universal App.

Comments are closed.

Tagged

I'm a tinkerer and finally reached the point where I fix more things than I break. When I'm not tinkering, I'm probably editing a book for Maker Media.

View more articles by Brian Jepson