Asus WL-167G USB Wireless WLAN Adapter in Linux

This is a how-to on how to get an Asus WL-167G USB 2.0 WLAN dongle (802.11g) working in Fedora Core 3. The correct kernel module is rt2570.ko (for a 2.6 kernel).

Updated: 2005-07-02

The driver provided by Asus on their site does not work – the zip file is corrupted (read more here. I tried to register in order to comment further in that forum, but I only got a message “Server busy, Please try again in a few times later. Thank you!”)

The Asus adapter uses a RalinkTech chipset, and they’ve (finally) released the source code. It is available here. I downloaded the source code for the usb driver, unzipped it, and read the fucking manual, i.e.:


# unzip 2005_0601_RT25USB-SRC-V2.0.3.0.tar.gz
# cd RT25USB-V2.0.3.0/
# less README
# cp Makefile.6 Makefile
# make
# insmod rt2570.ko
# iwconfig rausb0 mode Managed key restricted XXXXXXXXXX essid "Hotel Hell"
# ifconfig rausb0 up
# dhclient rausb0

Change the iwconfig command to suit you – if you’re so stupid you use no encryption at all (yes I know WEP is pretty insecure itself..) you would maybe use something like this: iwconfig rausb0 essid any (the ten X’s in the above are 64 bits 10 hex digits [0-9][A-F] given by my router – not with any 0x in front.)

Next, check that everything works, and make the changes permanent:
Make a file /etc/sysconfig/network-script/ifcfg-rausb0:


DEVICE=rausb0
ONBOOT=yes
BOOTPROTO=dhcp
TYPE=Wireless
ESSID="Hotel Hell"
MODE=Managed
# Only if you use WEP:
KEY="restricted [1] XXXXXXXXXX"

or put the key(s) in /etc/sysconfig/network-scripts/keys-rausb0:


KEY=XXXXXXXXXX

where XXXXXXXXXX is the same key as in the iwconfig command above.

Add to /etc/modules.conf:


alias rausb0 rt2570

Copy the driver to the appropriate location:


cp rt2570.ko /lib/modules/2.6.10-1.771_FC2/kernel/drivers/net/wireless
 

where you replace 2.6.10-1.771_FC2 with your kernel version (which can be found with uname -r.)

Give the right file permissions:


# chmod a+rx /lib/modules/2.6.10-1.771_FC2/kernel/drivers/net/wireless/rt2570.ko

Run


# depmod -a

Well, OK – I didn’t get WEP working this way, so I simply dumped the following code to /etc/rc.local:

iwconfig rausb0 mode Managed key restricted XXXXXXXXXX essid "Hotel Hell"

ifconfig rausb0 up

ifup rausb0

#dhclient rausb0 # For debugging only, instead of the line above

Thanks to goes to Terje for the depmod -a command.

I should also mention that I sometimes get loads of errors like this:

dmesg
usb_unlink_urb() is deprecated for synchronous unlinks.  Use usb_kill_urb() instead.
Badness in usb_unlink_urb at drivers/usb/core/urb.c:457
 [< c027ff98>] usb_unlink_urb+0x45/0x7e
 [< c8dd96c9>] ReleaseAdapter+0xb3/0x1c0 [rt2570]
 [< c8dca1cd>] RTUSBHalt+0x120/0x132 [rt2570]
 [< c0143ed5>] __alloc_pages+0x2c5/0x2d1
 [< c0150919>] do_anonymous_page+0x232/0x2a5
 [< c01509e1>] do_no_page+0x55/0x418
 [< c0216bb2>] extract_entropy+0x2d7/0x373
 [< c0116e5e>] recalc_task_prio+0x128/0x133
 [< c0116eba>] activate_task+0x51/0x5d
 [< c03022c6>] wait_for_completion+0x1a/0x229
 [< c012633c>] signal_wake_up+0x1c/0x1d
 [< c0126ec8>] __group_complete_signal+0x200/0x205
 [< c0126f3f>] __group_send_sig_info+0x72/0x7b
 [< c8dcb937>] usb_rtusb_close+0x192/0x1bb [rt2570]
 [< c011790a>] default_wake_function+0x0/0xc
 [< c011790a>] default_wake_function+0x0/0xc
 [< c02a9d68>] dev_close+0x5b/0x7b
 [< c02ab082>] dev_change_flags+0x48/0xee
 [< c02e577e>] devinet_ioctl+0x253/0x4cc
 [< c02e71d1>] inet_ioctl+0x47/0x73
 [< c02a1b57>] sock_ioctl+0x21d/0x226
 [< c01751ce>] sys_ioctl+0x1db/0x1f5
 [< c0103473>] syscall_call+0x7/0xb

but that doesn’t seem to be a problem.

I have not used the RaConfig2500 that is included in the driver zip file (as iwconfig does the job).

Related links
Ralink Technology driver download page
Asus driver download page with corrupted files…
Asus member forum with angry customers
rt2400 and rt2500 how-tos

27 Responses to “Asus WL-167G USB Wireless WLAN Adapter in Linux”

  1. Flo Says:

    Hello …

    the ASUS driver is not a Zipfile but a .tar.gz – just run tar -xvzf SourceCode-V2030.zip

  2. Flo Says:

    You could also try the new driver from http://rt2x00.serialmonkey.com/wiki/index.php/Downloads (atm still CVS-version).

    This driver allows enabling RFMON-mode, so you can use the stick with kismet etc. ;-)

  3. Martin Says:

    Cool! Thanks – I’ll try to hack my own WEP network right away :-D

  4. Thomas Goirand Says:

    Hi !

    I’ve tried 3 different drivers using the wl-167g assus USB/WLAN dongle. The first one, from ralink simply don’t work.

    iwconfig rausb0 essid XXXX

    has simply no effect, same for mode, etc.

    Using both the one from serialmonkey and even a newer one, the driver did some kernel panics.

    I gave up, I don’t want to be stucked waiting someone does something, or fight hours with a buggy driver. As pointed, the guys from ASUS don’t even have a clue on what is a tar.gz file. Don’t waste your time with that board under linux.

    I’m going to get a PRISM II card as I should have done from the begining. If only I can find a brand that still does it…

    Thomas

  5. Martin Says:

    Hi Thomas Goirand! I agree, ASUS sucks, especially when it comes to linux support. The ralinktech driver crashes occasionally. I haven’t tried the serialmonkey driver yet. Maybe it works better. But I guess one has to remove the old driver in some way before installing a new one? How is that done?

  6. matthieu Says:

    Hello can you give me some clues on the versions of your tools and kernel ?
    because with the same driver and a fairly recent kernel (2.6.10) and tools when i do iwconfig on my asus wl 167g nothing append … it is like it doesn’t take care of my parameters.
    For you when you do your iwconfig command after the state of the device is changed ?

  7. Martin Says:

    Matthieu: When the iwconfig command is called without arguments it will give you the current info, then, when giving the arguments, this info will change. When arguments are given to iwconfig it will not give you any messages unless there is a syntax error.

    # /sbin/iwconfig –version
    iwconfig Version 26
    Compatible with Wireless Extension v16 or earlier,
    Currently compiled with Wireless Extension v16.

    Kernel Currently compiled with Wireless Extension v17.

    rausb0 Recommend Wireless Extension v16 or later,
    Currently compiled with Wireless Extension v17.

  8. Jaime Says:

    I’ve found that using wpa-psk makes the results from iwconfig more difficult to believe/interpret, but I’ve managed to get the whole thing working. I’ve posted quite a long topic here:
    http://rt2x00.serialmonkey.com/phpBB2/viewtopic.php?t=79
    Hope this helps…

  9. Ivan Says:

    Hi Martin, what about those crashes? Is this a good USB dongle? Have you checked WPA?

  10. Martin Says:

    Hi Ivan: I’m using this dongle only occasionally and haven’t tested it further for a while. I have not checked WPA or WEP cracking yet. If anybody has got the serialmoneky driver working flawlessly – please post installation/configuration here ;)

  11. Anonymous Says:

    Since it’s a USB device it’s not as uber-full as the PCI /Mini-PCI/ PCMCIA devices.

    I beleive it’s actually the rt2570 chipset and Ralink didn’t release drivers for it until very recently…

    Plus linux’s support for USB devices in general isn’t that great either.

    If you can’t get it to work using the rt25700 or the rt2500 drivers check out the Ural-Linux project. They semi-work in my ibook were the rt2570 ones have severe end-ness issues.

    I haven’t tried it on my desktop though.. I’ll try that later.

  12. Marco Says:

    http://etudiants.insia.org/~jbobbio/ural-linux/

    It works.
    Plain and simple.

  13. Chmouel Boudjnah Says:

    if you do a :

    perl -p -i -e ‘s|usb_unlink_urb|usb_kill_urb|g’ *c

    it will not print all theses messages

  14. Fire Says:

    2.0.4 source is available :)

  15. Karsten Hiddemann Says:

    According to http://www.rz.uni-wuerzburg.de/dienste/wlan/wlan_mit_linux_und_asus_usb_stick/ you can use the ndiswrapper ( http://ndiswrapper.sourceforge.net/ ) to get the USB adapter working, too.

  16. Martin Says:

    Jep, but that kind of sucks – using such a wrapper.

  17. gdebrecz Says:

    Hi !
    I’ve got an ASUS 167-G USB Dongle. How can I put it to rfmon (monitoring) mode ? I know ndiswrapper does not support….
    I’ve tried rt2570 to, it works fine, but dunno how to put it into
    monitoring mode !
    Anybody knows ?
    thanks,
    Gergely

  18. netrider Says:

    A nice Howto for asus wl-167g under linux:
    wikintoo.com/wifi-asus-wl-167g-installation-chipset-rt2500-vt21.html

  19. Martin Says:

    Cool – too bad it’s in fuckin’ french… ;)

  20. senthil Says:

    I need full detail’s how to configure this dongle USB WiFi in Linux. Please help me.

  21. sss Says:

    [root@eu Module]# l
    assoc.c Makefile RT2500STA.dat rtmp_init.c TESTING
    auth.c md5.c rt2560.h rtmp_init.c.orig unload
    auth_rsp.c md5.h rt_config.h rtmp_main.c wpa.c
    connect.c mlme.c rtmp_data.c rtmp_tkip.c wpa.h
    eeprom.c mlme.c.orig rtmp_def.h rtmp_type.h
    ifcfg-ra0 mlme.h rtmp.h rtmp_wep.c
    iwpriv_usage.txt oid.h rtmp_info.c sanity.c
    load README rtmp_info.c.orig sync.c
    [root@eu Module]# vi R
    README RT2500STA.dat
    [root@eu Module]# vi README
    [root@eu Module]# vi README
    [root@eu Module]# make
    make[1]: Entering directory `/usr/src/linux-2.4.8′
    make -C /home/siva/LAST/rt2500-1.1.0-b4/Module CFLAGS=”-D__KERNEL__ -I/usr/src/linux-2.4.8/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i586 -fno-merge-constants -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.8/include/linux/modversions.h” MAKING_MODULES=1 modules
    make[2]: Entering directory `/home/siva/LAST/rt2500-1.1.0-b4/Module’
    gcc -D__KERNEL__ -I/usr/src/linux-2.4.8/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i586 -fno-merge-constants -DMODULE -DMODVERSIONS
    -include /usr/src/linux-2.4.8/include/linux/modversions.h -I. -c -o rtmp_main.o rtmp_main.c
    rtmp_main.c:78: parse error before string constant
    rtmp_main.c:78: warning: type defaults to `int’ in declaration of `MODULE_LICENSE’
    rtmp_main.c:78: warning: function declaration isn’t a prototype
    rtmp_main.c:78: warning: data definition has no type or storage class
    make[2]: *** [rtmp_main.o] Error 1
    make[2]: Leaving directory `/home/siva/LAST/rt2500-1.1.0-b4/Module’
    make[1]: *** [_mod_/home/siva/LAST/rt2500-1.1.0-b4/Module] Error 2
    make[1]: Leaving directory `/usr/src/linux-2.4.8′
    rt2500.o failed to build!
    make: *** [module] Error 1

  22. Martin Says:

    senthil: Please check out the other resources suggested in this post – I’m sorry, but I am not the maintainer of this buggy driver… If you have the money – throw away your Asus dongle, and buy a new one, with open firmware, so that there might be a change someone has written some open source software that actually works with it :)

    sss: are you senthil?
    About your problem compiling this shit: You might be missing some “-devel” packages. Maybe you need your kernel-devel package. I don’t have my laptop that is using the Asus WL-167G USB dongle here right now – but aren’t you supposed to first run “./configure” first? I don’t even know what package you are trying to compile…

    I wish you the best of luck, but remember – even when you succeed compiling it – it won’t be very stable…

  23. Lars Says:

    Just to let you know that some of the above links to Serial Monkey do not work anymore. Try this link http://rt2x00.serialmonkey.com/wiki/index.php/Main_Page

  24. mario Says:

    it just works flawlessly.

    driver: rt2570 v1.1.0-b2 http://rt2x00.serialmonkey.com/wiki/index.php/Downloads

    wireless-tools: 28-1ubuntu2
    http://packages.ubuntu.com/edgy/net/wireless-tools

    kernel: 2.6.18
    http://www.kernel.org/

    mario

  25. Martin Says:

    mario: Thanks for the info (sorry that my WordPress dokuWiki plugin is messing up the link to the driver. Workaround: replace the cross-product sign with an “x”)

  26. marya Says:

    i’m looking for usb darver so plz van u helpe me

    this is my computer cods i dont no what to do

    bs015

    x11-45371
    lm7r
    v2030
    amiloprov2030d
    fujitsu siemens
    amilo pro v2030d
    : seriano ybcv051225
    10600457502

    v42dm-r6qf6-xvkc7-883pm-2rg6b

  27. Martin Says:

    marya: sorry, but I have no idea…

Leave a Reply