Getting Started with Windows IoT Core on Raspberry Pi 2
Internet of Things (IoT) is the network of devices that embedded with a variety of sensors, network connectivity, and software, which makes physical objects smart, capable of communicating with each other. How to turn things intelligent? We can give physical objects a computer brain, such as Raspberry Pi. Microsoft is aiming to help developers quickly build IoT solutions with Windows IoT Core. To get started, you can choose a board you like, and read the IoT tutorials provided by Microsoft. I picked Raspberry Pi 2 (RPi2) and successfully ran the first Windows Universal app on Windows IoT Core.
How to Setup Windows 10 IoT Core Development Environment on Raspberry Pi 2?
- Upgrade operating system to Windows 10. Download and install Visual Studio 2015.
- Prepare Raspberry Pi 2, micro SD card (minimum 8G), card reader, HDMI cable, monitor, and Ethernet cable.
- Download Windows 10 IoT Core image and then install Windows_10_IoT_Core_RPi2.msi.
- Connect Micro SD card reader to PC. Run IoTCoreImageHelper.exe to load flash.ffu, which is located at C:\Program Files (x86)\Microsoft IoT\FFU\RaspberryPi2.
- Safely remove SD card reader, and then insert Micro SD card to RPi. Connect the board to HDMI monitor, keyboard, mouse, Ethernet cable and micro USB power supply.
- Once Windows IoT Core booted successfully, it will appear on Windows IoT Core Watcher.
- Run Powershell as administrator.
Start the WinRM service:
net start WinRM
Add the device by machine name or IP. By default, the machine name is minwinpc.
Set-Item WSMan:\localhost\Client\TrustedHosts -Value minwinpc
Start a session with the Windows IoT Core device. The default password is p@ssw0rd.
Enter-PSSession -ComputerName minwinpc -Credential minwinpc\Administrator
For remote debugging, check whether there are two instances of msvsmon.exe running on the device.
tlist | sls msvsmon.exe
How to Deploy and Run Windows Universal App on Windows IoT Core?
If you don’t have Windows IoT template installed, you can get it from Tools > Extensions and Updates > Search for IoT.
Create IoT background apps with the template.
If you just want to test a Universal app quickly, you can download the sample code from GitHub.
Open Project Properties. Navigate to Debugging > Remote Machine > Machine Name. Add the detected device.
Deploy and run your app via Remote Machine.
How to Make Your Universal App as the Default Startup Program on Windows IoT Core?
We can use the startup editor to configure startup apps.
List all installed applications:
Note: the Microsoft.SDKSamples.OCR.CPP is the Windows Universal sample I installed via Visual Studio 2015.
Check the startup apps with the command:
iotstartup.exe startup add .*OCR
shutdown /r /t 0
You will see the default startup app has been changed to yours.