Sunday, June 3, 2012

USB wifi for Raspberry Pi

Here are steps for setting up the USB wifi adapter TP-LINK TL-WN722N on my Raspberry Pi:


  • Edit /etc/apt/sources.list and add deb http://ftp.us.debian.org/debian squeeze non-free at the end

  • sudo aptitude update

  • sudo aptitude install firmware-atheros

  • Download the firmware
    cd /lib/firmware
    sudo wget http://linuxwireless.org/download/htc_fw/1.3/htc_9271.fw

  • Protect the file /etc/network/interfaces
    sudo chmod 0600 /etc/network/interfaces

  • Edit /etc/network/interfaces
    sudo vi /etc/network/interfaces

  • Add the following lines. Note that I am using WEP. If you are using WPA, use the fields wpa-ssid and wpa-psk instead
    auto wlan0
    allow-hotplug wlan0
    iface wlan0 inet dhcp
            wireless-essid your-ssid
            wireless-key your-hex-key

  • Bring up the interface
    sudo ifup wlan0


About the performance. Using sftp to copy /dev/zero via wifi maxed out the CPU with transfer rate at around 1.6MB/s... maybe need to test the speed without encryption...






Reference: http://elinux.org/RPi_VerifiedPeripherals#Working_USB_Wifi_Adapters

4 comments:

Olivier said...

Thank you for this nice tutorial! I have a Raspberry Pi model B, with the latest xmbc version, and it appears you don't have to correct the sources.list and the command is apt-get (update, then install)
Thank you again, it's been really helpful!

Richard Kendell said...

I am new to the Pi and (very) confused and have problems with setting up wifi.
I can see how to enter

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wireless-essid your-ssid
wireless-key your-hex-key

in the LX terminal but cannot understand what I have to then enter to "Save" the changes. I am sure it is so simple that no one thinks to mention it but it escapes me! Can you help?
Also you appear to have spaces before "wireless" in you code are these necessary or optional?

Thanks

Richard

clarence said...

Hi Richard. vi is a text editor. If you are new to the command line environment, you may try the nano editor instead. It is more user-friendly

my simple mobile payment said...

Simple Mobile strives to make its service better every day. If you want unlimited nationwide and worldwide text? It’s done. If you want 4G speeds and a continually expanding coverage area? They have them. Plus, you can even keep your current smartphone and phone number without the stupid contract? Bottom line, simple mobile is here to help make it SIMPLE for you.