OpenWrt Forum Archive

Topic: NSLU2 and RTL8187 wlan stick

The content of this topic has been archived on 30 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi!

I'm running 8.09 on a Linksys NSLU2. I want to add WLAN support through a Realtek RTL8187-based USB stick.

As 8.09 does not deliver an appropriate module, I have built the modules from rtl-wifi.sourceforge.net using the toolchain. Building and installing worked out fine, but I get no interface like wlan* or something.

This is the dmesg output:

ieee80211_crypt: registered algorithm 'NULL'
ieee80211_crypt: registered algorithm 'WEP'
ieee80211_crypt: registered algorithm 'TKIP'
ieee80211_crypt: registered algorithm 'CCMP'

Linux kernel driver for RTL8180 / RTL8185 based WLAN cards
Copyright (c) 2004-2005, Andrea Merello
rtl8180: Initializing module
rtl8180: Wireless extensions version 22
rtl8180: Initializing proc filesystem

Linux kernel driver for RTL8187 based WLAN cards
Copyright (c) 2004-2005, Andrea Merello
rtl8187: Initializing module
rtl8187: Wireless extensions version 22
rtl8187: Initializing proc filesystem
usbcore: registered new interface driver rtl8187

[...]

rtl8187: Reported EEPROM chip is a 93c46 (1Kbit)
rtl8187: Card MAC address is 00:e0:4c:00:f9:be
rtl8187: Card reports RF frontend Realtek 8225
rtl8187: WW:This driver has EXPERIMENTAL support for this chipset.
rtl8187: WW:use it with care and at your own risk and
rtl8187: WW:**PLEASE** REPORT SUCCESS/INSUCCESS TO andreamrl@tiscali.it
rtl8187: This seems a legacy 1st version radio
rtl8187: PAPE from CONFIG2: 0
rtl8187: Driver probe completed

This is the ifconfig output:

br-lan    Link encap:Ethernet  HWaddr 00:04:5A:0F:D3:F0  
          inet addr:192.168.10.30  Bcast:192.168.10.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:864 errors:0 dropped:0 overruns:0 frame:0
          TX packets:136 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:77305 (75.4 KiB)  TX bytes:19481 (19.0 KiB)

eth0      Link encap:Ethernet  HWaddr 00:04:5A:0F:D3:F0  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:868 errors:0 dropped:0 overruns:0 frame:0
          TX packets:135 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:77792 (75.9 KiB)  TX bytes:19079 (18.6 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  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:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

This is the output of lsmod | grep 8187:

r8187                  28036  0 
ieee80211_rtl          39523  2 r8187,r8180
eeprom_93cx6            1024  2 r8187,r8180
usbcore                84468  6 ftdi_sio,usbserial,usbnet,ehci_hcd,r8187

There is also some information located at /proc/2410/net/rtl8187/wlan0 (registers, stats-rx, stats-tx).

For me it looks like the modules were loaded successfully. But why is the interface missing?

Thanks in advance.

Best regards,
Mario

(Last edited by Lostmind on 25 Mar 2009, 09:07)

Please create post for installing driver.

Thanks !!!!!!!!!!

Hi again!

Sorry for the long delay. I will provide you with a description to get the rtl8187 working until the point described above.

Follow these steps:

   1. Download the file kamikaze_8.09_source.tar.bz2 from openwrt.org and unpack it. This will create a new directory kamikaze_8.09.
   2. Enter this directory and place the archive rtl-wifi.tar.gz (download below!) in the subdirectory package.
   3. Now unpack the archive right there. Again, this will create a new directory rtl-wifi (it contains the Makefile). Inside you will find a directory patches (there are the needed patches).

That is all. After invoking make menuconfig the new module should appear under Network Modules -> Wireless Drivers -> kmod-rtl-wifi.

Download of rtl-wifi.tar.gz is located here.

I hope there is somebody with more luck than me - I have switched to a rt73-based wlan stick. At least kmod-rt73-usb creates an interface, but is not working either in client- or ap-mode.

Best regards,
Mario

(Last edited by Lostmind on 24 Jul 2009, 21:34)

Thanks Lostmind for Posting your instructions to compile the driver for the RTL8187 chip set. The driver compiles without no errors, but I can`t load the driver sad

dmesg says:

rtl8187: Reported EEPROM chip is a 93c46 (1Kbit)
rtl8187: Card MAC address is 00:1f:1f:3c:4b:68
rtl8187: WW:Unknown RF module 6
rtl8187: WW:Exiting...
rtl8187: Initialization failed
rtl8187: wlan driver load failed

If anybody has the same problem und solved it, please post!!

Hi dr.gonzo42!

Please install usbutils and post the output of lsusb. In addition you could try your wlan stick on a Linux-PC and post the dmesg-output. According to the "unknown RF module"-error I suspect a mismatch of USB id's.

Best regards,
Mario

Hallo Lostmind,

here is the dmesg-output on my notebook:

rtl8187: 8187B chip detected. Support is EXPERIMENTAL, and could damage your
[   49.569621]          hardware, use at your own risk
[   49.569625] rtl8187: inconsistency between id with OEM info!
[   49.571394] phy0: Selected rate control algorithm 'pid'
[   49.616513] phy0: hwaddr 00:1f:1f:3c:4b:68, RTL8187BvB(early) V0 + rtl8225z2

And the lsusb-output (I post all of the information, but I think only the vendor-ID or product-ID is important):

Bus 001 Device 006: ID 0bda:8187 Realtek Semiconductor Corp. RTL8187 Wireless Adapter
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x8187 RTL8187 Wireless Adapter
  bcdDevice            2.00
  iManufacturer           1 Manufacturer_Realtek
  iProduct                2 RTL8187B_WLAN_Adapter
  iSerial                 3 00e04c000001
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           81
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4 Wireless Network Card
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           9
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              2 RTL8187B_WLAN_Adapter
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
       bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x07  EP 7 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x89  EP 9 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x0a  EP 10 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x0b  EP 11 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x0c  EP 12 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)

Hi again!

I could identify the problem: we are using an outdated version of the rtl-drivers. The driver was sometime ago merged in the mainline kernel and through this it is already included in the OpenWrt source package. Fortunately, OpenWrt is using compat-wireless which enables us to take advantage of modifications done to the rtl-drivers in newer kernel releases than OpenWrt is using. Ok, long story short solution: we modify the included mac80211-package.

1. This time I have used kamikaze_8.09.1_source.tar.bz2, so if you already used that last time, go into the package-directory and remove the rtl-wifi-directory.
2. Call make menuconfig and check if the kmod-rtl-wifi-entry under Kernel modules -> Wireless Drivers is gone.
5. Go into the package-directory and remove the mac80211-directory.
4. Now copy the mac80211.tar.gz-file (download below!) into the package-directory and unpack it there. A new mac80211-directory should appear.
5. Call make menuconfig. There should be a kmod-rtl-wifi-entry under Kernel modules -> Wireless Drivers - this time it is the new one. Make sure it is marked with "M". Save and exit.
6. Invoke make and wait for the build process.

After the build process has finished, have a look inside the bin/packages/armeb-directory: the file you are looking for is kmod-rtl-wifi_2.6.26.8+2008-08-06-ixp4xx-2_armeb.ipk (at least that is the name at my side after all).

Download mac80211.tar.gz from here.

Please consider that this is NOT tested! At the moment I have no Realtek wifi stick around. I will be able to test it next friday, but I put this here so you can try smile

Good luck and please report.

Best regards,
Mario

Btw.: > Hallo Lostmind,
Is that a typo or are you a German speaker?

Lostmind wrote:

Hi again!

I could identify the problem: we are using an outdated version of the rtl-drivers. The driver was sometime ago merged in the mainline kernel and through this it is already included in the OpenWrt source package. Fortunately, OpenWrt is using compat-wireless which enables us to take advantage of modifications done to the rtl-drivers in newer kernel releases than OpenWrt is using. Ok, long story short solution: we modify the included mac80211-package.

1. This time I have used kamikaze_8.09.1_source.tar.bz2, so if you already used that last time, go into the package-directory and remove the rtl-wifi-directory.
2. Call make menuconfig and check if the kmod-rtl-wifi-entry under Kernel modules -> Wireless Drivers is gone.
5. Go into the package-directory and remove the mac80211-directory.
4. Now copy the mac80211.tar.gz-file (download below!) into the package-directory and unpack it there. A new mac80211-directory should appear.
5. Call make menuconfig. There should be a kmod-rtl-wifi-entry under Kernel modules -> Wireless Drivers - this time it is the new one. Make sure it is marked with "M". Save and exit.
6. Invoke make and wait for the build process.

After the build process has finished, have a look inside the bin/packages/armeb-directory: the file you are looking for is kmod-rtl-wifi_2.6.26.8+2008-08-06-ixp4xx-2_armeb.ipk (at least that is the name at my side after all).

Download mac80211.tar.gz from here.

Please consider that this is NOT tested! At the moment I have no Realtek wifi stick around. I will be able to test it next friday, but I put this here so you can try smile

Good luck and please report.

Best regards,
Mario

Btw.: > Hallo Lostmind,
Is that a typo or are you a German speaker?

Hello, I tried to follow your recomendations and I finally has got a seem to be working driver for 8.09.1. At least I can see it thru iwconfig like this:
imq0      no wireless extensions.

imq1      no wireless extensions.

eth0      no wireless extensions.

eth1      no wireless extensions.

wmaster0  no wireless extensions.

wlan0     IEEE 802.11bg  ESSID:"OpenWrt" 
          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated   
          Tx-Power=27 dBm   
          Retry min limit:7   RTS thr:off   Fragment thr=2352 B   
          Encryption key:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

br-lan    no wireless extensions.

in dmesg I can see the following lines:
usb 2-1: configuration #1 chosen from 1 choice
phy0: Selected rate control algorithm 'pid'
phy0: hwaddr 00:11:6b:1c:2c:bf, RTL8187vB (default) V1 + rtl8225z2


However, when I tried to enable wifi thru x-wrt web interface, I get the following error:

Committing wireless ...
Waiting for the commit to finish...
Reloading wireless ...
Configuration file: /var/run/hostapd-wlan0.conf
Line 2: invalid/unknown driver 'nl80211'
1 errors found in configuration file '/var/run/hostapd-wlan0.conf'
enable_mac80211(wlan0): Failed to set up wpa for interface wlan0

and wifi does not work .

What should I do to make my rtl8187 usb to work correctly as AP under 8.09.1?

Best Regards, Dmitry

i made it working using the trunk not 8.09.1 and the corresponding rtl8187 package, dont forget adding hostapd mini

(Last edited by ttsherpa on 8 Aug 2009, 23:28)

ttsherpa wrote:

i made it working using the trunk not 8.09.1 and the corresponding rtl8187 package, dont forget adding hostapd mini

I built kamikaze from the latest trunk 17200 and still can't get my stick working. The build process went well. I only had to use the original mac80211 package, cause the above link doesn't work for the latest trunk. I'm using wnc0305USB and it perfectly works under MAC OS X 10.5.7 with original driver from realtek as a client and as an ad-hoc and under backtrack as a client. What usb stick do you have and was able to get to work? What trunk version did you use?

Dmitry

I used version 171xx and included kmod-rtl8187 which i'm not sure you did. I don't have the usb stick here but for sure it was rtl8187 based. You can find several already made packages at http://downloads.openwrt.org/snapshots/ … mipsel.ipk but I' don't know what are the differences between them. As you can see Im using broadcom 2.6 on an Asus wl500gpv1 router.

Regards

Lostmind wrote:

1. This time I have used kamikaze_8.09.1_source.tar.bz2, so if you already used that last time, go into the package-directory and remove the rtl-wifi-directory.
2. Call make menuconfig and check if the kmod-rtl-wifi-entry under Kernel modules -> Wireless Drivers is gone.
5. Go into the package-directory and remove the mac80211-directory.
4. Now copy the mac80211.tar.gz-file (download below!) into the package-directory and unpack it there. A new mac80211-directory should appear.
5. Call make menuconfig. There should be a kmod-rtl-wifi-entry under Kernel modules -> Wireless Drivers - this time it is the new one. Make sure it is marked with "M". Save and exit.
6. Invoke make and wait for the build process.

After the build process has finished, have a look inside the bin/packages/armeb-directory: the file you are looking for is kmod-rtl-wifi_2.6.26.8+2008-08-06-ixp4xx-2_armeb.ipk (at least that is the name at my side after all).

Download mac80211.tar.gz from here.

Great work! Thanks a lot. It seems to be working, I have a wlan0-device and can choose a channel, the bitrate, etc. I must do some precision work to get it running without problems and as access point, but I think this should possible.

Lostmind wrote:

Btw.: > Hallo Lostmind,
Is that a typo or are you a German speaker?

German speaker and a typo.. wink

rdmitry wrote:

Configuration file: /var/run/hostapd-wlan0.conf
Line 2: invalid/unknown driver 'nl80211'
1 errors found in configuration file '/var/run/hostapd-wlan0.conf'
enable_mac80211(wlan0): Failed to set up wpa for interface wlan0

I had a similar mistake yesterday evening, I am at work and can not look at my Thin Client but I can tell you how to solve the problem later.

ttsherpa wrote:

I used version 171xx and included kmod-rtl8187 which i'm not sure you did. I don't have the usb stick here but for sure it was rtl8187 based. You can find several already made packages at http://downloads.openwrt.org/snapshots/ … mipsel.ipk but I' don't know what are the differences between them. As you can see Im using broadcom 2.6 on an Asus wl500gpv1 router.

Regards

Hi again, I also used included version of kmod-rtl8187, but I'm trying to make it work on x86 platform. Finally, I've found in the internet, that rtl8187 can not work in AP mode. Does anybody know if this is true?

Dmitry

Interesting topic, this would make it real cheap to build enterprise level routers, with long range, using for example the gsky or alfa usb adapters out there, i think its RTL8187L they use.

rdmitry : Its partialy true, it dont think anyone have made it work with hostapd yet, if it is infact the RTL8187L device you have, then drop the mac80211 drivers, there is some patched drivers on the remote exploit dot org site that allow addjusting the tx-power.

But i know its posible, perhaps it just need the right driver modification, because programs like airbase-ng can create softap's on this chipset, with injection/monitor mode patches.

EDIT:

Did some investigation and :

1, The patched driver from remote exploit wont work, you can set iwconfig mode master, but it just works in adhoc mode then, and no hostapd support.

2, There is no ap/master mode support for the mac80211 drivers yet, but here is some intresting reading : http://article.gmane.org/gmane.linux.ke … eral/44486

3, Using the patched drivers from remote exploit and airbase-ng you can create wpa/wep/opn AP's, i dont know how well it works though i dont think its useable for a software ap, since its a tool for creating fake acces points mangling probes and such to encourage clients to connect and send handshake/keystream.

More to come wink

(Last edited by danny1 on 14 Jan 2010, 03:05)

Perhaps this method of solving the firmware embedded in the driver?

The discussion might have continued from here.