Raspberry Pi 2 PiPlay Wifi Setup

IMG 9280

I have a Raspberry Pi 2 which I’ve setup for some retro arcade action using the PiPlay Linux Distribution. Until now, I’d been dependent on a wired ethernet connection. What surprised me is how difficult it was to setup the wifi dongle that came with the Maker Shed Starter Kit.

It really came down to modifying the two files below. It turns out there are quite a few different opinions on how to do it. It took a lot of trial and error for me to come up with settings that worked. I’m not an expert at this, so there are probably better ways to do this, but this works for me.

I think this would apply to other Pi Linux distributions, but I haven’t tried it.The wifi dongle is a Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter. I haven’t tried this with any other wifi dongles. 

/etc/network/interfaces

This is the script that describes how each interface will acquire it’s network IP address. In many cases DHCP will do. With this setting, the computer will get IP addresses for it’s wired ethernet port (eth0) and wireless port (wlan0) from the gateway. The localhost (lo) is a special case and doesn’t require changing. To be honest, I’m not sure how default plays into things. I do know that it required being set as described below for things to work correctly.

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

In my case, I needed the Pi to have a static IP address.

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet static

address 192.168.1.53
netmask 255.255.255.0
gateway 192.168.1.1

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet static
address 192.168.1.53
netmask 255.255.255.0
gateway 192.168.1.1

/etc/wpa_supplicant/wpa_supplicant.conf

This file handles the wifi authentication. In my case, it was WPA2, which required the following configuration.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid=“
MyNetwork
    psk=Password
    proto=RSN
   
key_mgmt=WPA-PSK
    pairwise=CCMP
    auth_alg=OPEN
}