| 30 | |
| 31 | === Setting Up Wifi === |
| 32 | |
| 33 | [Installing TL-WN722N WiFi on the Pi - Directions taken from http://barntek.net/simplemachinesforum/index.php?topic=190.0] |
| 34 | |
| 35 | Edit /etc/apt/sources.list to add the non-free archive and backports (eg: sudo vi /etc/apt/sources.list): |
| 36 | {{{ |
| 37 | deb http://ftp.us.debian.org/debian/ squeeze main non-free |
| 38 | deb http://security.debian.org/ squeeze/updates main non-free |
| 39 | deb http://ftp.us.debian.org/debian/ squeeze-updates main non-free |
| 40 | deb http://backports.debian.org/debian-backports squeeze-backports main non-free |
| 41 | }}} |
| 42 | |
| 43 | Update the package cache: |
| 44 | |
| 45 | {{{ |
| 46 | sudo apt-get update |
| 47 | }}} |
| 48 | |
| 49 | Download the wifi utils: |
| 50 | {{{ |
| 51 | sudo apt-get install wireless-tools usbutils |
| 52 | }}} |
| 53 | |
| 54 | 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. |
| 55 | {{{ |
| 56 | sudo apt-get install firmware-atheros |
| 57 | sudo wget http://linuxwireless.org/download/htc_fw/1.3/htc_9271.fw |
| 58 | sudo cp htc_9271.fw /lib/firmware |
| 59 | }}} |
| 60 | |
| 61 | Add adapter definition to network config - eg: sudo vi /etc/network/interfaces - add the wlan0 section: |
| 62 | {{{ |
| 63 | # Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or |
| 64 | # /usr/share/doc/ifupdown/examples for more information. |
| 65 | |
| 66 | auto lo |
| 67 | |
| 68 | iface lo inet loopback |
| 69 | iface eth0 inet dhcp |
| 70 | |
| 71 | # The wireless interface |
| 72 | auto wlan0 |
| 73 | iface wlan0 inet dhcp |
| 74 | wpa-conf /etc/wpa.conf |
| 75 | }}} |
| 76 | |
| 77 | Plug in adapter |
| 78 | Confirm adapter is present: |
| 79 | {{{ |
| 80 | root@raspberrypi:~# sudo iwconfig |
| 81 | lo no wireless extensions. |
| 82 | |
| 83 | eth0 no wireless extensions. |
| 84 | |
| 85 | wlan0 IEEE 802.11bgn ESSID:off/any |
| 86 | Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm |
| 87 | Retry long limit:7 RTS thr:off Fragment thr:off |
| 88 | Encryption key:off |
| 89 | Power Management:off |
| 90 | }}} |
| 91 | 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: |
| 92 | |
| 93 | {{{ |
| 94 | sudo iwlist wlan0 scan | grep ESSID |
| 95 | }}} |
| 96 | or |
| 97 | |
| 98 | {{{ |
| 99 | sudo iwlist wlan0 scan |
| 100 | }}} |
| 101 | |
| 102 | Create the wpa.conf file - eg: sudo vi /etc/wpa.conf: |
| 103 | |
| 104 | Note: The ssid is case sensitive - if your WLAN's SSID is MYLAN, using "mylan" will not work - you won't connect! |
| 105 | {{{ |
| 106 | network={ |
| 107 | ssid="NETWORK-SSID" |
| 108 | proto=RSN |
| 109 | key_mgmt=WPA-PSK |
| 110 | pairwise=CCMP TKIP |
| 111 | group=CCMP TKIP |
| 112 | psk="YOUR-WLAN-PASSWORD" |
| 113 | } |
| 114 | }}} |
| 115 | Start the adapter |
| 116 | |
| 117 | {{{ |
| 118 | sudo ifup wlan0 |
| 119 | }}} |
| 120 | Double-check whether you are connected - below the WLAN interface has been given an IP address - looks good! |
| 121 | |
| 122 | {{{ |
| 123 | root@raspberrypi:~# ifconfig |
| 124 | eth0 Link encap:Ethernet HWaddr b8:27:eb:76:7e:2e |
| 125 | inet addr:192.168.202.75 Bcast:192.168.202.255 Mask:255.255.255.0 |
| 126 | UP BROADCAST RUNNING MULTICAST MTU:1488 Metric:1 |
| 127 | RX packets:1060 errors:0 dropped:0 overruns:0 frame:0 |
| 128 | TX packets:146 errors:0 dropped:0 overruns:0 carrier:0 |
| 129 | collisions:0 txqueuelen:1000 |
| 130 | RX bytes:95749 (93.5 KiB) TX bytes:48493 (47.3 KiB) |
| 131 | |
| 132 | lo Link encap:Local Loopback |
| 133 | inet addr:127.0.0.1 Mask:255.0.0.0 |
| 134 | UP LOOPBACK RUNNING MTU:16436 Metric:1 |
| 135 | RX packets:8 errors:0 dropped:0 overruns:0 frame:0 |
| 136 | TX packets:8 errors:0 dropped:0 overruns:0 carrier:0 |
| 137 | collisions:0 txqueuelen:0 |
| 138 | RX bytes:560 (560.0 B) TX bytes:560 (560.0 B) |
| 139 | |
| 140 | wlan0 Link encap:Ethernet HWaddr b0:48:7a:91:5c:f4 |
| 141 | inet addr:192.168.222.161 Bcast:192.168.222.255 Mask:255.255.255.0 |
| 142 | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 |
| 143 | RX packets:31 errors:0 dropped:0 overruns:0 frame:0 |
| 144 | TX packets:10 errors:0 dropped:0 overruns:0 carrier:0 |
| 145 | collisions:0 txqueuelen:1000 |
| 146 | RX bytes:2260 (2.2 KiB) TX bytes:1542 (1.5 KiB) |
| 147 | }}} |