Sunday, July 12, 2015

Installing Windows 10 IoT Core on Raspberry Pi 2

There are already plenty of sites with clear step-by-step guides, but with Windows 10 about to officially launch, I figured I'd give it a go anyway.



What is Windows 10 IoT Core?


It's Windows for embedded boards.



Reading that "Windows runs on Raspberry Pi 2" sounds exciting for a moment — but no, Photoshop and the rest of your usual apps won't run.

Here's the gist:

  • Q: Can I run regular Windows software?
  • A: No.

  • Q: Can I use Remote Desktop?
  • A: No.

    You can send commands over the network via PowerShell.

    SSH also works, but it drops you into PowerShell — not a UNIX shell.

  • Q: Can I run multiple apps at once?
  • A: No.

    It seems one pre-configured app launches at startup.

  • Q: Does networking work?
  • A: Yes.

    It picks up an address via DHCP.

    Without DHCP things get complicated — it may not work at all.

  • Q: Does Wi-Fi work?
  • A: Not yet.

    The tutorial mentions buying a USB Wi-Fi adapter, but it doesn't actually work.

    The settings screen exists, so support may come eventually.

    A PLANEX adapter I tried wasn't recognized.

  • Q: Can I use a mouse and keyboard?
  • A: Yes.

    With a mouse you can change the display language.

    You can also browse the built-in tutorial — in Japanese if you like.

    That's about all they're good for.

  • Q: Can I use a USB HDD?
  • A: It was recognized.

    But there's no Explorer.

    It might be useful if you write an app that continuously logs sensor data to external storage.



In short: it's not that you can "use Windows" — it's that you can use the same development environment and languages as Windows, such as .NET.

Don't confuse it with Raspbian-style Linux, where you install server software. It's not for that.

Think of it more like Arduino — a platform for building dedicated embedded applications.



Install Windows 10 on your PC first


Before installing Windows 10 IoT Core on the Raspberry Pi 2, you need Windows 10 on your PC.

At the time of writing this was still Preview, but the official release was imminent — I'll skip the details.



If you'd rather not upgrade your main machine, you can use a virtual machine:

Installing the Windows 10 Preview in a Virtual Environment

Just make sure the guest OS can access the SD card reader.



What you need


Check on Amazon
Obviously you need a Raspberry Pi 2.



If you already have a Raspberry Pi 2 running Raspbian and just want a quick taste of Windows 10 IoT Core, swapping the micro SD card is all it takes.


Check on Amazon
This is the micro SD I used.



Raspberry Pi is sometimes said to have compatibility issues with certain micro SD cards. I haven't run into any myself.




Creating the Windows 10 IoT Core micro SD card


Windows IoT Core Microsoft site

Go to the Raspberry Pi 2 page on the Microsoft site.



Windows IoT Core download page

Click the Download link to grab the ISO file and save it.



Windows IoT Core ISO mounted as DVD drive

Opening the downloaded file mounts it as a DVD drive. The disk image opens automatically — double-click the installer inside.



Windows IoT Core installer

Once the install finishes you're not sure what to do next, so you stare blankly for about 30 seconds.



After collecting yourself, insert the micro SD into your PC.

I don't think I need to explain this, but: don't just jam a bare micro SD into a full-size SD slot. Use an adapter. I take no responsibility for broken hardware.



Once the SD card is mounted, open:

C:\Program Files (x86)\Microsoft IoT\IoTCoreImageHelper.exe



IoT Core Image Helper tool

Select the SD card you inserted.

Next it asks for a .ffu file, which is equally mysterious — cue another 30 seconds of blank staring.



The Raspberry Pi 2 ffu file is here:

C:\Program Files (x86)\Microsoft IoT\FFU\RaspberryPi2\flash.ffu



Click the Flash button and the OS gets written to the micro SD.



Booting Windows 10 IoT Core


Power off the Raspberry Pi 2.

Insert the micro SD you just created.



Unplug everything from the USB ports.

As mentioned above, keyboard and mouse aren't really needed, so feel free to leave them out.



Connect an HDMI monitor.

If you already have a fixed IP assigned via DHCP, the HDMI is optional.



Plug in the LAN cable.

Wi-Fi doesn't work yet, so wired is required. Without a network, you can't do anything.



Once all that's done, plug in the micro USB power cable.

The board powers on and setup starts automatically.



…except the screen immediately goes black.

It stays completely black for about 5 minutes, which is a bit alarming.

Go make a coffee, and when you come back it should have come back to life with a screen like this:

Windows IoT Core starting screen



However, if any USB device is connected, it can get stuck on this screen.

If that happens, power off, redo the SD card flashing from scratch, remove all USB devices, and power on again.



In the normal case it boots in 5–10 minutes.

A language selection screen appears briefly, but without a mouse you can't pick anything.



If you fumble around long enough it auto-selects English and shows this screen.

Check the IP address here.

Windows IoT Core main screen showing IP address



Once you're at this screen, you can connect USB devices and reboot without issues.

That said, the power icon on screen doesn't respond, so you can't reboot from here directly…



Connecting remotely


As mentioned, Remote Desktop isn't available — there's no desktop to remote into.

Instead, connect via PowerShell.



On your PC, type "PowerShell" in the search bar, right-click it and choose "Run as administrator".



PS C:\WINDOWS\system32> net start WinRM
The Windows Remote Management (WS-Management) service is starting.
The Windows Remote Management (WS-Management) service was started successfully.

PS C:\WINDOWS\system32> Set-Item WSMan:\localhost\Client\TrustedHosts -Value {Raspberry Pi 2 IP address}

WinRM Security Configuration.
This command modifies the TrustedHosts list for the WinRM client.
Computers in the TrustedHosts list might not be authenticated.
The client might send credential information to these computers.
Are you sure that you want to modify this list?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): y
PS C:\WINDOWS\system32> Enter-PsSession -ComputerName {Raspberry Pi 2 IP address} -Credential {Raspberry Pi 2 IP address}\Administrator



A password dialog will appear — enter p@ssw0rd.

If no error appears, you're logged in.



For starters, change the password and machine name, then reboot:



net user Administrator [new password]
setcomputername [machine name]
shutdown /r /t 0



Even after all this, there's no desktop or apps to speak of.

The only thing you can really do at this stage is read the Windows IoT Core overview in the built-in tutorial.



To actually do anything useful with Windows IoT Core you need to set up a development environment on your PC — but that's a story for another time.

No comments:

Post a Comment