Raspberry Pi WiFi configuration

Here’s a short tutorial on how to quickly setup WiFi on your RasPi.
I’m using Atheros based TP-LINK TL-WN721N USB adapter – good and cheap.

You can skip firmware-related steps if your card doesn’t need it (like Realtek-based TL-WN725N).

  1. Download firmware from: http://linuxwireless.org/download/htc_fw/1.3/htc_9271.fw
  2. Copy firmware file to /lib/firmware
  3. Install wireless-tools and wpasupplicant
  4. Create /etc/wpa_supplicant.conf file:
    ctrl_interface=/var/run/wpa_supplicant
    ctrl_interface_group=0
    
    # WPA2-PSK network
    network={
      ssid="network_name"
      scan_ssid=1
      proto=WPA2
      key_mgmt=WPA-PSK
      pairwise=CCMP TKIP
      group=CCMP TKIP
      psk=encrypted_key # generate using wpa_passphrase
    }
    
    # Simple WEP protected network
    network={
      ssid="network_name"
      key_mgmt=NONE
      wep_key0=your_wep_key
      wep_tx_keyidx=0
      priority=5
    }
    
  5. Edit /etc/network/interfaces and add:
    auto wlan0
    iface wlan0 inet dhcp
    pre-up wpa_supplicant -Dwext -i wlan0 -c /etc/wpa_supplicant.conf -B
    
  6. Restart networking or reboot:
    # service networking restart
    

3 thoughts on “Raspberry Pi WiFi configuration

  1. Clark Updike

    Just wanted to say thanks for posting this. The built-in wpa_gui on the desktop (after a startx) was flaky–settings changes didn’t seem to stick. But these directions worked and that was without installing anything for the latest version of raspbian anyway (7-26-13 version of wheezy). So I was able to get my pi on the net via wireless and without any prior wired connection required… nice!

    Reply
  2. Ryan

    Thanks for posting this. This post was “step 2” for me to get wifi up and running, though I used the nano adapter (TL-WN725N v2).

    uname -a
    Linux ryspberry-pi 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux

    I installed the driver using the directions here:
    http://www.raspberrypi.org/phpBB3/viewtopic.php?t=52932&p=417683
    (Specifically MrEngman’s post dated “Mon Sep 09, 2013 3:20 pm”)

    MrEngman’s post installed the driver, then this post got me through the configuration.

    I’ve used /etc/network/interfaces for wired networking before, but never with wpa_supplicant.

    Regards!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.