Fixing wi-fi on Asus Eee PC 901 with Linux

I mentioned my annoyance that wi-fi with WPA encryption did not work on the Asus 901 Eee PC with Linux which I am reviewing. I later found that even a WEP connection, while it worked a bit, tended to drop out after few minutes. Worse still, the Asus repositories are messed up so getting updates is tricky.

I’ve managed to fix it. For the record, here’s what I did; though I can’t promise it will work for you; try it at your own risk. I should think there will be an easier way to install an updated driver soon.

One of the irritations about the repository problem is that attempted updates fill up your /dev/sda1. I wanted as much space as possible (without removing the recovery partition) so I reset the system with F9 on boot. Then I went into /etc/apt/sources.list and removed the default repositories, replacing them with these two:

deb http://xnv4.xandros.com/xs2.0/upkg-srv2 etch main contrib non-free

deb http://download.tuxfamily.org/eeepcrepos/ p701 main

(This is probably not a good arrangement long-term; but having the Asus repositories enabled right now makes it hard to install anything).

Then I did:

apt-get update

apt-get install build-essential

I also installed ksmserver and kicker to get access to the full desktop; but this wasn’t needed to get wi-fi working.

Next, I downloaded the latest driver source for the 901’s Ralink wi-fi card:

http://www.ralinktech.com.tw/data/drivers/2008_0708_RT2860_Linux_STA_v1.7.0.0.tar.bz2 (Update: don’t use this code – see Update 3 below).

Extracted it; then edited /os/linux/config.mk and changed:

HAS_WPA_SUPPLICANT=y

HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y – but see update 2 and update 3 below for the problems this caused.

I also removed –DDBG from WFLAGS

WFLAGS += –DCONFIG_STA_SUPPORT

In order to compile you need the kernel source. I adapted the instructions here. In essence, download the source from http://dlsvr01.asus.com/pub/ASUS/EeePC/701/Linux_Kernel_071127.rar, extract, install the deb, unpack the source in /usr/src, delete the .bz2 to save space, build the kernel with:

make oldconfig

make

(don’t actually install it), then create the following symbolic link:

ln -s /usr/src/linux-source-2.6.21.4-eeepc /lib/modules/2.6.21.4-eeepc/build

Now I was able to compile and install the ralink driver by switching to the RT2860 directory and typing:

make

make install

Wi-fi now worked with WPA; at least, it did on my second attempt after disabling native WPA supplicant support. I’ve also found it perfectly stable so far – much better.

Active wi-fi connection with WPA; a few numbers changed to reassure the paranoid

I’m happy now, but… what is Asus thinking?

I doubt the Eee brand would have ever taken off, except that the first 7xx releases made excellent use of Linux and open source applications to win people over; you did not even need to know that it was Linux.

Now we get this; the support for the 901 is dire; updates don’t work, the wi-fi doesn’t work properly, and the only fix I’ve found is a hack. Wi-fi is critical for a gadget like this, which is not much use without an Internet connection.

Together with short supply of the Linux version, this does suggest that Asus is keen to favour the Windows XP variant.

Update: I’ve made the binary (rt2860sta.ko) available for download here. Download includes RT2860STA.dat which goes in /etc/Wireless/RT2860STA. I guess we need an install script; I’ll have a go when I get a moment.

Update 2: Unfortunately I’m not quite there yet. If I compile with HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y then WEP works but WPA does not. If I compile with HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n then WPA works but (I now discover) WEP does not. Weird. I’m going to seek advice. If anyone wants the binary that works great with WEP but not WPA, let me know.

Update 3: Thanks to Ralink tech support I now have a fully working driver. I’ve updated the download above. The new code defines EEEPC_SPECIAL_SETTING and has some edits in common/mlme.c. It now works OK with HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y. Interesting point: the code is dated 15th July; which suggests that the problem was both known and fixed 2 and half weeks ago; it’s a shame nobody shared this with the community.

Update 4: I suggest you delete the old copy of rt2860sta.ko in /lib/modules/2.6.21.4-eeepc/rt2860 (if it exists).

PS: I’ve posted instructions for the binary install, with download links, here.

Technorati tags: , ,

100 thoughts on “Fixing wi-fi on Asus Eee PC 901 with Linux”

  1. Hey mate,

    Just wanted to thank you for the new driver – installed it in Ubuntu on my 901 (XP/12GB) and it seems to work with WPA at home (was working fine with old driver and WPA2 – however WPA at work didn’t work!).

    Will have to test it out at work and see how it goes.

    Cheers and all the best with your 901 😉

  2. I’ve installed this on my new linux 901. unfortunately I still cannot connect to my linksys wrt54gl (running dd-wrt v23 sp2) no matter how it is configured. (haven’t tried WEP since changing the driver, but previously I couldn’t get it to work at home either.)

    today, using the stock drivers, I was able to connect to the AP at work, which uses WPA (though I don’t know what options are set up on it) for the first time, so I’m still disappointed about not being able to do so at home.

    Suggestions welcome!

    Thanks, tim, for going to all this work!

  3. This is an install script adapted from the Makefile – save it as install.sh, and run from the directory which has the new rt2860sta.ko and RT2860STA.dat (note it deletes your old driver in /lib/modules/2.6.21.4-eeepc/rt2860
    so you might want to back it up first):


    #!/bin/sh
    rm -rf /etc/Wireless/RT2860STA
    mkdir /etc/Wireless/RT2860STA
    cp RT2860STA.dat /etc/Wireless/RT2860STA/.
    install -d /lib/modules/2.6.21.4-eeepc/kernel/drivers/net/wireless/
    install -m 644 -c rt2860sta.ko /lib/modules/2.6.21.4-eeepc/kernel/drivers/net/wireless/
    /sbin/depmod -a 2.6.21.4-eeepc
    rm -rf /lib/modules/2.6.21.4-eeepc/rt2860

    I still find WPA works better if HAS_NATIVE_WPA_SUPPLICANT=n, though this still breaks wWEP (though it should make no difference to WEP) on my network (Netgear WG602). I actually switch drivers as needed. I’ll investigate further when I have time.

    In case anyone wants to try it, here’s the binary with HAS_NATIVE_WPA_SUPPLICANT=n:

    Tim

  4. Hello,

    I have the same problem with my brand new EeePC 901 and have no Linux experience whatsoever. I am trying to understand the process you have outlined as much as possible, but have no idea of what “install the deb” means, and most probably how it is done. Can you please explain.

    Actually, I see that the first 2 lines of code you provided also start with “deb” ???

    Thank you.

  5. @Jacques

    You can actually just install the binary which is a lot less hassle:

    rt2860sta.tgz

    An install script is in comment 5 above. I’ll add this to the download when I get a moment.

    Tim

  6. well, I got wireless working at home today by replicating the settings from the WAP at work. I can use either WPA or WPA2 with PSK. But I MUST use TKIP. it will not work with AES, or TKIP+AES.

    Tim, any thoughts on that?

    Also, part of your blog seems to say that the latest binary (which I think is the one I have) works for wpa and wep, but elsewhere it seems to say wpa and wep require different binaries.

    Can you clarify for me?

    Thanks! 🙂

  7. Can you clarify for me?

    Yes; the binary does connect with both WPA and WEP but I’ve had problems with WPA reliability – sometimes it won’t connect, sometimes it drops out – unless I use the binary compiled with HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n in which case it is rock solid. On my particular system.

    This was an advance on the earlier driver which would not connect to WPA at all with HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y.

    Tim

  8. I meant, are these the official sources?

    They are the official sources for the 701; think it’s the same.

    Tim

  9. Hi Tim
    I have the same issue as Jaques above. I am a complete Linux noob who has just received linux 901 and having trouble connecting to my home encrypted wifi. I’m afraid I can’t understand your instruction to Jacques of “just install the binary.” Is it possible you could do a step-by-step guide to fixing the prob for a non-linux person. Sorry to ask and appreciate any help. I don’t want to but if I can’t fix it in next 5 days I will have to give in and swap my linux 901 for an xp 901. 🙁

  10. Here are (I hope) simple instructions for using these drivers.

    Here’s how to install on a standard Xandros Eee 901 (ie as it comes from Asus). Note that the script deletes your old driver; you can back it up first if you like by copying the directory /lib/modules/2.6.21.4-eeepc/rt2860

    Download this file:

    rt2860wep.tgz

    When you download the file, make sure it goes into /home/user, or copy it there later.

    Open a console by pressing Ctrl-Alt-T

    Unpack the file:

    tar zxvf rt2860wep.tgz

    Change into the directory you created:

    cd rt2860wep

    Make sure the script is executable:

    chmod 775 install.sh

    Turn off your wifi by pressing Fn-F2 until the message says WLAN OFF

    Install the driver:

    sudo ./install.sh

    Turn wifi back on by pressing Fn-F2 until the message says WLAN ON

    Test the driver. Right-click the wi-fi icon at bottom right of the screen and choose All network connections. If any wi-fi connection is showing something other then Disconnected, select it and choose Disconnect from the Connection drop-down. Then select the one you want and choose Connect from the Connection drop-down.

    Finally, post here if this helps with your wi-fi issue. I’d also be interested to know if one of these drivers works for you with both WPA and WEP; or even if the original works without any issues or drop-outs.

    You can check the loaded driver to some extent with the lsmod command. Look for rt2860sta in the list (you may need to enlarge the console window vertically). The original driver has a size of over 400K, the new drivers less than 400K.

    I find it works best if I use a separate build for connecting with WPA. It’s here:

    rt2860wpa.tgz

    Installation as above.

    Tim

  11. I have Adam’s 2.6.24-21-eeepc kernel (with the fix above included) installed but it won’t associate with a WPA AP. The syslog error is here.

    I tried recompiling as explained above and just realised I spent an hour compiling a 2.6.21 kernel when I’m using a 2.6.24 kernel *slaps forehead* Explains why it doesn’t work anyway!

    Any ideas on solving it though?

  12. Hi Tim,
    Thanks for the reply. The link should have been http://www.killminus9.net/syslog.error

    That module won’t work for me – gives me an “Invalid module format” error. I’m guessing it’s because it was compiled against 2.6.21 instead of 2.6.24. Will have to get the 2.6.24 source and give it another go.

    Thanks again for you help.

    Regards,
    Cian

  13. @Cian

    OK, I’d be interested to know the outcome if you recompile with that switch changed.

    Tim

  14. Well, the situation got even more intriguing (well, infuriating really). I was messing around setting static IPs, setting the WPA-PSK in /etc/network/interfaces. Not of it was working so I removed everything and let NetworkManager manage it with DHCP again. It associated but didn’t get an IP. I did a dhclient ra0 and lo and behold, I got an IP address and could connect.

    Of course, I lost it at the next reboot. So it *does* work, it just looks like a config/timeout issue somewhere. The successful attempt is at http://www.killminus9.net/syslog.success

    I’ll give it a go this evening with the switch changed. Compiling the kernel takes about an hour and a half! Pity it needs to be compiled before building the ra module.

    Cian

  15. Right, so I installed the rt2860sta module against the 2.6.24-21-eeepc headers.

    First, I tried with HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y and compiled. Once installed, the module behaved as described above. When I recompiled with HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n, NetworkManager wouldn’t even show a Wireless option. Going into manual config, the adapter showed up so I tried to manually configure it with DHCP. This didn’t work.

    Not sure what do to now. Will jab at stuff.

    On a related note, Fn+F2 hangs the machine when it turned off the wireless.

  16. Yay – fixed. I used the source from the ralinktech.com linked above. I didn’t use the install.sh in the tarball but instead extracted the RT2860.tgz and did a make && make install in the RT2860 directory. Everything worked fine since!

  17. @Cian

    Interesting. So in your case the older source works better.

    There is some Eee-specific stuff in the source I was sent. Maybe this is in fact Xandros-specific? You can turn this off with switches too; would be interesting to try.

    Tim

  18. I may have jinxed myself. It hasn’t worked in about 3 hours. I had been testing it and thrown a fair amount of data across the link and it was fine.

    But once I put it to sleep, it wouldn’t come back. Rebooted a few times and messed around with stuff. Still nothing.

    I did solve the mystery of how it sometimes worked with the old driver. It associated with the unencrypted AP downstairs. NetworkManager showed as connected to my AP. iwconfig showed it connected to the unencrypted one downstairs.

    So this pretty much puts me back to square one. I might try the new ralink driver with the eeePC stuff disabled to see if that’ll help.

  19. Ah, well in that case it’s less likely that disabling the EeePC bits will help. No harm in trying though.

    Tim

Comments are closed.