Difference between revisions of "RPi Peripherals"

From eLinux.org
Jump to: navigation, search
(Wireless: TP-Link TL-WN722N USB wireless adapter (Debian 6))
(Wireless: TP-Link TL-WN722N USB wireless adapter (Debian 6))
Line 76: Line 76:
 
</pre>
 
</pre>
  
* Scan your network to see what wireless access points can be seen. You may need to do this to identify your network's SSID (name), but it also confirms that the wifi dongle is doing something:
+
* Scan your network to see what wireless access points can be seen. You may need to do this to identify your network's SSID (name), but it also confirms that the wifi dongle is doing something. The first command just lists the SSIDs found, the second tells you probably more than you ever want to know:
  
 
<pre>
 
<pre>
iwlist scan
+
  sudo iwlist wlan0 scan | grep ESSID
 +
</pre>
 +
or
 +
<pre>
 +
  sudo iwlist wlan0 scan
 
</pre>
 
</pre>
  

Revision as of 04:29, 17 April 2012

Setup examples for various peripherals

Wireless: TP-Link TL-WN722N USB wireless adapter (Debian 6)

IMPORTANT NOTE: Although I thought I'd got this particular TP-Link adapter working, it's not actually connecting to the network (Damn! Working on it), but I'm leaving this info here as it will be useful to others, but do check the hardware compatibility list to ensure your dongle is supported. Linker3000

See also:

http://www.element14.com/community/docs/DOC-44703/l/raspberry-pi-wifi-adapter-testing

http://omer.me/2012/04/setting-up-wireless-networks-under-debian-on-raspberry-pi/

This will serve as a general guide for USB wireless devices but may need modifying for your specific one.

  • Edit /etc/apt/sources.list to add the non-free archive and backports (eg: sudo vi /etc/apt/sources.list):
 deb http://ftp.us.debian.org/debian/ squeeze main non-free
 deb http://security.debian.org/ squeeze/updates main non-free
 deb http://ftp.us.debian.org/debian/ squeeze-updates main non-free
 deb http://backports.debian.org/debian-backports squeeze-backports main non-free
  • Update the package cache:
 sudo apt-get update
  • Download the wifi utils:
 sudo apt-get install wireless-tools usbutils 
  • Download the required firmware and put it in the correct location - you may not need to do this for your adapter or you may need different firmware - see below.
 sudo apt-get install firmware-atheros
 sudo wget http://linuxwireless.org/download/htc_fw/1.3/htc_9271.fw
 sudo cp htc_9271.fw /lib/firmware
  • Add adapter definition to network config - eg: sudo vi /etc/network/interfaces - add the wlan0 section:
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.

auto lo

iface lo inet loopback
iface eth0 inet dhcp

# The wireless interface
auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa.conf
  • Plug in adapter
  • Confirm adapter is present:
 root@raspberrypi:~# iwconfig
  lo        no wireless extensions.

  eth0      no wireless extensions.

  wlan0     IEEE 802.11bgn  ESSID:off/any
            Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm
            Retry  long limit:7   RTS thr:off   Fragment thr:off
            Encryption key:off
            Power Management:off
  • Scan your network to see what wireless access points can be seen. You may need to do this to identify your network's SSID (name), but it also confirms that the wifi dongle is doing something. The first command just lists the SSIDs found, the second tells you probably more than you ever want to know:
  sudo iwlist wlan0 scan | grep ESSID

or

  sudo iwlist wlan0 scan
  • Create the wpa.conf file - eg: sudo vi /etc/wpa.conf:
network={
ssid="NETWORK-SSID"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="YOUR-WLAN-PASSWORD"
}
  • Start the adapter
  sudo ifup wlan0

If you are now connected, well done! If not, check your editing and also have a look at the output of dmesg to see if you have any error messages.

Firmware requirements

If no wlanx device is shown, you might need to download firmware for your USB wifi device (or track down other compatible drivers if they are available). To confirm this, check the dmesg output when you plug in your adapter - typing dmesg at the command prompt may be sufficient - and look for information related to your adapter - the example dmesg output below shows what is seen in the event of the TP-Link firmware not being present - notice that the name of the required firmware file is given (htc_9271.fw), the driver name (ath9k_htc) and an error -22 message:

  usb 1-1.2.4.2: ath9k_htc: Firmware - htc_9271.fw not found
  ath9k_htc: probe of 1-1.2.4.2:1.0 failed with error -22
  usbcore: registered new interface driver ath9k_htc

Armed with this information, try a web search for 'debian 6' and the name of the driver or driver file and/or head over to http://linuxwireless.org. Also check the links at the top of this page.