For my birthday I received a Raspberry PI. This is a low cost, small form computer that you can use for a lot of things. You can even send it to space if you want to. I wanted it to make a home entertainment center with XBMC. Many other people have had the same idea and there is a ready to use distribution for the PI that does just this. It is called RaspBMC.
One of the requirements I had was that I want it to use a wireless connection, to keep the amount of wires in the house down to a minimum. To that end I purchased a Sitecom N150 Wifi USB Adapter from my local store.
After installing RaspBMC and configuring the basics it was time to add the Wifi dongle. To my surprise it didn't work out of the box, even though it has a fairly standard Realtek chipset, it should've been supported by the r8712u driver. After a lot of tinkering, destruction of the distribution and googling I found the steps necessary to make it work. Most of this information came from an Italian Ubuntu forum.
The first step is in the identification of the USB device. By running the lsusb command we can see the ID of the device. This is the ID that the drivers use to identify compatible devices.
$ lsusb Bus 001 Device 003: ID 0df6:006b Sitecom Europe B.V.
Next we will tell the module subsystem of the kernel that this ID is also to be used for the r8712u driver.
$ echo 'install r8712u /sbin/modprobe --ignore-install r8712u; /bin/echo "0df6 006b" > /sys/bus/usb/drivers/r8712u/new_id' | sudo tee /etc/modprobe.d/r8712u.conf
This command will set this setting for the current running system and also store it for future use in the modprobe.d directory. Next we load the module to confirm that the module loads correctly.
$ sudo modprobe -v r8712u
You should see the driver being loaded by looking at the output of the dmesg command.
$ dmesg [ 104.386766] r8712u: module is from the staging directory, the quality is unknown, you have been warned. [ 104.393694] r8712u: DriverVersion: v7_0.20100831 [ 104.393728] r8712u: register rtl8712_netdev_ops to netdev_ops [ 104.393735] r8712u: USB_SPEED_HIGH with 4 endpoints [ 104.394644] r8712u: Boot from EFUSE: Autoload OK
It is important that the system loads the driver every time we boot the system, so we will tell the kernel to load this module whenever it starts up.
$ nano /etc/modules # /etc/modules: kernel modules to load at boot time. # # This file contains the names of kernel modules that should be loaded # at boot time, one per line. Lines beginning with "#" are ignored. r8712u
The last step is to configure wireless networking. This is done by editing the config file /etc/network/interfaces
$ nano /etc/network/interfaces allow-hotplug wlan0 auto wlan0 iface wlan0 inet dhcp wireless-power off wpa-ssid "myssid" wpa-psk "this is a secret passphrase"
After a reboot you should have a complete working wireless connection on your Raspberry PI with the Sitecom N150 USB Wifi Adapter.