TP-LINK TL-WN721N wireless adapter [SOLVED]

My laptop has a Ralink wireless adapter, which sometimes causes problems. So I bought a USB wireless adapter TL-WN721N, but I do not know how to use it. Can someone help me? The system is Ubuntu 12.04 3.2.0-40-generic.

After running

sudo lshw -C network;ifconfig;iwconfig;iwlist scanning;rfkill list

we have

[quote]
*-network
description: Ethernet interface
product: RTL8111/8168B PCI Express Gigabit Ethernet controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:03:00.0
logical name: eth0
version: 07
serial: 2c:d4:44:b6:ee:dc
size: 10Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8168e-3_0.0.4 03/27/12 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
resources: irq:43 ioport:3000(size=256) memory:f1404000-f1404fff memory:f1400000-f1403fff
*-network
description: Wireless interface
product: Ralink corp.
vendor: Ralink corp.
physical id: 0
bus info: pci@0000:04:00.0
logical name: ra0
version: 00
serial: 24:ec:99:4d:3e:32
width: 32 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=RALINK WLAN ip=192.168.1.2 latency=0 multicast=yes wireless=Ralink STA
resources: irq:18 memory:f1d10000-f1d1ffff
eth0 Link encap:Ethernet HWaddr 2c:d4:44:b6:ee:dc
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:43 Base address:0x4000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8428 errors:0 dropped:0 overruns:0 frame:0
TX packets:8428 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1451074 (1.4 MB) TX bytes:1451074 (1.4 MB)

ra0 Link encap:Ethernet HWaddr 24:ec:99:4d:3e:32
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::26ec:99ff:fe4d:3e32/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1485474 errors:3 dropped:0 overruns:0 frame:0
TX packets:699445 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1638820530 (1.6 GB) TX bytes:86808639 (86.8 MB)
Interrupt:18

lo no wireless extensions.

ra0 Ralink STA ESSID:“jinjiefu” Nickname:“RT3290STA”
Mode:Managed Frequency=2.412 GHz Access Point: 00:23:CD:17:A4:38
Bit Rate=135 Mb/s
RTS thr:off Fragment thr:off
Link Quality=83/100 Signal level:-60 dBm Noise level:-84 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

eth0 no wireless extensions.

lo Interface doesn’t support scanning.

ra0 Scan completed :
Cell 01 - Address: 00:23:CD:17:A4:38
Protocol:802.11b/g/n
ESSID:“jinjiefu”
Mode:Managed
Frequency:2.412 GHz (Channel 1)
Quality=76/100 Signal level=-60 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
Cell 02 - Address: 98:FC:11:B7:B9:BE
Protocol:802.11b/g/n
ESSID:“USER-VAIO_Network”
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality=39/100 Signal level=-74 dBm Noise level=-69 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Preauthentication Supported
IE: Unknown: DD0E0050F204104A0001101044000102
Cell 03 - Address: 00:11:6B:2B:73:F2
Protocol:802.11b/g/n
ESSID:“fuckyou”
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality=55/100 Signal level=-68 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD270050F204104A000110104400010210470010000400000000C0A8000100116B2B73F2103C000101
Cell 04 - Address: 90:F6:52:A5:53:26
Protocol:802.11b/g/n
ESSID:“chow home”
Mode:Managed
Frequency:2.452 GHz (Channel 9)
Quality=24/100 Signal level=-80 dBm Noise level=-75 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
Cell 05 - Address: 90:F6:52:84:6D:DC
Protocol:802.11b/g/n
ESSID:“YUEN”
Mode:Managed
Frequency:2.452 GHz (Channel 9)
Quality=5/100 Signal level=-88 dBm Noise level=-83 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD0E0050F204104A0001101044000102
Cell 06 - Address: 00:22:3F:13:05:1A
Protocol:802.11b/g
ESSID:“NETGEAR”
Mode:Managed
Frequency:2.412 GHz (Channel 1)
Quality=10/100 Signal level=-86 dBm Noise level=-81 dBm
Encryption key:off
Bit Rates:54 Mb/s
Cell 07 - Address: C8:D1:5E:FF:0D:34
Protocol:802.11b/g/n
ESSID:“jimjim147”
Mode:Managed
Frequency:2.452 GHz (Channel 9)
Quality=5/100 Signal level=-88 dBm Noise level=-83 dBm
Encryption key:on
Bit Rates:135 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD270050F204104A0001101044000102104700102880288028801880A880C8D15EFF0D34103C000101
Cell 08 - Address: 54:E6:FC:EB:68:C2
Protocol:802.11b/g/n
ESSID:“ChingChing”
Mode:Managed
Frequency:2.427 GHz (Channel 4)
Quality=0/100 Signal level=-90 dBm Noise level=-85 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD0E0050F204104A0001101044000102
Cell 09 - Address: A0:F3:C1:56:B4:BA
Protocol:802.11b/g/n
ESSID:“MERCUSYS_56B4BA”
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality=10/100 Signal level=-86 dBm Noise level=-81 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: Unknown: DD0E0050F204104A0001101044000102
Cell 10 - Address: 00:22:93:26:A4:72
Protocol:802.11b/g
ESSID:“williamcoverdal”
Mode:Managed
Frequency:2.422 GHz (Channel 3)
Quality=65/100 Signal level=-64 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Cell 11 - Address: 52:E6:76:64:E9:74
Protocol:802.11b/g/n
ESSID:“4CE67664E974-1”
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality=0/100 Signal level=-92 dBm Noise level=-87 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Cell 12 - Address: 20:CF:30:B8:3C:10
Protocol:802.11b/g/n
ESSID:“Laputa2.4”
Mode:Managed
Frequency:2.472 GHz (Channel 13)
Quality=20/100 Signal level=-82 dBm Noise level=-77 dBm
Encryption key:on
Bit Rates:144 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Cell 13 - Address: 00:21:27:DC:87:08
Protocol:802.11b/g
ESSID:“TP-LINKAAT”
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality=5/100 Signal level=-88 dBm Noise level=-83 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
Preauthentication Supported
Cell 14 - Address: 4C:ED:DE:92:F0:07
Protocol:802.11b/g/n
ESSID:“”
Mode:Managed
Frequency:2.452 GHz (Channel 9)
Quality=0/100 Signal level=-90 dBm Noise level=-85 dBm
Encryption key:on
Bit Rates:130 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
Cell 15 - Address: 54:E6:FC:C9:7F:F2
Protocol:802.11b/g/n
ESSID:“TP-LINK_daniel”
Mode:Managed
Frequency:2.472 GHz (Channel 13)
Quality=0/100 Signal level=-94 dBm Noise level=-89 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD0E0050F204104A0001101044000102
Cell 16 - Address: 90:F6:52:6A:D3:AA
Protocol:802.11b/g/n
ESSID:“Chris”
Mode:Managed
Frequency:2.427 GHz (Channel 4)
Quality=0/100 Signal level=-90 dBm Noise level=-85 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: Unknown: DD0E0050F204104A0001101044000102
Cell 17 - Address: 4C:E6:76:64:E9:74
Protocol:802.11b/g/n
ESSID:“4CE67664E974-2”
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality=0/100 Signal level=-90 dBm Noise level=-85 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: Unknown: DD220050F204104A000110104400010210470010E586ABB2F69A11DE8C6083608C225558
Cell 18 - Address: 10:6F:3F:3D:AE:E6
Protocol:802.11b/g/n
ESSID:“LCK-ROUTER”
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality=5/100 Signal level=-88 dBm Noise level=-83 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD220050F204104A000110104400010210470010D713E364343D11E1882607C6205F9FC3
Cell 19 - Address: 68:7F:74:E7:FA:63
Protocol:802.11b/g
ESSID:“CEDARS-WRT54G-16”
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality=0/100 Signal level=-92 dBm Noise level=-87 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Preauthentication Supported
IE: Unknown: DD0E0050F204104A0001101044000102
Cell 20 - Address: D8:5D:4C:A7:41:0C
Protocol:802.11b/g
ESSID:“TP-LINK_A7410C”
Mode:Managed
Frequency:2.442 GHz (Channel 7)
Quality=0/100 Signal level=-90 dBm Noise level=-85 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: Unknown: DD0E0050F204104A0001101044000102
Cell 21 - Address: C8:3A:35:58:23:70
Protocol:802.11b/g/n
ESSID:“NicksHome”
Mode:Managed
Frequency:2.412 GHz (Channel 1)
Quality=15/100 Signal level=-84 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:300 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
Preauthentication Supported
Cell 22 - Address: B4:B3:62:77:A6:6D
Protocol:802.11b/g/n
ESSID:“mohammedzaid”
Mode:Managed
Frequency:2.442 GHz (Channel 7)
Quality=29/100 Signal level=-78 dBm Noise level=-73 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Cell 23 - Address: BA:B3:62:77:A6:6D
Protocol:802.11b/g
ESSID:“”
Mode:Managed
Frequency:2.442 GHz (Channel 7)
Quality=39/100 Signal level=-74 dBm Noise level=-69 dBm
Encryption key:on
Bit Rates:54 Mb/s
Cell 24 - Address: F8:1A:67:AD:3E:FA
Protocol:802.11b/g/n
ESSID:“MS LEE”
Mode:Managed
Frequency:2.452 GHz (Channel 9)
Quality=0/100 Signal level=-92 dBm Noise level=-87 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD260050F204104A0001101044000102104900140024E26002000101600000020001600100020001
Cell 25 - Address: 74:EA:3A:C4:D7:4E
Protocol:802.11b/g
ESSID:“ALICE-HP_Network”
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality=0/100 Signal level=-92 dBm Noise level=-87 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: Unknown: DD0E0050F204104A0001101044000102
Cell 26 - Address: 00:22:B0:CB:BD:C5
Protocol:802.11b/g/n
ESSID:“Faith”
Mode:Managed
Frequency:2.472 GHz (Channel 13)
Quality=0/100 Signal level=-92 dBm Noise level=-87 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: Unknown: DD0E0050F204104A0001101044000102
Cell 27 - Address: 4C:E6:76:CC:EA:15
Protocol:802.11b/g/n
ESSID:“4CE676CCEA15”
Mode:Managed
Frequency:2.412 GHz (Channel 1)
Quality=5/100 Signal level=-88 dBm Noise level=-83 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD220050F204104A000110104400010210470010E586BBB6F69A11DE87C9D1F679FF788F
Cell 28 - Address: B6:74:9F:53:56:93
Protocol:802.11b/g/n
ESSID:“”
Mode:Managed
Frequency:2.412 GHz (Channel 1)
Quality=10/100 Signal level=-86 dBm Noise level=-81 dBm
Encryption key:on
Bit Rates:130 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Cell 29 - Address: 00:1F:33:DE:2E:1C
Protocol:802.11b/g/n
ESSID:“JACKY”
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality=0/100 Signal level=-92 dBm Noise level=-87 dBm
Encryption key:on
Bit Rates:270 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
IE: Unknown: DD0E0050F204104A0001101044000102
Cell 30 - Address: F8:D1:11:84:40:E8
Protocol:802.11b/g/n
ESSID:“whoomp”
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality=5/100 Signal level=-88 dBm Noise level=-83 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD3F0050F204104A00011010440001021047001000000000000010000000F8D111844010103C000101104900140024E26002000101600000020001600100020001
Cell 31 - Address: BE:B3:62:70:1D:39
Protocol:802.11b/g
ESSID:“”
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality=0/100 Signal level=-90 dBm Noise level=-85 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
Cell 32 - Address: C8:60:00:AD:30:74
Protocol:802.11b/g
ESSID:“Marco’s PC”
Mode:Managed
Frequency:2.447 GHz (Channel 8)
Quality=10/100 Signal level=-86 dBm Noise level=-81 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD0E0050F204104A0001101044000102
Cell 33 - Address: 00:22:93:3F:C7:CF
Protocol:802.11b/g
ESSID:“”
Mode:Managed
Frequency:2.452 GHz (Channel 9)
Quality=15/100 Signal level=-84 dBm Noise level=-79 dBm
Encryption key:on
Bit Rates:54 Mb/s
Cell 34 - Address: 08:86:3B:08:A5:F8
Protocol:802.11b/g/n
ESSID:“NIKLEB”
Mode:Managed
Frequency:2.412 GHz (Channel 1)
Quality=5/100 Signal level=-88 dBm Noise level=-93 dBm
Encryption key:on
Bit Rates:300 Mb/s
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Cell 35 - Address: 00:22:93:26:A4:74
Protocol:802.11b/g
ESSID:“”
Mode:Managed
Frequency:2.422 GHz (Channel 3)
Quality=65/100 Signal level=-64 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:54 Mb/s
Cell 36 - Address: 00:25:86:CD:1F:0E
Protocol:802.11b/g
ESSID:“TP-LINK_CD1F0E”
Mode:Managed
Frequency:2.427 GHz (Channel 4)
Quality=0/100 Signal level=-94 dBm Noise level=-89 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
Preauthentication Supported
Cell 37 - Address: B0:48:7A:FD:A9:64
Protocol:802.11b/g
ESSID:“THOME”
Mode:Managed
Frequency:2.427 GHz (Channel 4)
Quality=0/100 Signal level=-92 dBm Noise level=-87 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: Unknown: DD0E0050F204104A0001101044000101
Cell 38 - Address: 64:70:02:92:2F:5A
Protocol:802.11b/g/n
ESSID:“ideal home”
Mode:Managed
Frequency:2.437 GHz (Channel 6)
Quality=0/100 Signal level=-94 dBm Noise level=-89 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD0E0050F204104A0001101044000101
Cell 39 - Address: 68:7F:74:FD:AD:0A
Protocol:802.11b/g
ESSID:“CEDARS-WRT54G-18”
Mode:Managed
Frequency:2.452 GHz (Channel 9)
Quality=0/100 Signal level=-90 dBm Noise level=-85 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: Unknown: DD0E0050F204104A0001101044000102
Cell 40 - Address: B4:B3:62:79:0E:8D
Protocol:802.11b/g/n
ESSID:“sweetapple”
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality=24/100 Signal level=-80 dBm Noise level=-75 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : CCMP TKIP
Authentication Suites (1) : PSK
Cell 41 - Address: 5A:E6:76:64:E9:74
Protocol:802.11b/g
ESSID:“4CE67664E974”
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality=10/100 Signal level=-86 dBm Noise level=-81 dBm
Encryption key:on
Bit Rates:54 Mb/s
Cell 42 - Address: 00:25:12:63:F9:DE
Protocol:802.11b/g
ESSID:“”
Mode:Managed
Frequency:2.417 GHz (Channel 2)
Quality=10/100 Signal level=-86 dBm Noise level=-81 dBm
Encryption key:on
Bit Rates:54 Mb/s
Cell 43 - Address: 00:15:EB:60:4E:06
Protocol:802.11b/g
ESSID:“”
Mode:Managed
Frequency:2.422 GHz (Channel 3)
Quality=55/100 Signal level=-68 dBm Noise level=-92 dBm
Encryption key:on
Bit Rates:54 Mb/s
Cell 44 - Address: 00:22:93:3E:A4:07
Protocol:802.11b/g
ESSID:“Model Genesis 9”
Mode:Managed
Frequency:2.427 GHz (Channel 4)
Quality=0/100 Signal level=-94 dBm Noise level=-89 dBm
Encryption key:on
Bit Rates:54 Mb/s
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Cell 45 - Address: BE:B3:62:77:A6:6D
Protocol:802.11b/g/n
ESSID:“”
Mode:Managed
Frequency:2.442 GHz (Channel 7)
Quality=29/100 Signal level=-78 dBm Noise level=-73 dBm

Can you explain what the problem appears to be … according to your output, the card appears to be working, connected to the “jinjiefu” access point, and also detecting another 44 different access points.
(where are you where there’s 45 access points in range ?)

Can you also post the output from:

lsusb

My original wireless card is working. But my problem is now I want to use a USB wireless card.

Here is the output of “lsusb”:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 003: ID 04f2:b319 Chicony Electronics Co., Ltd Bus 002 Device 003: ID 08ff:2683 AuthenTec, Inc. Bus 003 Device 002: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse Bus 003 Device 003: ID 05ac:1265 Apple, Inc. iPod Nano 5.Gen Bus 003 Device 004: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n

Unless you disable (in BIOS or with hardware switch) the built in wireless card will take precedence over the plug in adaptor.
If you can not disable, then remove it :slight_smile:

Was the tplink plugged in when you ran that “lsusb” ?

Yes.

and was the internal wireless adapter disabled ?

I rerun the command “sudo lshw -C network;ifconfig;iwconfig;iwlist scanning;rfkill list” after shutting down the internal one and get

*-network description: Ethernet interface product: RTL8111/8168B PCI Express Gigabit Ethernet controller vendor: Realtek Semiconductor Co., Ltd. physical id: 0 bus info: pci@0000:03:00.0 logical name: eth0 version: 07 serial: 2c:d4:44:b6:ee:dc size: 10Mbit/s capacity: 1Gbit/s width: 64 bits clock: 33MHz capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8168e-3_0.0.4 03/27/12 latency=0 link=no multicast=yes port=MII speed=10Mbit/s resources: irq:43 ioport:3000(size=256) memory:f1404000-f1404fff memory:f1400000-f1403fff *-network description: Wireless interface product: Ralink corp. vendor: Ralink corp. physical id: 0 bus info: pci@0000:04:00.0 logical name: ra0 version: 00 serial: 24:ec:99:4d:3e:32 width: 32 bits clock: 33MHz capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless configuration: broadcast=yes driver=RALINK WLAN latency=0 multicast=yes wireless=Ralink STA resources: irq:18 memory:f1d10000-f1d1ffff eth0 Link encap:Ethernet HWaddr 2c:d4:44:b6:ee:dc UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:43 Base address:0x4000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2273 errors:0 dropped:0 overruns:0 frame:0
TX packets:2273 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:370131 (370.1 KB) TX bytes:370131 (370.1 KB)

ra0 Link encap:Ethernet HWaddr 24:ec:99:4d:3e:32
inet6 addr: fe80::26ec:99ff:fe4d:3e32/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:106811 errors:1 dropped:0 overruns:0 frame:0
TX packets:31947 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:39790892 (39.7 MB) TX bytes:18498026 (18.4 MB)
Interrupt:18

lo no wireless extensions.

ra0 Ralink STA ESSID:“” Nickname:“RT3290STA”
Mode:Auto Frequency=2.412 GHz Access Point: 00:23:CD:17:A4:38
Bit Rate=1 Mb/s
RTS thr:off Fragment thr:off
Link Quality=86/100 Signal level:0 dBm Noise level:0 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

eth0 no wireless extensions.

lo Interface doesn’t support scanning.

ra0 No scan results

eth0 Interface doesn’t support scanning.

With the tplink plugged in, what’s the output from:

lsmod | grep ath9k

?

ath9k_htc 92738 0 mac80211 506862 1 ath9k_htc ath9k_common 14053 1 ath9k_htc ath9k_hw 411239 2 ath9k_htc,ath9k_common ath 24067 3 ath9k_htc,ath9k_common,ath9k_hw cfg80211 205774 3 ath9k_htc,mac80211,ath

Can you send the output from:

lsmod

Can you then unplug the tplink … wait 10 seconds … replug the tplink … then send the output from:

dmesg | tail -n 40

lsmod:

Module Size Used by ath9k_htc 92738 0 mac80211 506862 1 ath9k_htc ath9k_common 14053 1 ath9k_htc ath9k_hw 411239 2 ath9k_htc,ath9k_common ath 24067 3 ath9k_htc,ath9k_common,ath9k_hw cfg80211 205774 3 ath9k_htc,mac80211,ath nls_iso8859_1 12713 0 nls_cp437 16991 0 vfat 17585 0 fat 61512 1 vfat usb_storage 49243 0 rfcomm 47604 0 joydev 17693 0 parport_pc 32866 0 ppdev 17113 0 lp 17799 0 parport 46562 3 parport_pc,ppdev,lp snd_hda_codec_hdmi 32474 1 snd_hda_codec_realtek 224173 1 bnep 18281 2 bluetooth 180153 10 rfcomm,bnep binfmt_misc 17540 1 snd_hda_intel 33719 3 snd_hda_codec 127706 3 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel snd_hwdep 17764 1 snd_hda_codec usbhid 47238 0 hid 99636 1 usbhid i915 477748 3 snd_pcm 97275 3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec snd_seq_midi 13324 0 snd_rawmidi 30748 1 snd_seq_midi snd_seq_midi_event 14899 1 snd_seq_midi snd_seq 61929 2 snd_seq_midi,snd_seq_midi_event fujitsu_laptop 18992 0 snd_timer 29990 2 snd_pcm,snd_seq snd_seq_device 14540 3 snd_seq_midi,snd_rawmidi,snd_seq mac_hid 13253 0 uvcvideo 72627 0 nouveau 775039 0 snd 79041 16 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device videodev 98259 1 uvcvideo v4l2_compat_ioctl32 17128 1 videodev dm_multipath 23275 0 ttm 76949 1 nouveau drm_kms_helper 46978 2 i915,nouveau psmouse 97485 0 rt3290sta 1182379 1 drm 241971 6 i915,nouveau,ttm,drm_kms_helper serio_raw 13211 0 soundcore 15091 1 snd snd_page_alloc 18529 2 snd_hda_intel,snd_pcm i2c_algo_bit 13423 2 i915,nouveau mxm_wmi 13021 1 nouveau mei 41616 0 wmi 19256 1 mxm_wmi video 19651 2 i915,nouveau dm_raid45 78155 0 r8169 62154 0 xor 12894 1 dm_raid45 dm_mirror 22203 0 dm_region_hash 20961 1 dm_mirror dm_log 18564 3 dm_raid45,dm_mirror,dm_region_hash jiaweihuo@jiaweihuo-LIFEBOOK-LH772:~$ lsmod Module Size Used by ath9k_htc 92738 0 mac80211 506862 1 ath9k_htc ath9k_common 14053 1 ath9k_htc ath9k_hw 411239 2 ath9k_htc,ath9k_common ath 24067 3 ath9k_htc,ath9k_common,ath9k_hw cfg80211 205774 3 ath9k_htc,mac80211,ath nls_iso8859_1 12713 0 nls_cp437 16991 0 vfat 17585 0 fat 61512 1 vfat usb_storage 49243 0 rfcomm 47604 0 joydev 17693 0 parport_pc 32866 0 ppdev 17113 0 lp 17799 0 parport 46562 3 parport_pc,ppdev,lp snd_hda_codec_hdmi 32474 1 snd_hda_codec_realtek 224173 1 bnep 18281 2 bluetooth 180153 10 rfcomm,bnep binfmt_misc 17540 1 snd_hda_intel 33719 3 snd_hda_codec 127706 3 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel snd_hwdep 17764 1 snd_hda_codec usbhid 47238 0 hid 99636 1 usbhid i915 477748 3 snd_pcm 97275 3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec snd_seq_midi 13324 0 snd_rawmidi 30748 1 snd_seq_midi snd_seq_midi_event 14899 1 snd_seq_midi snd_seq 61929 2 snd_seq_midi,snd_seq_midi_event fujitsu_laptop 18992 0 snd_timer 29990 2 snd_pcm,snd_seq snd_seq_device 14540 3 snd_seq_midi,snd_rawmidi,snd_seq mac_hid 13253 0 uvcvideo 72627 0 nouveau 775039 0 snd 79041 16 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device videodev 98259 1 uvcvideo v4l2_compat_ioctl32 17128 1 videodev dm_multipath 23275 0 ttm 76949 1 nouveau drm_kms_helper 46978 2 i915,nouveau psmouse 97485 0 rt3290sta 1182379 1 drm 241971 6 i915,nouveau,ttm,drm_kms_helper serio_raw 13211 0 soundcore 15091 1 snd snd_page_alloc 18529 2 snd_hda_intel,snd_pcm i2c_algo_bit 13423 2 i915,nouveau mxm_wmi 13021 1 nouveau mei 41616 0 wmi 19256 1 mxm_wmi video 19651 2 i915,nouveau dm_raid45 78155 0 r8169 62154 0 xor 12894 1 dm_raid45 dm_mirror 22203 0 dm_region_hash 20961 1 dm_mirror dm_log 18564 3 dm_raid45,dm_mirror,dm_region_hash

dmesg | tail -n 40:

[ 3037.868451] ==> RTMPWlan 1, bPCIclkOff = 0, pAd->WlanFunCtrl.word = 0xff000020 [ 3037.868456] ==> RTMPWlan 1, bPCIclkOff = 0, WlanFunCtrl.word = 0xff000021 [ 3037.868747] <== RTMPWlan 1 bPCIclkOff = 0 pAd->WlanFunCtrl.word = 0xff000023 [ 3037.868765] PllCtrl:0x2695555 [ 3037.870111] RX DESC ffff880036c5f000 size = 2048 [ 3037.870533] RTMP_TimerListAdd: add timer obj ffffc90005d4bd60! [ 3037.870539] RTMP_TimerListAdd: add timer obj ffffc90005d4bdd0! [ 3037.870542] RTMP_TimerListAdd: add timer obj ffffc90005d4be40! [ 3037.870546] RTMP_TimerListAdd: add timer obj ffffc90005d4bcf0! [ 3037.870550] RTMP_TimerListAdd: add timer obj ffffc90005d4bba0! [ 3037.870553] RTMP_TimerListAdd: add timer obj ffffc90005d4bc10! [ 3037.870556] RTMP_TimerListAdd: add timer obj ffffc90005d15d20! [ 3037.870559] RTMP_TimerListAdd: add timer obj ffffc90005d15d90! [ 3037.870561] RTMP_TimerListAdd: add timer obj ffffc90005d15c38! [ 3037.870564] RTMP_TimerListAdd: add timer obj ffffc90005d04b30! [ 3037.870567] RTMP_TimerListAdd: add timer obj ffffc90005d04ba8! [ 3037.870571] RTMP_TimerListAdd: add timer obj ffffc90005d15b58! [ 3037.870575] RTMP_TimerListAdd: add timer obj ffffc90005d15e20! [ 3037.872575] BBP_R105: BBPR105.field.EnableSIGRemodulation = 1, BBPR105.field.MLDFor2Stream = 0 [ 3037.873491] CfgSetCountryRegion():CountryRegion in eeprom was programmed [ 3037.873724] Key1Str is Invalid key length(0) or Type(0) [ 3037.873743] Key2Str is Invalid key length(0) or Type(0) [ 3037.873763] Key3Str is Invalid key length(0) or Type(0) [ 3037.873783] Key4Str is Invalid key length(0) or Type(0) [ 3037.874153] 1. Phy Mode = 9 [ 3037.874155] 2. Phy Mode = 9 [ 3037.874163] NVM is Efuse and its size =1e[1e0-1fd] [ 3037.875509] 3. Phy Mode = 9 [ 3037.875548] \x1b[mAntCfgInit: primary/secondary ant 0/1 [ 3037.875550] \x1b[mRTMPSetPhyMode: channel is out of range, use first channel=1 [ 3037.889974] MCS Set = ff 00 00 00 01 [ 3037.889982] <==== rt28xx_init, Status=0 [ 3037.890042] 0x1300 = 00064300 [ 3037.890044] RTMPrt3xSetPCIePowerLinkCtrl.===> 1e [ 3090.818998] usb 3-4: USB disconnect, device number 9 [ 3126.032352] usb 3-4: new high-speed USB device number 10 using xhci_hcd [ 3126.342829] usb 3-4: ath9k_htc: Transferred FW: htc_9271.fw, size: 51272 [ 3126.343019] xhci_hcd 0000:00:14.0: ERROR no room on ep ring [ 3126.345956] usb 3-4: ath9k_htc: Unable to allocate URBs [ 3126.346005] ath9k_htc: probe of 3-4:1.0 failed with error -22

Can you try putting the tplink into a different USB port … if it’s currently in a USB hub, move it to a “proper” USB port.
then send the output from:

dmesg | tail -n 20
[ 4352.864403] usb 3-3: ath9k_htc: Unable to allocate URBs [ 4352.864449] ath9k_htc: probe of 3-3:1.0 failed with error -22 [ 4365.643383] RT3290_AsicTxAlcGetAutoAgcOffset: Incorrect desired TSSI or current TSSI [ 4377.625537] RT3290_AsicTxAlcGetAutoAgcOffset: Incorrect desired TSSI or current TSSI [ 4388.168026] CacheVal-OnOff:0, bPCIclkOff:1, WlanFunCtrl:0xff000133 [ 4388.168035] ==> RTMPWlan 0, bPCIclkOff = 1, pAd->WlanFunCtrl.word = 0xff000123 [ 4388.168039] Set INT_MASK_CSR = 0 [ 4388.168045] ==> RTMPWlan 0, bPCIclkOff = 1, WlanFunCtrl.word = 0xff000120 [ 4388.168051] <== RTMPWlan 0 bPCIclkOff = 1 pAd->WlanFunCtrl.word = 0xff000120 [ 4388.175083] CacheVal-OnOff:0, bPCIclkOff:1, WlanFunCtrl:0xff000120 [ 4388.175093] ==> RTMPWlan 0, bPCIclkOff = 1, pAd->WlanFunCtrl.word = 0xff000120 [ 4388.175096] Set INT_MASK_CSR = 0 [ 4388.175128] ==> RTMPWlan 0, bPCIclkOff = 1, WlanFunCtrl.word = 0xff000120 [ 4388.175133] <== RTMPWlan 0 bPCIclkOff = 1 pAd->WlanFunCtrl.word = 0xff000120 [ 4400.037676] usb 3-3: USB disconnect, device number 14 [ 4404.449532] usb 3-3: new high-speed USB device number 15 using xhci_hcd [ 4404.760211] usb 3-3: ath9k_htc: Transferred FW: htc_9271.fw, size: 51272 [ 4404.760380] xhci_hcd 0000:00:14.0: ERROR no room on ep ring [ 4404.763285] usb 3-3: ath9k_htc: Unable to allocate URBs [ 4404.763325] ath9k_htc: probe of 3-3:1.0 failed with error -22

OK, this appears to be a known bug (fixed in newer kernels) … which Linux distro/version/architecture are you running ?

eg.
Ubuntu 12.04 32bit

and what’s the output from:

uname -a

and

md5sum /lib/firmware/htc_9271.fw

Ubuntu 12.04 64

jiaweihuo@jiaweihuo-LIFEBOOK-LH772:~$ uname -a Linux jiaweihuo-LIFEBOOK-LH772 3.2.0-40-generic #64-Ubuntu SMP Mon Mar 25 21:22:10 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux jiaweihuo@jiaweihuo-LIFEBOOK-LH772:~$ md5sum /lib/firmware/htc_9271.fw 76c902360ef8a095133258fd0d287292 /lib/firmware/htc_9271.fw

I’m reading that ths issue was fixed in 12.10/13.04 … do you want to try installing a newer kernel ?

We’ll start with the most up to date (3.4) build for precise first if you want ?

Sorry, I do not want to upgrade to 12.10 or higher currently.

I’m not asking if you want to upgrade to 12.10/13.04 … I’m asking if you want to try a newer kernel (possibly the one from 12.10/13.04 … though we’ll try the 3.4 kernel for 12.04 first) in 12.04 ?

See here:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1088809
and
http://superuser.com/questions/465415/unable-to-allocate-urbs-error-on-usb-wi-fi-netgear-wnda3200
for info on the bug.

Do you want to try a more recent kernel in 12.04 ?
(there is nothing stopping you selecting the original kernel at bootup … then removing the newer kernel if you want)

OK, I can upgrade to a newer kernel.