Preview: Windows 10 IoT Core for Raspberry Pi 2

Please share with your friends...
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

The Internet of Things (IoT) is the inter-networking of embedded electronic devices, with sensors and/or actuators, that exchange information to achieve a greater value or service. These devices are expected to led to a massive growth in automation development and use across all fields.

Microsoft is encouraging developers to join its’ Internet of Things (IoT) community with their new free Windows 10 IoT Core operating system, available for several embedded platforms including the Raspberry Pi 2.

This post is based on the Windows 10 IoT Core for Raspberry Pi 2 Insider Preview Build released 12/05/2015.

So what is Windows 10 IoT Core for Raspberry Pi 2?

It is not a slimmed down desktop version of Windows for Raspberry Pi; there is no shell, Command Prompt, or Windows Explorer.

It is the “Core” Windows operating system from which you can run Windows Universal Apps to do anything the underlying Raspberry Pi 2 hardware is capable of doing. Windows Universal Apps are built and deployed remotely from a Windows 10 desktop PC running Visual Studio 2015. You can also connect to and manage your Raspberry Pi using PowerShell.

Download
  1. Download the latest Windows 10 IoT Core image here.
  2. When the download is finished, extract the compressed image (flash.ffu) from the downloaded zip file.
Install

These steps are for installing the downloaded Windows 10 IoT Core image onto your SD Card.

Note: These steps must be performed from a Windows 10 desktop computer. They will not work from an earlier version of Windows.

  1. Insert the SD Card into your computer, either directly, or using a card reader if required.
  2. Open an administrative Command Prompt (Run as Administrator), and change directory to the location of the extracted image (flash.ffu).
  3. Determine the disk number of the SD Card on your computer. This will be used when applying the image in the next step.
    1. Run the DiskPart utility with the following command:
      diskpart

      The command will produce output similar to the following:

      Microsoft DiskPart version 6.3.9600
      
      Copyright (C) 1999-2013 Microsoft Corporation.
      On computer: WINDOWS-PC
    2. Run the following command to list all the disks connected to the computer:
      list disk

      The command will produce output similar to the following:

        Disk ###  Status   Size     Free     Dyn  Gpt
        --------  -------  -------  -------  ---  ---
        Disk 0    Online    476 GB      0 B        *
        Disk 1    Online   7580 MB    73 MB

      Identify the disk number of your SD Card. In this example, our Sandisk Ultra 8GB SD Card is Disk 1.

    3. Close the DiskPart utility with the following command:
      exit

      The command will produce output similar to the following:

      Leaving DiskPart...
  4. To applying the image to your SD Card, run the following command:
    dism.exe /Apply-Image /ImageFile:flash.ffu /ApplyDrive:\\.\PhysicalDriveN /SkipPlatformCheck

    However, replace PhysicalDiskDriveN with the value you determined in the previous step. For example, if your SD Card was disk number 3, use PhysicalDiskDrive3.

    The command will produce output similar to the following:

    Deployment Image Servicing and Management tool
    Version: 10.0.10122.0
    
    Applying image
    [====================100.0%====================]
    The operation completed successfully.

    However, if you receive the error:

    Error: 87
    
    The /applydrive option is not recognized in this context.

    This means you are attempting to run the command on a Windows 8.1 or earlier computer. As noted at the beginning, these steps can only be performed from a Windows 10 desktop computer.

  5. Use the Windows Safely Remove Hardware and Eject Media wizard in your task tray to safely eject the SD Card from the computer; this will ensure the write cache has been flushed prior to removal. Failing to do this can corrupt the data on your SD Card.
Boot

Once you have installed the Windows 10 IoT Core image, re-insert the SD Card into your Raspberry Pi, then power on and boot the image.

On first boot, Windows 10 IoT Core will perform a number of initialisation tasks during which it will display some configuration information similar to the following:

Windows 10 IoT Core First Boot

Windows 10 IoT Core First Boot

This initialisation process may take five minutes to complete, during which the Raspberry Pi will restart automatically. Once complete, DefaultApp will be displayed on your Raspberry Pi:

Windows 10 IoT Core Insider Preview

Windows 10 IoT Core Insider Preview

Connect

Now that your Raspberry Pi has Windows 10 IoT Core up and running, lets connect to it!

The default user name is Administrator
The default password is p@ssw0rd

Watcher
The Windows IoT Core Watcher tool will automatically find any Windows IoT Core devices on the local network, without needing to know their physical location or IP address.

The Windows IoT Core Watcher tool is installed by the WindowsDeveloperProgramForIoT.msi, which can be found in the downloaded compressed image file. Requires Visual Studio 2015 to run the installation (although it is possible to open the MSI in 7zip and extract just the WindowsIoTCoreWatcher.exe file).

  1. Open the Windows IoT Core Watcher tool. The tool scans the local network for Windows IoT Core devices.
    Windows IoT Core Watcher

    Windows IoT Core Watcher

    Any Windows IoT Core devices found on the local network are listed in the main window.

  2. Right click on the entry for your Raspberry Pi 2 and select Web Browser Here from the context menu.
    Windows IoT Core Watcher: Web Browser Here

    Windows IoT Core Watcher: Web Browser Here

[_/su_spoiler]
Browser

Windows IoT Core includes a WebB interface that lets you manage and monitor the device from a web browser.

  1. Use your web browser to visit your Raspberry Pi's address, shown on the DefaultApp screen.
  2. When prompted for credentials, enter the default user name and password. The management Home page will be displayed.
    Windows 10 IoT Core: Home

    Windows 10 IoT Core: Home

  3. Click Apps. The AppX Manager page will be displayed.
    Windows 10 IoT Core: AppX Manager

    Windows 10 IoT Core: AppX Manager

  4. Click Processes. The Running Processes page will be displayed.
    Windows 10 IoT Core: Running Processes

    Windows 10 IoT Core: Running Processes

  5. Click Performance. The Performance page will be displayed.
    Windows 10 IoT Core: Performance

    Windows 10 IoT Core: Performance

  6. Click Debugging. The Debug page will be displayed.
    Windows 10 IoT Core: Debug

    Windows 10 IoT Core: Debug

  7. Click ETW. The Realtime ETW Tracing page will be displayed.
    Windows 10 IoT Core: Realtime ETW Tracing

    Windows 10 IoT Core: Realtime ETW Tracing

  8. Click Perf Tracing. The Performance Tracing page will be displayed.
    Windows 10 IoT Core: Performance Tracing

    Windows 10 IoT Core: Performance Tracing

  9. Click Devices. The Device Manager page will be displayed.
    Windows 10 IoT Core: Device Manager

    Windows 10 IoT Core: Device Manager

  10. Click Networking. The Networking page will be displayed.
    Windows 10 IoT Core: Networking

    Windows 10 IoT Core: Networking

    There is no Wi-Fi or Bluetooth support included with the Insider Preview Build. It will be included with the final release.

[_/su_spoiler]
Powershell

You can remotely configure and manage any Windows IoT Core device using Windows PowerShell. PowerShell is a task-based command-line shell and scripting language, designed especially for system administration.

To start a remote PowerShell session with your Windows IoT Core device, you’ll first need to create a trust relationship between your host PC and your device:

  1. You may need to start the WinRM service on your desktop to enable remote connections. From the PowerShell console type the following command:
    net start WinRM
  2. From the PowerShell console, type the following command:
    Set-Item WSMan:\localhost\Client\TrustedHosts -Value <machine-name|ip-address>

    Substitute <machine-name|ip-address> with the appropriate value; using your machine-name is the easiest to use, but if your device is not uniquely named on your network, use the IP address instead.
    Press Y to confirm the change when prompted.

  3. There is a known issue with PowerShell that can cause a StackOverflowException on the PowerShell client machine. To work around this type the following line before the Enter-PsSession:
    remove-module psreadline -force
  4. Start a remote PowerShell session with your Windows IoT Core device. From the PowerShell console, type:
    Enter-PsSession -ComputerName <machine-name|ip-address> -Credential <machine-name|ip-address|localhost>\Administrator

    Substitute <machine-name|ip-address> with the appropriate value. In the credential dialog enter the default password.
    Note: The connection process is not immediate and can take up to 30 seconds.
    If you successfully connected to the device, you should see the IP address of your device before the prompt:

    [192.168.1.100]: PS C:\Users\Administrator>
Administrator Password

It is highly recommended that you change the default Administrator password. To do this, issue the following command from your remote PowerShell session:

net user Administrator <new-password>

Replace <new-password> in the above example with the new Administrator password for your Raspberry Pi device.

[__/su_spoiler]
Boot Option

Windows IoT Core devices have two two different boot options available:

  • headed - when display capabilities are required; or
  • headless - when a display is not required or not available.

To change this setting, issue the following command from your remote PowerShell session:

setbootoption [ headed | headless ]

Specify either headed or headless as shown in the above example.

You will need to restart the device for the change to take effect.

[__/su_spoiler]
Copy Utilities

Microsoft has provided familiar copy utilities in Windows IoT Core, including:

  • sfpcopy.exe
  • xcopy.exe
[__/su_spoiler]
Device Drivers

The device console utility is useful in identifying and managing installed devices and drivers. For a full list of parameters, issue the following command from your remote PowerShell session:

devcon.exe /?
[__/su_spoiler]
Device Name

To identify your current device's name, issue the following command from a remote PowerShell session:

hostname

To rename your device, issue the following command from your remote PowerShell session:

setcomputername <new-name>

Replace <new-name> in the above example with the new name for your Raspberry Pi device.

You will need to restart the device for the change to take effect.

[__/su_spoiler]
Display Resolution

To adjust the resolution of a display connected to your Windows IoT Core device, issue the following command from a remote PowerShell session:

SetDisplayResolution [width] [height]

Specify the desired resolution's width and height as shown in the above example. To query the current resolution, exclude both parameters.

[__/su_spoiler]
Local Users

Create New User

To create additional local user accounts on your device, issue the following command from your remote PowerShell session:

net user <username> <password> /add

Replace <username> and <password> in the above example with the username and password of the new user you wish to create on your device.

Add User to Group

To add a local user account to a local group on your device, issue the following command from your remote PowerShell session:

net localgroup <groupname> <username> /add

Replace <groupname> and <username> in the above example with the group name and username you wish to add on your device.

Change Password

To change a password for a local user account on your device, issue the following command from your remote PowerShell session:

SetPassword <username> <new-password> <old-password> 

Replace <username>, <new-password>, and <old-password> in the above example with the username, new password and old password for the specific user on your device.

[__/su_spoiler]
Network Configuration

Many of the basic network configuration utilities you may already be familiar with are also available in Windows IoT Core, including commands such as:

  • ping.exe
  • netstat.exe
  • netsh.exe
  • ipconfig.exe
  • nslookup.exe
  • tracert.exe
  • arp.exe
[__/su_spoiler]
Process Management

To view currently running processes, issue the following command from your remote PowerShell session:

get-process

Alternatively, you can also use the following command from your remote PowerShell session:

tlist.exe

To stop a running process, issue the following command from your remote PowerShell session:

kill.exe <pid | process-name>

Replace <pid | process-name> in the above example with the process ID or name of the process or task you wish to stop on your device.
[__/su_spoiler]

Registry Access

The registry command line utility can be used if you need to access the registry to view or modify settings. For a full list of supported parameters, issue the following command from your remote PowerShell session:

reg.exe /?
[__/su_spoiler]
Services

Managing Windows services can be accomplished via the net.exe command. To see a list of running services, issue the following command from your remote PowerShell session:

net start

To start or stop a specific service, issue the following command from your remote PowerShell session:

net [start | stop] <service-name> 

You can use the Service Control Manager with following command from your remote PowerShell session:

sc.exe

Alternatively, you can also use the following command from your remote PowerShell session:

ListServices
[__/su_spoiler]
Shutdown/Restart

To shutdown your device, issue the following command from your remote PowerShell session:

shutdown /s /t 0

To restart your device, use the shutdown command with the following parameters:

shutdown /r /t 0
[__/su_spoiler]
Startup Applications

Use the startup editor to configure startup apps on your Windows IoT Core device. Run IotStartup with any of the following options:

  • IotStartup list lists installed applications
  • IotStartup list headed lists installed headed applications
  • IotStartup list headless lists installed headless applications
  • IotStartup list [MyApp] list installed applications that match pattern MyApp
  • IotStartup add adds headed and headless applications
  • IotStartup add headed [MyApp] adds headed applications that match pattern MyApp. Pattern must match only one application.
  • IotStartup add headless [Task1] adds headless applications that match pattern Task1
  • IotStartup remove removes headed and headless applications
  • IotStartup remove headed [MyApp] removes headed applications that match pattern MyApp
  • IotStartup remove headless [Task1] removes headless applications that match pattern Task1
  • IotStartup startup lists headed and headless applications registered for startup
  • IotStartup startup [MyApp] lists headed and headless applications registered for startup that match pattern MyApp
  • IotStartup startup headed [MyApp] lists headed applications registered for startup that match MyApp
  • IotStartup startup headless [Task1] lists headless applications registered for startup that match Task1

For further help, use IoTStartup help

[__/su_spoiler]
Task Scheduler

To view the current list of scheduled tasks, issue the following command from your remote PowerShell session:

schtasks.exe

You can create new tasks with the /create switch or run on-demand tasks with the /run switch. For a full list of supported parameters, use the /? switch.

[__/su_spoiler] [_/su_spoiler]
Develop

Use Visual Studio 2015 and the remote debugger. More to come on this…

Raspberry Pi is a trademark of the Raspberry Pi Foundation.

Disclaimer: No liability is accepted (whether under the law of contract, the law of torts or otherwise) in relation to the contents of, or use of, or otherwise in connection with, this website to the extent that the website is provided free-of-charge, for any direct loss; for any indirect, special or consequential loss; or for any business losses, loss of revenue, income, profits or anticipated savings, loss of contracts or business relationships, loss of reputation or goodwill, or loss or corruption of information or data. These limitations of liability apply even when expressly advised of the potential loss.


Please share with your friends...
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Leave a Reply