Setting Up a USB WiFi Dongle on Raspberry Pi Arch

For my AirPi, I needed to make my Raspberry Pi wireless. Being the man of thrift that I am, I found the cheapest dongle on eBay: a (Digitaz) RaLink RT5370.

Now Arch isn’t exactly plug and play, but that’s part of the fun. Plugging it in, the only way you’ll know it is there is using:

Linux includes module for RaLink adaptors: ‘rt2x00usb’ and it turns out that they work with this adaptor too. Getting it running is a simple case of installing ‘wireless_tools’, then rebooting and letting udev do its thing and load the module up. Using lsmod it appears that ‘rt2x00usb’, ‘rt2x00lib’, ‘rt2800lib’ and ‘rt2800usb’ are all loaded, so you can use modprobe and load this modules manually.

wpa-supplicant

You’ve got the adaptor connected, the process of actually using it to join a network require a few more steps. Start by the details of the network that you want to join to /etc/wpa_supplicant.conf, this is best achieved using wpa_passphrase, which converts the password to hex for you.

Now bring the wireless device up (change wlan0 to your device).

Then get wpa_supplicant to associate the adaptor with the first available network inf wpa_supplicant.conf.

The last thing to do is get an ip address using dhcp.

Connecting at Boot

All of the above will require repeating on each reboot. To do this automatically, add the above to a script and add it to /etc/rc.local. Here is mine, which I placed in /usr/local/sbin/wireless_up.sh

UPDATE 02/01/2013
The cross-through was pre-systemd being used as the service manager. Follow the instructions on the Arch wiki to set-up boot on current builds: https://wiki.archlinux.org/index.php/Wireless#Manual_wireless_connection_at_boot_using_systemd

Basically:

cropped-JBRLogo.png

4 thoughts on “Setting Up a USB WiFi Dongle on Raspberry Pi Arch”

    1. Thanks for providing that link. I’ve encountered the systemd transistion from rc.d on my RPi Airplay post but forgot to update this one. I’ll add in an update with that link.

Leave a Reply