Difference between revisions of "Rtl8187 wireless"

From ArchWiki
Jump to: navigation, search
(Added the whole "Ndiswrapper" section.)
m (Using the driver: fix link)
(25 intermediate revisions by 9 users not shown)
Line 1: Line 1:
[[Category:Communication and network (English)]]
+
[[Category:Wireless Networking]]
[[Category:HOWTOs (English)]]
+
 
 
This page describes how to get the '''rtl8187''' wifi-driver working
 
This page describes how to get the '''rtl8187''' wifi-driver working
  
Note: The rtl8187 driver is included in vanilla 2.6.23!
+
Note: The rtl8187 driver is in the kernel (thus the driver comes with the linux package)
  
  
Line 12: Line 12:
 
The driver's source is released under the GPL
 
The driver's source is released under the GPL
  
= Installing the driver =
+
=Using and testing the driver/Troubleshooting=
 +
 
 +
Make sure that you have loaded the rtl8187 module with
 +
modprobe rtl8187
 +
Then run
 +
dmesg | grep rtl8187
 +
You should see some output like this <pre> usbcore: registered new interface driver rtl8187 </pre>
 +
If you see that line everything should be OK
 +
 
 +
== Using the driver ==
 +
 
 +
If everything is right, you should have two new interfaces: wlan0 and wmaster0
 +
If you do not see wlan0 just run
 +
ifconfig wlan0 up
 +
 
 +
To list all available wifi-networks just run
 +
iwlist wlan0 scan
  
If you are on 2.6.23 or above you have to enable CONFIG_RTL8187 in your kernel-config.
+
For more information about configuring your wifi-network see here: [[Wireless_Setup#Setup_and_Boot|http://wiki.archlinux.org/index.php/Wireless_Setup#Setup_and_Boot]]
  
You can check if this option is enabled in your current kernel by executing:
+
= What to do if your connection always times out? =
zcat /proc/config.gz | grep CONFIG_RTL8187
 
If it outputs
 
CONFIG_RTL8187=m
 
or
 
CONFIG_RTL8187=y
 
then your kernel includes the rtl8187 driver
 
  
 +
The open source driver suffers from a lot of tx excessive retries and invalid misc errors for some unknown reason, resulting in a lot of packet loss and it keeps disconnecting, some times instantly.
  
If you are using anything lower than 2.6.23 you can choose between the following methods:
+
==Adjusting with iwconfig options==
  
== Compiling the module from the source-code ==
+
=== Lowering the rate ===
  
No HOWTO yet
+
The solution can be found in this thread: https://bbs.archlinux.org/viewtopic.php?pid=299642
  
== Patch your 2.6.22 kernel ==
+
Just set the rate to 5.5
 +
iwconfig wlan0 rate 5.5M auto
  
Note: if you are already running 2.6.23 or later this is not necessary anymore - just enable the Realtek 8187 USB support in your kernel-config
+
Fixed option should ensure, however, it doesn't change the rate on its own, thus making the connection a bit more stable:
  
At first you have to get the kernel-sources
+
iwconfig wlan0 rate 5.5M fixed
After that you'll need to download two patches: one for the rtl8187 driver and one for EEPROM_93CX6 (rtl8187 requires EEPROM_93CX6-support)
 
  
Save the following link as EEPROM_93CX6.patch (download it to your harddisk with wget -O EEPROM_93CX6.patch $URL):
+
Alternativelly find the $POST_UP option and append the above options to your profile config file:
  
[http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=9467d64b0e88763914c01f71ddf591b166c4f526;hp=7dcca30a32aadb0520417521b0c44f42d09fe05c  EEPROM_93CX6.patch]
+
POST_UP="iwconfig wlan0 rate 5.5M fixed"
  
Then save the following link as rtl8187.patch (download it to your harddisk with wget -O rtl8187.patch $URL):
+
Try various rates until you get the optimal setting, with no disconnection. In this case 12Mbits, as shown bellow:
  
[http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=605bebe23bf6ac66c0a717e663a7baa2f981294d;hp=4b914dc0493edff19ff698a18198a173a14ba9d2 rtl8187.patch]
+
POST_UP="iwconfig wlan0 rate 12M fixed"
  
Now extract your kernel sources, cd into the kernel-source directory
+
Now calling;
and run
 
patch -Np1 -i $path/to/EEPROM_93CX6.patch
 
patch -Np1 -i $path/to/rtl8187.patch
 
  
  make menuconfig
+
  netfcg2 -c <wireless profile>
Now activate: <pre> Device Drivers  ---> Misc devices  ---> EEPROM 93CX6 support </pre> (I compiled it directly into the kernel with [*])
+
or
 +
  netcfg-menu
 +
and choosing your profile works without extra commands.
  
Then go to: <pre> Device Drivers  ---> Network device support  ---> Wireless LAN  ---> Wireless LAN (IEEE 802.11) -> Realtek 8187 USB support </pre>
+
=== Lowering the txpower ===
(I compiled this as module [m])
 
  
What if you can't find "Realtek 8187 USB support" in the kernel config menu?
+
You can try lowering the transmit power as well. This may save power as well:
Don't panic - make sure you activated EEPROM 93CX6 support <pre> Device Drivers  ---> Misc devices  ---> EEPROM 93CX6 support </pre> and the Generic IEEE 802.11 Networking Stack (mac80211) <pre> Networking  ---> Wireless  ---> Generic IEEE 802.11 Networking Stack (mac80211) </pre>
 
  
 +
iwconfig wlan0 txpower 5
  
Now you can save your kernel-config and start compiling
+
or even as low as 0. Valid settings are from 0 to 20, auto and off for the stock kernel driver.
After a reboot the module rtl8187 should be available.
 
You can load it like this:
 
modprobe rtl8187
 
You can also add rtl8187 to the MODULES-section in your rc.conf
 
  
If you want to add rtl8187 support 'The Arch-Way' make sure to add "patch -Np1 -i ../foo.bar" to your kernel-PKGBUILD
+
=== Setting rts and fragmentation thresholds ===
  
=Using and testing the driver/Troubleshooting=
+
Default iwconfig options have rts and fragmentation thresholds off. These options are particularly useful when there are many adjacent APs or in a noisy environment.
  
Make sure that you have loaded the rtl8187 module with
+
The minimum value for fragmentation value is 256 and maximum is 2346. In many windows drivers the maximum is the default value:
modprobe rtl8187
 
Then run
 
dmesg | grep rtl8187
 
You should see some output like this <pre> usbcore: registered new interface driver rtl8187 </pre>
 
If you see that line everything should be OK
 
  
== Using the driver ==
+
iwconfig wlan0 frag 2346
  
If everything is right, you should have two new interfaces: wlan0 and wmaster0
+
For rts minimum is 0, maximum is 2347. Once again windows drivers use maximum as the default:
If you don't see wlan0 just run
 
ifconfig wlan0 up
 
  
To list all available wifi-networks just run
+
  iwconfig wlan0 rts 2347
  iwlist wlan0 scan
 
  
For more information about configuring your wifi-network see here: [http://wiki.archlinux.org/index.php/Wireless_Setup#Setup_and_Boot http://wiki.archlinux.org/index.php/Wireless_Setup#Setup_and_Boot]
+
== Compat-wireless-patched ==
  
== What to do if your connection always times out? ==
+
The [http://wireless.kernel.org/ Linux Wireless] project provides frequent stable releases of patched drivers for the latest kernels. These drivers fix the "fixed-channel -1" issue, whilst providing better injection.
 +
For further information and installation procedures please read the [[Wireless_Setup#compat-wireless-patched]] article.
  
The solution can be found in this thread: http://bbs.archlinux.org/viewtopic.php?pid=299642
+
== Using Ndiswrapper ==
  
Just set the rate to 5.5
+
If everything else fails, then you are left with using Ndiswrapper. Ndiswrapper takes Windows RTL8187 drivers and uses them to enable your card.
iwconfig wlan0 rate 5.5M auto
 
  
Actually this worked for a while but it would still start revving out, so making the last
+
'''Install ndiswrapper'''
item "fixed" ensures it does not spin. Btw. If your wireless card has already gone into
+
  pacman -S ndiswrapper
meltdown issuing this command will get it working again.
 
  
  iwconfig wlan0 rate 5.5M fixed
+
'''Download the Windows drivers'''
 +
  wget [http://db.tt/4NB0HbF6 http://db.tt/4NB0HbF6]
  
I have also tried setting this in the IWOPTS, but it does not seem to be taking, so now what I do until I get this sorted out is:
+
'''Extract the drivers'''
  netcfg2 -c <your wireless profile>
+
unzip ndiswrapper.zip
  iwconfig wlan0 rate 5.5M fixed
 
  
And then it never times out (at least for me)
+
'''Unload the rtl8187 module'''
 +
modprobe -r rtl8187
  
Found the $POST_UP option, so appending this to your profile config
+
'''Remove any previously installed drivers (if any)'''
file, sets the rate correctly when using the netcfg tools.
 
  
    POST_UP="iwconfig wlan0 rate 5.5M fixed"
+
ndiswrapper -r net8187b
  
Actually for my card setting the rate higher still works, so now this line looks like:
+
'''Install the new drivers'''
  
    POST_UP="iwconfig wlan0 rate 12M fixed"
+
ndiswrapper -i ./ndiswrapper/net8187b.inf
  
Now calling;
+
ndiswrapper -m
  
    netfcg2 -c <wireless profile>
+
depmod -a
or
 
  netcfg-menu
 
and choosing your profile works without extra commands.
 
  
=Using Ndiswrapper=
+
'''Make sure that it is installed'''
If everything else fails, then you are left with using Ndiswrapper. Ndiswrapper takes Windows RTL8187 drivers and uses them to enable your card.
 
  
Symptoms which suggest you may have better luck with Ndiswrapper:
+
ndiswrapper -l
  
* "iwlist wlan0 scan" results are irregular and/or don't show some APs.
+
'''Try now loading the module'''
* Everything seems to be working, except the DHCP request, which may just time out.
 
  
1. Install ndiswrapper:
+
modprobe ndiswrapper
    pacman -Sy ndiswrapper
 
  
2. Download the Windows drivers:
+
'''Kernel log shouldn't indicate any errors'''
    wget http://www.kuratkull.com/ndiswrapper/ndisdrivers.tar.gz
 
  
3. Extract the drivers:
+
dmesg | tail
    gzip -dc ndisdrivers.tar.gz | tar xf -
 
  
4. If you have the rtl8187 module loaded, then do this:
+
'''If all steps are successful it should be visible now in the iwconfig interfaces list'''
    rmmod rtl8187
 
It is suggested that you remove previous ndiswrapper drivers, if you have installed them.
 
    ndiswrapper -l
 
    ndiswrapper -r <drivername>
 
  
Also add "ndiswrapper" and "!rtl8187" to /etc/rc.conf under MODULES - this will stop rtl8187 from loading on boot, and will enable ndiswrapper to load on boot.
+
iwconfig
  
5. Install the driver:
+
'''Add ndiswrapper to the MODULES array in /etc/rc.conf'''
If you have an older kernel(eg. older than 2.6.28.*), do:
 
  
    cd ./ndisdrivers/Win98-krnl24/
+
MODULES=(... powernow-k7 ndiswrapper ...)
  
If you have a newer kernel (eg. 2.6.28.*), do:
+
'''Blacklist ''rtl8187'' in /etc/modprobe.conf.d/rtl8187.conf'''
 
    cd ./ndisdrivers/Win98seME-krnl28/
 
  
Proceed with:
+
blacklist rtl8187
    ndiswrapper -i net8187b.inf
 
    ndiswrapper -m
 
    modprobe ndiswrapper
 
  
 
Proceed to connect as you normally would.
 
Proceed to connect as you normally would.
 +
 +
{{Note|You may still have issues with disconnections, but in this case setting rates, rts and fragmentation thresholds actually work}}
  
 
=Misc Links=
 
=Misc Links=
*[http://rtl-wifi.sourceforge.net/ Project-page of the rtl-wifi driver project]
+
*[http://wireless.kernel.org/ The Linux Wireless project]
 +
*[http://aircrack-ng.org/doku.php?id=r8187 Aircrack-ng information for rtl8187 chips]

Revision as of 01:26, 6 December 2012


This page describes how to get the rtl8187 wifi-driver working

Note: The rtl8187 driver is in the kernel (thus the driver comes with the linux package)


The rtl8187 chip is made for usb-cards/dongles

It supports 802.11(a)/b/g and the following encryptions: WEP, WPA and WPA2

The driver's source is released under the GPL

Using and testing the driver/Troubleshooting

Make sure that you have loaded the rtl8187 module with

modprobe rtl8187

Then run

dmesg | grep rtl8187
You should see some output like this
 usbcore: registered new interface driver rtl8187 

If you see that line everything should be OK

Using the driver

If everything is right, you should have two new interfaces: wlan0 and wmaster0 If you do not see wlan0 just run

ifconfig wlan0 up

To list all available wifi-networks just run

iwlist wlan0 scan

For more information about configuring your wifi-network see here: http://wiki.archlinux.org/index.php/Wireless_Setup#Setup_and_Boot

What to do if your connection always times out?

The open source driver suffers from a lot of tx excessive retries and invalid misc errors for some unknown reason, resulting in a lot of packet loss and it keeps disconnecting, some times instantly.

Adjusting with iwconfig options

Lowering the rate

The solution can be found in this thread: https://bbs.archlinux.org/viewtopic.php?pid=299642

Just set the rate to 5.5

iwconfig wlan0 rate 5.5M auto

Fixed option should ensure, however, it doesn't change the rate on its own, thus making the connection a bit more stable:

iwconfig wlan0 rate 5.5M fixed 

Alternativelly find the $POST_UP option and append the above options to your profile config file:

POST_UP="iwconfig wlan0 rate 5.5M fixed"

Try various rates until you get the optimal setting, with no disconnection. In this case 12Mbits, as shown bellow:

POST_UP="iwconfig wlan0 rate 12M fixed"

Now calling;

netfcg2 -c <wireless profile>

or

  netcfg-menu 

and choosing your profile works without extra commands.

Lowering the txpower

You can try lowering the transmit power as well. This may save power as well:

iwconfig wlan0 txpower 5

or even as low as 0. Valid settings are from 0 to 20, auto and off for the stock kernel driver.

Setting rts and fragmentation thresholds

Default iwconfig options have rts and fragmentation thresholds off. These options are particularly useful when there are many adjacent APs or in a noisy environment.

The minimum value for fragmentation value is 256 and maximum is 2346. In many windows drivers the maximum is the default value:

iwconfig wlan0 frag 2346

For rts minimum is 0, maximum is 2347. Once again windows drivers use maximum as the default:

iwconfig wlan0 rts 2347

Compat-wireless-patched

The Linux Wireless project provides frequent stable releases of patched drivers for the latest kernels. These drivers fix the "fixed-channel -1" issue, whilst providing better injection. For further information and installation procedures please read the Wireless_Setup#compat-wireless-patched article.

Using Ndiswrapper

If everything else fails, then you are left with using Ndiswrapper. Ndiswrapper takes Windows RTL8187 drivers and uses them to enable your card.

Install ndiswrapper

pacman -S ndiswrapper

Download the Windows drivers

wget http://db.tt/4NB0HbF6

Extract the drivers

unzip ndiswrapper.zip

Unload the rtl8187 module

modprobe -r rtl8187

Remove any previously installed drivers (if any)

ndiswrapper -r net8187b

Install the new drivers

ndiswrapper -i ./ndiswrapper/net8187b.inf
ndiswrapper -m
depmod -a

Make sure that it is installed

ndiswrapper -l

Try now loading the module

modprobe ndiswrapper

Kernel log shouldn't indicate any errors

dmesg | tail

If all steps are successful it should be visible now in the iwconfig interfaces list

iwconfig

Add ndiswrapper to the MODULES array in /etc/rc.conf

MODULES=(... powernow-k7 ndiswrapper ...)

Blacklist rtl8187 in /etc/modprobe.conf.d/rtl8187.conf

blacklist rtl8187

Proceed to connect as you normally would.

Note: You may still have issues with disconnections, but in this case setting rates, rts and fragmentation thresholds actually work

Misc Links