Skip to content

Latest commit

 

History

History
60 lines (45 loc) · 3.36 KB

File metadata and controls

60 lines (45 loc) · 3.36 KB

Windows 10 IoT Core sample code

How to download:

You can find the source code for this sample by downloading a zip of all of our samples here.

Requirements

  • Visual Studio 2015 Update 3
  • Xamarin for Visual Studio
    • Xamarin 4.2.0.719 (15694b9)
    • Xamarin.Android 7.0.1.6 (5a02b03)
  • Update Xamarin Nuget to v2.3.3.168

Design

This sample is intended to show how to remotely configure an IotCore device when it is not attached to a network.

There are two parts to this:

  1. Client - running on an Android or Windows Phone 10 phone, this app will find your IotCore device, connect to it, and allow you to specify the required information to join a WiFi network.
  2. Server - running on your IotCore device, this app (foreground or background) help the Client connect your IotCore device to a desired WiFi network.

The client utilizes Xamarin Forms to create a UI app for Android and Windows Phone 10 devices.
Design

The general communication flow between Client and Server Flow

Usage

  1. Download this sample.

  2. Connect to your IotCore device using the Device Portal, open the Onboarding page, and set the SoftAP settings SSID to be something recognizable.

  3. Connect to your IotCore device using SSH or PowerShell and run the following commands to enable SoftAP. If you're using PowerShell, the command will need a /f flag to run successfully.

    reg add hklm\system\currentcontrolset\services\mpssvc\parameters /v IoTInboundLoopbackPolicy /t REG_DWORD /d 1
    checknetisolation loopbackexempt -a -n=IoTOnboardingTask-uwp_1w720vyc4ccym
    checknetisolation loopbackexempt -a -n=CompanionAppServer_1w720vyc4ccym
    
  4. Restart your device.

  5. Open CompanionAppServer\CompanionAppServer.sln, select the appropriate startup project, platform and use F5 to build, deploy, and launch.

    • CompanionAppServer is a Background Application
  6. Connect Android phone or Windows Phone 10 to computer.

  7. Open CompanionAppClient\CompanionAppClient.sln, select the appropriate startup project, platform and use F5 to build, deploy, and launch.

    • CompanionAppClient.Droid and Any CPU for Android
    • CompanionAppClient.UWP and ARM for Windows Phone 10
  8. On your phone, follow the flow:

    1. Click the Scan for Access Points button
    2. Select your IotCore device's access point and click the Connect to Access Point button
    3. Click the Get Networks button
    4. Select the desired network, enter the network's password, and click the Connect button
  9. At this point, your IotCore device should be connected to your desired WiFi network. If your device is not showing up, you may need to delete the profiles in "Connectivity -> Network".

Additional resources

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.