Sunday, May 16, 2010

WLAN with Asus Eeepc 1000H and Lucid Lynx

Ubuntu's latest release "Lucid Lynx" is out for a while now so I decided that this would be the right choice for my netbook "Asus Eeepc 1000H". I went for the default i386 desktop release as I don't like the netbook editions. With the help of "UNetbootin" it's quite easy to create a bootable USB stick from the downloaded iso file. The installation was a peace of cake and if you previously installed Ubuntu somewhere (and even if you didn't) it should not be a problem. I recommend keeping a wired network connection during installation (and as it shows, you will need it).

Once installed, fully upgrade your system to the latest packages and this might even pull in a new kernel. Then reboot and try to establish a WLAN connection... At least, I failed. :-( There seems to be a an upstream bug in Lucid's kernel which prevents WPA protected WLAN connections to work properly. The solution seems to be installing the latest Ralink RT2860 WLAN driver. I found this workaround at launchpad published by killerbee - thanks for that! (Have a look at post #25 of the bugreport.) So, I will more or less just sum up his advice here.

As installing a new driver means compiling a kernel module, we need to install the following requirement:
# sudo apt-get install build-essential

Next, I recommend to add yourself to the "src" group. (This step is optional, but if you follow this guide to the letter it's mandatory ;-) ):
# sudo usermod -aG src <USERNAME>

Then logout and in again and download the latest Ralink driver (by the time of writing version 2.3.0.0) for RT2860 from their website (should be the one called "RT2860PCI/mPCI/CB/PCIe(RT2760/RT2790/RT2860/RT2890)"). Once downloaded extract that archive within /usr/src (thats why you need to be in the "src" group):
# cd /usr/src
# tar xvf /path/to/2010_01_29_RT2860_Linux_STA_v2.3.0.0.tar.bz2

Now we need to edit some files:

  1. /usr/src/2010_01_29_RT2860_Linux_STA_v2.3.0.0/os/linux/config.mk:
    Line 11: change "HAS_WPA_SUPPLICANT=n" to "HAS_WPA_SUPPLICANT=y"
    Line 14: change "HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n" to "HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y"

  2. /usr/src/2010_01_29_RT2860_Linux_STA_v2.3.0.0/common/cmm_wpa.c:
    Line 2416: change "WPA_MIX_PAIR_CIPHER             FlexibleCipher = MIX_CIPHER_NOTUSE;" to "WPA_MIX_PAIR_CIPHER             FlexibleCipher = WPA_TKIPAES_WPA2_TKIPAES;"

Once done, change to the directory of the extracted driver archive and start the compile process:
# cd /usr/src/2010_01_29_RT2860_Linux_STA_v2.3.0.0
# make
(don't need to root privileges!!)
# sudo make install
# make clean

Now unload the old module and load the new one:
# sudo ifconfig wlan0 down
# sudo rmmod rt2860sta
# sudo mv /lib/modules/`uname -r`/kernel/drivers/staging/rt2860/rt2860sta.ko /lib/modules/`uname -r`/kernel/drivers/staging/rt2860/rt2860sta.ko_bak
(just to be on the safe side, don't know if necessary)
# sudo depmod -a
# sudo modprobe rt2860sta
# sudo ifconfig ra0 up

(Notice: with the new driver the interface is now called "ra0")

This should leave you with a working WLAN which can be configured easily via the network-manager applet.
Please remember: you need to compile the driver again with each kernel update!!!


Again thanks to killerbee, all credits go to him!

3 comments:

  1. Thanks a lot for these instructions. It worked out perfectly!
    I messed up at one point, so I'm not sure if this is relevant, but in my case, sudo rmmod rt2860sta resulted in an error at sudo modprobe rt2860sta and, consequently, ra0 not going up, so I skipped that step and then all went fine.

    ReplyDelete
  2. Glad to hear it worked! :-) Wonder what kind of error occured, though?

    ReplyDelete
  3. Well, I tried this method again after an upgrade and this time round there were no errors when I followed your method exactly. So I'm not sure what happened the first time round.
    Thanks again!

    ReplyDelete