I've been playing with this card for so long that to be honest I don't know where to start…
OK, I want to make myself a linux based wireless router. I also want to have a powerful wifi adapter in it.
I didn't have a wireless adapter, so I googled around to find out which chipset has good linux support. RTL8187 was mentioned more than once and recommended in some places. So I bought AWUS036H usb adapter. It is powerful and seems to be very popular, so can't go wrong with it… right?
The adapter arrived after some days, I decided to test how it works. It had windows, linux and osx drivers. To make long story short, this adapter is VERY nice and powerful on windows. Installing it on OSX was a bit more complicated, as I had to load kernel extensions manually… but it also works, and performance is similar to windows.
With linux things are a bit more complicated though.
I downloaded latest stable Debian and installed it in a virtual machine (Parallels 6 for OSX) for testing. RTL8187 drivers were already included in the kernel tree, so there was nothing for me to do, just plug the device and play.
I didn't test the performance with WEP networks very thoroughly, but for the couple of tests I did, it seemed to work OK. Nothing unusual.
The problems started when I tried to connect to a WPA network.
From the beginning:
Code:
root@debian:~# uname -a
Linux debian 2.6.32-5-686 #1 SMP Mon Jan 16 16:04:25 UTC 2012 i686 GNU/Linux
root@debian:~# cat /etc/issue
Debian GNU/Linux 6.0
tail -f /var/log/messages
=> plug usb in
Code:
Mar 10 11:13:46 debian kernel: [ 41.188293] usb 1-1: new high speed USB device using ehci_hcd and address 2
Mar 10 11:13:46 debian kernel: [ 41.329128] usb 1-1: New USB device found, idVendor=0bda, idProduct=8187
Mar 10 11:13:46 debian kernel: [ 41.329132] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar 10 11:13:46 debian kernel: [ 41.329136] usb 1-1: Product: RTL8187_Wireless
Mar 10 11:13:46 debian kernel: [ 41.329143] usb 1-1: Manufacturer: Manufacturer_Realtek_RTL8187_
Mar 10 11:13:46 debian kernel: [ 41.329145] usb 1-1: SerialNumber: E84E06021C5E
Mar 10 11:13:46 debian kernel: [ 41.329234] usb 1-1: configuration #1 chosen from 1 choice
Mar 10 11:13:47 debian kernel: [ 41.494536] cfg80211: Using static regulatory domain info
Mar 10 11:13:47 debian kernel: [ 41.494538] cfg80211: Regulatory domain: US
Mar 10 11:13:47 debian kernel: [ 41.494539] (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
Mar 10 11:13:47 debian kernel: [ 41.494542] (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
Mar 10 11:13:47 debian kernel: [ 41.494544] (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
Mar 10 11:13:47 debian kernel: [ 41.494546] (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
Mar 10 11:13:47 debian kernel: [ 41.494548] (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
Mar 10 11:13:47 debian kernel: [ 41.494550] (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
Mar 10 11:13:47 debian kernel: [ 41.494552] (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
Mar 10 11:13:47 debian kernel: [ 41.495345] cfg80211: Calling CRDA for country: US
Mar 10 11:13:47 debian kernel: [ 41.976626] phy0: hwaddr e8:4e:06:02:1c:5e, RTL8187vB (default) V1 + rtl8225z2, rfkill mask 2
Mar 10 11:13:47 debian kernel: [ 42.005829] rtl8187: Customer ID is 0x00
Mar 10 11:13:47 debian kernel: [ 42.006225] Registered led device: rtl8187-phy0::tx
Mar 10 11:13:47 debian kernel: [ 42.006366] Registered led device: rtl8187-phy0::rx
Mar 10 11:13:47 debian kernel: [ 42.008381] rtl8187: wireless switch is on
Mar 10 11:13:47 debian kernel: [ 42.008407] usbcore: registered new interface driver rtl8187
The device seems to be recognized…
Code:
root@debian:~# iwconfig
wlan0 IEEE 802.11bg ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=0 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
I save this config into /tmp/ws.cfg:
Code:
network={
ssid="XXXX"
psk="YYYY"
proto=WPA
key_mgmt=WPA-PSK
}
And run:
Code:
wpa_supplicant -c /tmp/ws.cfg -i wlan0 -d
wpa_supplicant gives a lot of output, but it seems to work, as:
Code:
root@debian:~# iwconfig
wlan0 IEEE 802.11bg ESSID:"xxxxxxxxxx"
Mode:Managed Frequency:2.417 GHz Access Point: F4:3E:61:0F:38:69
Bit Rate=1 Mb/s Tx-Power=27 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=54/70 Signal level=-56 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
Note that it will sometimes connect at 1Mb/s, sometimes at 36 Mb/s, sometimes at 54 Mb/s, but the connection is never reliable.
Code:
root@debian:~# dhclient -v wlan0
Listening on LPF/wlan0/e8:4e:06:02:1c:5e
Sending on LPF/wlan0/e8:4e:06:02:1c:5e
Sending on Socket/fallback
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 16
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 17
DHCPOFFER from 192.168.1.1
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.1
Reloading /etc/samba/smb.conf: smbd only.
bound to 192.168.1.37 -- renewal in 33048 seconds.
ifconfig says:
Code:
wlan0 Link encap:Ethernet HWaddr e8:4e:06:02:1c:5e
inet addr:192.168.1.37 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::ea4e:6ff:fe02:1c5e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:73 errors:0 dropped:0 overruns:0 frame:0
TX packets:66 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5091 (4.9 KiB) TX bytes:9841 (9.6 KiB)
OK so it seems that I have a connection. Problem is… it sucks
Ping usually looses around 80% of packets, download speed is …. almost zero, not usable.
When I disconnect this adapter from linux and connect to either windows or osx system, I get <5% ping loss and download speed of around 2mbps (same antenna, same adapter position, same workstation, same wifi network).
I tried installing compat-wireless drivers and increasing txpower to 30… which didn't help much.
Any ideas?
Would appreciate any help with this.
Karolis