[AN] anup narkhede

Programmer, Hobbyist, Jack of many trades, Master of some

Raspbmc and Wifi

| Comments

In this post, I share my experience with raspbmc and making it work with a wifi dongle. If you are looking to get rid of ethernet cable and keyboard, make the xbmc stand alone and control it using the web remote, this post is for you.

Bear in mind that not all wifi dongles have supported drivers for debian. As a safe bet, pick one from the list of verified wifi adpaters. I used Tenda W311U wireless adapter as it is well tested with debian and comes at a decent price.

To install the supported drivers, you’ll need to access the terminal on raspbmc. Follow these tips to switch between terminal and xbmc.

To Access terminal from xbmc

Click on Power icon, Exit. When the splash screen comes up, press escape. You will be shown a login prompt. Use login: pi, password: raspberry.

To Launch xbmc from terminal

%sudo initctl start xbmc

Install drivers

Once you are logged on to the terminal, update sources for aptitude and install drivers by following steps below:

%sudo nano /etc/apt/sources.list

add line:

deb http://ftp.uk.debian.org/debian/ squeeze main non-free

Then install the driver:

%sudo apt-get update
%sudo apt-get install firmware-ralink

Check device status:

%nmcli dev
=>
eth0   802-3-ethernet  connected
wlan   802-11-wireless unmanaged

Scan for wifi access points:

%nmcli dev wifi list

You should see a list of available wireless access points.

Configure the wireless network interface

Once you have the device drivers installed, you need to configure the network interface.

%sudo nano /etc/network/interfaces

Add following lines:

auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa.conf

Create the wpa.conf

%sudo nano /etc/wpa.conf

Add following lines:

network={
ssid="NETWORK_SSID"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="NETWORK_PASSWORD"
}

Note: Replace NETWORK_SSID and NETWORK_PASSWORD with the wifi credentials.

Disconnect ethernet and run:

sudo ifdown wlan0
sudo ifup wlan0

You should be connected. Now test the connection status (ex: ping google.com).

Enable wifi connection after reboot

If you want to set the wifi as default connection after power on, follow these steps.

%sudo nano /etc/init.d/wifi.sh

add content:

#!/bin/bash
sudo ifdown wlan0
sudo ifup wlan0

Make it executable and register:

%sudo chmod +x /etc/init.d/wifi.sh
%sudo update-rc.d wifi.sh defaults 100

Every time the raspbmc boots up, it will automatically connect to the configured wireless access point.

Bye bye keyboard

Xbmc comes with a web interface, this allows us to control it without a keyboard. Just hit http://:8080/ from your ipad or laptop and start controlling. You can even use the official xbmc remotes for apple and android which are much better.

Nice, now you can have a standalone media center connected using wifi.

Comments