Raspberry Pi 3 comes with built in Wi-Fi and bluetooth connectivity, so if you are running Windows 10 IoT core on Raspberry Pi 3 you dont need to buy any of those USB Wi-Fi adapters for wireless connection. The setup is very easy no matter you are running in a headed or headless mode. This article shows you various different ways of setting up WiFi access on a Window 10 IoT core device.
Note: If your Windows IoT core device does not have built-in WiFi, you need to buy WiFI dongle which you can then plug into the USB port. For a list of supported WiFi dongles, check this link.
1. Connect to a WiFi network from Device Portal
If your Windows IoT device is running headless (without a display monitor) and you already have a wired LAN connection to it from another computer, then the easiest method to configure WiFi is from the Device Portal. To access the device portal:
- Open the Windows IoT core dashboard from your computer.
- Click My Devices.
- Right click your Window IoT device from the list.
- From the options menu select Open in Device Portal.
- Enter user name Administrator and your password.
- On the Device Portal, click Networking on the left hand menu.
- Select the WiFi adapter you want to configure.
- Select your Wifi Network from the list of networks in the Available Networks section.
- Enter the security key for your WiFi network.
- The Create Profile check box should be checked if you want to create a WiFi profile and connect to this network automatically whenever it is available. Otherwise if its only a one time connection then leave this unchecked.
- Finally click on Connect.
- The connection details will appear under IP Configurtion section once the connection is established.
2. Configure WiFi connection from PowerShell or SSH
If you already have a wired LAN connection to your Windows IoT Core device, you can configure WiFi from a PowerShell or SSH session using the Netsh utility. Netsh is a command line tool to view and modify network configurations locally or remotely. You could run Netsh from both SSH command line or PowerShell and lets you manage Wifi profiles. However you can't create a new WiFi profile using the Netsh command. Therefore you create a Wifi profile on a reference computer first, export that profile to an XML file and then import it to you Windows IoT device. Below are the steps:
2.1 Export Wifi profile to XML file
A reference computer must be a Windows PC (Windows 7, 8, 10 or later versions of the OS) that has already made a connection to your WiFi network.
Open a command prompt on the reference computer and run the following command to view available WiFi profiles.
C:\> netsh wlan show profiles Profiles on interface Wireless Network Connection: Group policy profiles (read only) --------------------------------- <None> User profiles ------------- All User Profile : TALKTALK-29AB All User Profile : BT-WiFi-With-FON All User Profile : SKY567DC All User Profile : BTHub5-Z863
Assuming the wireless network profile you want to connect is BTHub5-Z863, to export this profile to an XML file, run
C:\> netsh wlan export profile folder=c:\ name=BTHub5-Z863 Interface profile "BTHub5-Z863" is saved in file "c:\Wireless Network Connection -BTHub5-Z863.xml" successfully.
When you export a profile that connects to Wifi network with security type WPA2-Personal, netsh will encrypt the security key. For this profile to work on a Windows IoT device, the security key must be decrypted. Open the XML file (c:\Wireless Network Connection-BTHub5-Z863.xml) in Notepad or another text editor and replae the encrypted password inside tags <keyMaterial> and </keyMaterial> with the unencrypted plain text password. Also change the protected status from true to false.
Password in exported XML file:
<sharedKey> <keyType>passPhrase</keyType> <protected>true</protected> <keyMaterial>C1F3101DB29374EF32D37AC7594C82E065150A04D1613227</keyMaterial> </sharedKey>
<sharedKey> <keyType>passPhrase</keyType> <protected>false</protected> <keyMaterial>MyWifiPassword</keyMaterial> </sharedKey>
Save changes to the file.
2.2 Copy XML file to Windows IoT device
In this step you map the C: drive of your Windows IoT device as a network drive on your reference computer. You then copy the XML file over to the mapped drive with xcopy command. Replace the IP address in the commands below with the IP address of your device.
C:\> net use z: \\192.168.1.109\c$ /user:Administrator Enter the password for 'Administrator' to connect to '192.168.1.30': The command completed successfully. C:\> xcopy "c:\Wireless Network Connection-BTHub5-Z863.xml" z:\ C:\Wireless Network Connection-BTHub5-Z863.xml 1 File(s) copied
2.3 Add WiFi Profile in XML file to Windows IoT device
Connect to your Windows IoT Device using PowerShell or SSH and run the following commands to add the WiFi profile to your device and connect.
C:\Data\Users\Administrator> netsh wlan add profile filename="c:\Wireless Network Connection-BTHub5-Z863.xml" Profile BTHub5-Z863 is added on interface Wi-Fi. C:\Data\Users\Administrator> netsh wlan show profiles Profiles on interface Wi-Fi: Group policy profiles (read only) --------------------------------- <None> User profiles ------------- All User Profile : BTHub5-Z863
2.4 Connect to the Wifi network
To connect to a WiFi network use the connect command along with the Wifi profile name.
The show interfaces command can be used to verify the status of the connection.
C:\Data\Users\Administrator> netsh wlan connect name="BTHub5-Z863" Connection request was completed successfully. C:\Data\Users\Administrator> netsh wlan show interfaces There is 1 interface on the system: Name : Wi-Fi Description : Broadcom 802.11n Wireless SDIO Adapter GUID : 996b7c18-01a2-40af-8554-47f4807b3e4f Physical address : b8:27:eb:f8:e9:88 State : connected SSID : BTHub5-Z863 BSSID : 00:63:d8:26:25:58 Network type : Infrastructure Radio type : 802.11n Authentication : WPA2-Personal Cipher : CCMP Connection mode : Profile Channel : 1 Receive rate (Mbps) : 72 Transmit rate (Mbps) : 72 Signal : 93% Profile : BTHub5-Z863 Hosted network status : Not available C:\Data\Users\Administrator> ipconfig Windows IP Configuration Wireless LAN adapter Wi-Fi: Connection-specific DNS Suffix . : home Link-local IPv6 Address . . . . . : fe62::a42e:31de:c176:801e%5 IPv4 Address. . . . . . . . . . . : 192.168.1.57 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.1.254
3. Configuring WiFi from the Default App
If your Windows IoT has a monitor, mouse and keyboard connected to it then, you could configure and connect to the WiFi from the Default App Settings.
Click on the Setttings icon.
In the Device Settings page, click Network and Wi-Fi from the menu on the left hand pane.
Select the WiFi netwrok from the list and click Connect.
Enter a Network Security Key when prompted and click Next to finish connecting.
Note: If you have both wired and wireless connection on your Windows IoT device, then the wired LAN connection will take preference.