TL-WN722N usb wireless stick in Linux
Using TP-Link, TL-WN722N usb wifi dongle in Linux, you could use the dongle to access wifi hotspot or you could using it as a access point to provide wifi connectivity for other devices.
Hardware infomation
Software information
- OS: Slackware 13.37
Driver installation
Simply plug the stick will not work. First, it complain ar9271.fw not found. Although I found the fw file, the system having kernel core dump when loading the kernel module. Anyway, you should use the latest driver from Linux wireless to use the stick.
wget http://wireless.kernel.org/download/compat-wireless-2.6/compat-wireless-2.6.tar.bz2 tar -jxvf compat-wireless-2.6.tar.bz2 cd compat-wireless-2012-04-26/ ./scripts/driver-select ath9k_htc make make install
The kernel module will install into /lib/modules/2.6.37.6/updates, which won’t affect OS kernel module.
Anyway you may need reboot your machine after install the latest kernel modules.
Firmware
You system should complain Failed to get firmware htc_9271.fw. You could get the firmware by:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/dwmw2/linux-firmware.git cp htc_9271.fw /lib/firmware/
Your system could use the stick now. e.g., ifconfig wlan0 should give you something.
Linux WPA/WPA2/IEEE 802.1X Supplicant
To connect wifi router using WPA/WPA2,
- edit wpa_supplicant.conf
network={ scan_ssid=0 ssid="XYZ XYZ" proto=WPA RSN key_mgmt=WPA-PSK pairwise=CCMP TKIP group=CCMP TKIP WEP104 WEP40 # psk=your_64_char_psk_here psk=xxxxxxxxxxxxxxxxxxxxxxxxx priority=10 }
- psk could get from
wpa_passphrase 'XYZ XYZ' <psk secret>
- Connect the wifi router and get IP address
wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf dhcpcd -t 10 wlan0
Setup an Access Point
To set up an WPA/WPA2 access point using Linux,
- Get hostapd
- Build it
tar zxvf hostapd-0.7.3.tar.gz cd hostapd-0.7.3/hostapd cp defconfig .config
- Modify .config, suggested options:
CONFIG_DRIVER_NL80211=y CONFIG_IEEE80211N=y
- Modify hostapd.conf, suggested options:
interface=wlan0 ssid=xyzxyzxyz hw_mode=g channel=
wmm_enabled=1 ieee80211n=1 ht_capab=[HT40-][SHORT-GI-20][SHORT-GI-40] wpa=3 wpa_passphrase=<a share secret> wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP - Setup dhcpd.conf to offer dhcp function
subnet 192.168.66.0 netmask 255.255.255.0 { option domain-name-servers 192.168.66.1; option subnet-mask 255.255.255.0; option broadcast-address 192.168.66.255; option routers 192.168.66.1; range 192.168.66.100 192.168.66.200; max-lease-time 7200; default-lease-time 3600; }
- Start the AP now!
ifconfig wlan0 192.168.66.1 up /usr/sbin/dhcpd wlan0 ./hostapd hostapd.conf
make it