After an absence from significant IoT-Core activity, whilst working on a significant phone app (as blogged here) I’m back in eth IoT-Core space. Things have changed for the better so here goes.  This blog covers my experiences with getting a RPI3 going with the latest Technical Preview build. Tools are now available to simplify setup and there is now a Remote Viewer.  As a test UWP app, I have used (after a small modification) the Icons app on Codeplex,  Universal Windows 10 SDK App Icons app as blogged in a previous blog. The app was modified because popups (as in MessageBox) are not supported in IoT-Core (Use thereof can cause an app crash in later OS versions). This feature change is covered.

 

Getting Started with Windows 10 IoT-Core

The starting point for IoT-Core is as https://developer.microsoft.com/en-US/windows/iot You take the [Get Started Now] path.  The information there cover this in detail so it will only be summarized here.

Steps:

  1. Install Windows 10 and Visual Studio 2015 both with the latest updates. I’m on the Fast Track with Windows 10 .. I get one or two reinstalls per week. I have installed VS2015 Update 2.
  2. Get the  Windows 10 IoT Core Dashboard. This is much improved from previous versions with additional and merged functionality.  With this you can:
    - View booted IoT Core devices (my phone shows as well!)
    - Create an IOT-Core SD image for booting on an SD Card.
    - Launch a couple of examples.
  3. Choose your target system and create an OS Image
  4. Boot the system with that image with keyboard, mouse, wired network and HDMI display ( I use a 40 inch TV!)
  5. Check that the is system listed in the first option of the Dashboard. 
    PS I found that I needed to have both the dev machine and target one a wired network (with DHCP).. If my dev machine was on WiFi it did not “see” the target system in the dashboard.
  6. View the booted system properties and make modifications via the web interface that can be launch from the Dashboard.
  7. Create a pure UWP app in Visual Studio and deploy and test it on the target system.
    Remember the target is ARM, the device is Remote, you need its IPAddress,  and the Authentication is Universal(Unencrypted).

 

Dashboard Images:

image

 

image

 

image

 

IoT-Core Images

You can use the Dashboard, as part of option 2, to download the “latest” release image for you by choosing the target system and continuing. The image will be downloaded and setup on your target card. Alternatively you can target a previously downloaded image by selecting Other for the target and browsing to when it was installed.  When you download an image you open the downloaded .so and run the .msi there. This places the file in teh CPU’s folder under:
C:\Program Files (x86)\Microsoft IoT\FFU

If you want images later than the last release you can get them from https://www.microsoft.com/en-us/software-download/windowsiot

“You need to have a valid Microsoft Account and need to be signed up for the Windows Insider Program to be able to download the Insider Preview. Visit the downloads page here for more details.” 

Current there are two on offering:
image

 

I used Build 14322 for the Raspberry PI 2/3. My target is a new RPI3.

 

Networking & WiFi

The Dashboard (option 1) shows the IPAddress of the target. Whilst the RPI3 supports WiFi, you need to initially used a wired network. One option is use a network switch to which the development machine is connected, with a router connected to that providing DHCP and internet access. Another alternative is to use WiFi connectivity to the router from the dev machine (eg a laptop) and use the wired NIC on the dev machine as a direct connection to the target IoT-Core target.  You implement Internet Connection Sharing (ICS) on the dev machine’s WiFI via its wired NIC.  This also gets around the Dashboard connectivity WiFi issue previously mentioned.

 

Once the system is up and running, if its a RPI3 and you have at a later build, you can enable WiFI on the target via the web portal (which you access from the Dashboard).

image

 

Whilst the WiFI works with RPI 3 its not yet optimised and the wired network is best to use.  It is instructional though to get it working.  Alternatively there are USB WiFi dongles you can use:  https://developer.microsoft.com/en-us/windows/iot/win10/SupportedInterfaces.htm#WiFi-Dongles


On the web portal Networking Tab you see that WiFi adapter is available:

image

 

Select a Wi-Fi network, enter its key and connect. In doing so, also select to create a profile:

 

image

 

Connected on Channel 6:

 

image

 

.. with a Profile for later reboots:

 

image

And after a [Refresh] the WiFi configuration is available:

image

 

PS: Given that there are now 2 NICs, ICS can be configured on the target device. This would be useful where the device is a concentrator for a a number of subordinate, less capable, IOT devices, such as  sensors.

 

Windows IoT Client

This is an app like Remote Desktop. It saves the need to have to lug around a separate monitor (in my case a 40 inch TV). Its probably best to run it over a wired NIC rather than WiFi at this stage. Also video hasn’t yet been optimised so, for example, a mouse cursor can be a bit slow.

It is also available on the Windows 10 phone and can pass back phone sensor information for use on the IoT-Core device.

Remote display experience

 

The app can be downloaded from The Store: here.

You must enable the remote access on that Remote tab in the web portal:

image

 

You run the app on the dev machine and either enter the target's IpAddress or or choose it from the Discovered Devices:
image

 

And Wala:

image

 

Running the UWPIcons app:

image

The project: Universal Windows 10 SDK App Icons on Codeplex.

 

Bluetooth

Bluetooth on the RPI3 has not yet been enabled. The reader is referred to my previous seminal blogs on using a generic USB Bluetooth dongle with IoT-Core, also on Hackster.IO:
Win 10 IoT-Core- Bluetooth Universal Windows Serial App

https://www.hackster.io/DavidJones/generic-serial-bluetooth-with-win-10-iot-core-rpi2-fcc4ca

 

 

Popups

The Popup class is not supported in Windows 10 IoT-Core. It one of those missing APIs. I guess its something to do with not wanting IoT-Core to be used a general purpose computer with a rich UI. The MessageDialog class is therefore not available in this domain. The original UWPIcons app used  MessageDialog instance to provide feedback to the user when the Camera, Flash and Selfie buttons are pressed (“XXX button was pressed.) The alternative is to use the Flyout class which works for all UWP contexts. These, in the example app, are completely coded in XAML as further properties of a button. Each button has its own Flyout that is actioned when the button is pressed.

 

In some of the earlier versions of IoT-Core, a call to Popups were just ignored; no app crash.  as RTM approached, this was changed to generate an error. Whilst Popups work in both the Windows 10 desktop and phone contexts,  Flyouts work in all Windows 10 UWP targets (including IoT-Core) and so are a truly universal API.

 

Further Information

 

 

The Flyout Base is added to Mainpage Grid:

    <Grid Name="MainGrid" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <FlyoutBase.AttachedFlyout>
            <Flyout>
                <Grid Height="100" Width="100"/>
            </Flyout>
        </FlyoutBase.AttachedFlyout>

Note: This was added automatically when the Flyouts were added to the buttons.

 

All of the three buttons’ code were modified to include a Flyout eg:

        <Button Grid.Row="0" Grid.Column="1" x:Name="CameraButton"   Tapped="buttonCamera_Tapped"
IsEnabled="True" HorizontalAlignment="Left" Margin="0"> <Viewbox MaxHeight="40" MaxWidth="40" > <SymbolIcon Symbol="Camera"/> </Viewbox>

</Button>

Became

        <Button Grid.Row="0" Grid.Column="1" x:Name="CameraButton"  IsEnabled="True" HorizontalAlignment="Left" Margin="0">
            <Viewbox MaxHeight="40" MaxWidth="40" >
              <SymbolIcon Symbol="Camera"/>
            </Viewbox>
            <Button.Flyout>
                <Flyout>
                    <Flyout.FlyoutPresenterStyle>
                        <Style TargetType="FlyoutPresenter">
                            <Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled"/>
                            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
                            <Setter Property="IsTabStop" Value="True"/>
                            <Setter Property="TabNavigation" Value="Cycle"/>
                        </Style>
                    </Flyout.FlyoutPresenterStyle>
                    <TextBlock TextWrapping="Wrap" Text="Camera Button Pressed."/>
                </Flyout>
            </Button.Flyout>
        </Button>
Note that the Button Tapped event handler was removed from the button properties as the “handle” to the Flyout is encoded within the button XAML code.

The following image WAS captured on the IOT-Core Remote Client:
image

Universal Windows 10 SDK App Icons