Saturday, May 01, 2010

Ubuntu 10.04, Wireless chipsets, and WPA Security

1004header[1]
Ubuntu’s latest release, 10.04, was officially posted this week. Overall, it is a very impressive effort and a milestone for the Open Source community. I have installed it on a new cheap desktop I recently built and it runs fantastically with fast boot times and nice desktop eye candy.

The one thing that spoils this effort is the continued hassles in getting wireless wifi cards working. I have a half dozen usb wifi sticks lying around and only one just works our of the box. I guess it wouldn’t be Linux if one didn’t have to at least compile a driver or two every now and then?

Anyway, I recently purchased the Asus PCE-N13 IEEE 802.11b/g/n PCI Express Wireless Adapter.

33-320-048-TS[1]
I bought the card on sale for $19.99 and on the basis that someone left comments that it worked in Ubuntu 10.04. Not sure what this fellow’s definition of working is but it doesn’t just work at least when you use WPA security. So, determined not to let this get the better of me, I embarked on a flurry of google searches.

This card uses the Ralink RT2860 chipset which is used in many products. The problem from what I’ve been able to determine is that the WPA source code definitions are wrong by default. It’s not clear why this is so but that seems to be the case. The fix and ultimate configuration is fairly straight forward if one can find clear and accurate instructions. There’s the rub.

I finally stumbled upon some good instructions but maddeningly they contained key errors that will surely frustrate the uninitiated. So, in the interest of helping those that follow, I offer my amended instructions that I have tested and believe to be accurate. With this guide you should be able to get a Ralink RT2860 based product running and connected to a secure router running WPA security and will do so after reboots.

The following steps were performed on a unmodified default Ubuntu 10.04 final code install.

Step 1
Download latest RT2860 driver source code from Ralink here. You need to enter a name and an email and press accept to download.

Step 2
Open and extract the downloaded file to a temporary directory in your Home directory.

Step 3
Using an editor such as the default Gedit, open the driver source code file ./os/linux/config.mk. Use the find command to locate HAS_WPA_SUPPLICANT and make sure it is set to yes. It should look like this when finished:

HAS_WPA_SUPPLICANT=y
and do the same for:
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y

Close and save this file.

Step 4
Using an editor such as the default Gedit, open the file ./common/cmm_wpa.c. Use the find command to locate MIX_CIPHER_NOTUSE. Replace this entire line (keep on one line)with this code:

WPA_MIX_PAIR_CIPHER FlexibleCipher = WPA_TKIPAES_WPA2_TKIPAES;

Step 5
Perform these commands in a Terminal session one at a time. You can cut and paste. Using sudo puts you into Admin mode so you will be prompted for you Admin (probably) your default password.

sudo make
sudo make install
sudo ifconfig wlan0 down
sudo rmmod rt2860sta

Step 6
Rename the old rt2860sta.ko driver file to rt2860sta.ko.dist using a command such as:

sudo mv /lib/modules/2.6.*/kernel/drivers/staging/rt2860/rt2860sta.ko rt2860sta.ko.dist

Note you need to replace the asterisk with the actual directory name of your kernel. Consult your file system directory structure for this.

This is to prevent the old driver from being used. You could just delete the file as well I suppose.

Step 7
sudo depmod -a
sudo modprobe rt2860sta

After you issue the previous command you should see the Desktop top panel Wireless icon come to life as it tries to connect. You will be prompted for a WPA password. Give it a little while and it should connect.

Not sure this command is necessary but you can use if the Wireless isn’t started automatically.

sudo ifconfig wlan0 up

Step 8
Okay at this point you have made a lot of progress and should be happily surfing at up to 802.11n speeds. Take a break and marvel at your skills and the wonder of the Internet!

Step 9
But, and this is a biggie, what happens if you ever reboot? Unfortunately, you are back at square one without the RT2860 driver being loaded after a reboot. To remedy this situation, read on.

Step 10
Copy the newly compiled driver from your temporary build directory in ./os/linux using a command like:
sudo cp rt2860sta.ko /lib/modules/2.6.*/kernel/drivers/staging/rt2860/
Again replace the asterisk with the correct directory name.

Step 11
Update your modules boot file with the following command:
gksudo gedit /etc/modules
Add the command rt2860sta on a line at the end of the file.
Close and save the file.

Step 12

Reboot and check to see that you are now automatically connecting to your wireless network!

I hope this tutorial may be helpful for some people.

83 comments:

  1. Step 7

    sudo depmod -a
    sudo modeprobe rt2860sta


    there is one small mistake (typo maybe) - the second line should be

    sudo modprobe rt2860sta

    ReplyDelete
  2. Thanks for catching the "modeprobe" mistake. Now fixed!

    ReplyDelete
  3. Hi Chris,

    Thanks for this perfect description. It helped me to get wireless working on my Netbook. Though I needed an ethernet cable to download gcc first :-(

    One small remark. I don't think it's necessary to do step 11 (I skipped it and my wireless works flawlessly). The /etc/modules file is for modules you want to load at boot time. It's better to load the wireless kernel module only when you activate your wireless.

    ReplyDelete
  4. Hi, thnx for this step-by-step guide, I'm getting till step 5 though. (I haven't got much experience with linux, so I'learning now:)) The thing is, I don't understand what I have to do at step with the commands, because when I paste and run, I only get some useless output. I guess when I have to paste "sudo make" there should come something after "make", but I don know what...

    Soooo, what am I doing wrong? xD
    Thanks,
    Stefano

    ReplyDelete
  5. Hi Stef. I guess I assumed a little too much. When you open a terminal session. You need to change directory into the location where you extracted the downloaded driver files. You use the "cd" command just like DOS except you use a "/" to denote the directory. So if you extracted the drivers into your Home directory in a sub directory called "temp" you would use "cd /Home/temp" in terminal first. If there is an actual sub directory there (use "ls" to do a "dir") you will need to cd there as well. You will know you are in the right place when you see a file called "Makefile". This is the instruction file that gets read when you issue the "sudo make" command. Give it a try.

    -CB

    ReplyDelete
  6. Hi Chris. Big thanks! After working a day at this problem I found your instruction - and it works perfectly!
    Torsten

    ReplyDelete
  7. Thnx! But now there's a second problem: I'm in the right directory, but when I run "sudo make" I get this

    karien@karien-laptop:~/Documenten/2010_01_29_RT2860_Linux_STA_v2.3.0.0$ sudo make
    make -C tools
    make[1]: Entering directory `/home/karien/Documenten/2010_01_29_RT2860_Linux_STA_v2.3.0.0/tools'
    gcc -g bin2h.c -o bin2h
    make[1]: gcc: Command not found
    make[1]: *** [all] Error 127
    make[1]: Leaving directory `/home/karien/Documenten/2010_01_29_RT2860_Linux_STA_v2.3.0.0/tools'
    make: *** [build_tools] Error 2
    karien@karien-laptop:~/Documenten/2010_01_29_RT2860_Linux_STA_v2.3.0.0$

    ... What is going wrong?

    ReplyDelete
  8. Okay Stef, I'm trying to help but you do need to do some research on you own ;) The message you are seeing is saying it cannot find your C compiler which is called gcc. Is this a fresh clean install of Ubuntu 10.04 from the final release ISO download you are working with? If not you may want to do a fresh install before you go much further. The default install to my knowledge always includes "gcc" but maybe if you are using an alternate install it is not included? Then you will need to install "gcc" or this is just not going to work for you.

    ReplyDelete
  9. 10.04, latest release, netbook-remix and I installed it today.;] With gcc, as I can see in the software manager. So erm, I guess this is getting complicated...

    ReplyDelete
  10. Chris, great instructions! Thanks a bunch! Works like a charm!

    ReplyDelete
  11. Hey Chris - great guide. WLAN up and working now. Thanks very much - Nick UK

    ReplyDelete
  12. It works! Thank you! Although, for some reason I couldn't connect at step 7. I had to go through all the steps and reboot.

    ReplyDelete
  13. Hi Chris..nice instructions..But facing a problem at Step 10.

    HP-UBUNTU:~/Temp/os/linux$sudo cp rt2860sta.ko /lib/modules/2.6.*/kernel/drivers/staging/rt2860/ returns as
    cp : cannot creat regular file 'lib/modules/2.6.*/kernel/drivers/staging/rt2860/': No such file or directory

    I have also tried this step from root (may be there is a permission problem), but the error message remains the same...

    Don't know what to do now...Please HELP !!!

    Thanks
    Arpita

    ReplyDelete
  14. Come on Arpita? Are you actually reading the instructions where I say "Again replace the asterisk with the correct directory name"?

    Based on the positive feedback, I know these instructions will get you up and running. But, everyone has to do a little heavy lifting or at least use google to fill in your individual knowledge gaps.

    -CB

    ReplyDelete
  15. yes, yes...I know..

    I have actually done this

    HP-UBUNTU:~/Temp/os/linux$sudo cp rt2860sta.ko /lib/modules/2.6.32-21-generic/kernel/drivers/staging/rt2860/ returns as
    cp : cannot creat regular file 'lib/modules/2.6..32-21-generic/kernel/drivers/staging/rt2860/': No such file or directory

    But, no luck :(

    There is some lock sign on the 'rt2860sta.ko' file icon. For this reason I have tried this command from root as well.

    ReplyDelete
  16. Great.

    You are the man!

    Thanks

    ReplyDelete
  17. Thanks Chris.
    On my system system (eeepc 1000), editing the /etc/modules file was not necessary.

    ReplyDelete
  18. You, my friend, are a saint. I've been cussing Ubuntu up one side and down the other for breaking this.

    ReplyDelete
  19. you made my day pal. thank you so much.

    ReplyDelete
  20. UPDATE:
    After previously reporting initial success, a new problem has developed.

    Even though my wireless nic was able to successfully connect to my network, I could no longer transfer any data over it. The adapter would just quit transferring data after an initial burst. Some kind of buffer overflow perhaps?

    After some Googling, I came across another potential solution:

    sudo apt-get install linux-backports-modules-wireless-karmic-generic

    This seems to have things resolved for the time being. You might want to try this if all else fails.

    ReplyDelete
  21. hey thanks for this great tutorial.

    I get this error with the modprobe command. "FATAL: Error inserting rt2860sta (/lib/modules/2.6.32-22-generic/kernel/drivers/net/wireless/rt2860sta.ko): Invalid module format

    Also after I use the "sudo mv" command to rename the rt2860,sta.ko, the whole directory gets deleted instead of the file renamed . . .

    ReplyDelete
  22. Perfect. Not having wireless was a big disappointment. On my eeepc 901 I followed the steps exactly except for step 11. Now wireless works flawlessly. Thank you very much.

    ReplyDelete
  23. After step 7, I still couldn't connect to the Internet. I tried "sudo ifconfig wlan0 up" but it replied wlan0: ERROR while getting interface flags : no such device. I went through the rest of the steps anyway and restarted. Then, I found out that the wireless interface is now named "ra0" so I tried "sudo ifconfig ra0 up." The error message didn't appear, but it still wouldn't connect. Obviously, other people can connect, so can you tell me what I did wrong?

    ReplyDelete
  24. Wow! Thank you so much! Looks like its working finally! I can't believe this was a problem, especially since Asus users are a large population of the Ubuntu Community. Nonetheless, I'm back in business. Thanks again!

    ReplyDelete
  25. Never mind, I read your newest post on using the newest kernel, I'll try and see if that works

    ReplyDelete
  26. Thanks for your instructions. Worked like a charm! I wrote a little script to simplify installation in the future after a kernel upgrade. Maybe it helps others. Just place it in the root directory of the driver source, make it executable and run as root.

    #!/bin/bash
    KV=$(uname -r)
    MODULES=$(cat /etc/modules | grep -i rt2860sta)

    # edit source code
    cp os/linux/config.mk os/linux/config.mk.dist
    cp common/cmm_wpa.c common/cmm_wpa.c.dist
    cat os/linux/config.mk.dist | sed -e 's\HAS_WPA_SUPPLICANT=n\HAS_WPA_SUPPLICANT=y\' -e 's\HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n\HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y\' > os/linux/config.mk
    cat common/cmm_wpa.c.dist | sed -e 's\FlexibleCipher = MIX_CIPHER_NOTUSE;\FlexibleCipher = WPA_TKIPAES_WPA2_TKIPAES;\' > common/cmm_wpa.c

    # compile driver module
    make
    make install

    # shutdown wlan interface
    ifconfig wlan0 down
    ifconfig ra0 down

    # unload wlan kernel module
    rmmod rt2860sta

    # load and install wlan kernel module
    mv /lib/modules/$KV/kernel/drivers/staging/rt2860/rt2860sta.ko /lib/modules/$KV/kernel/drivers/staging/rt2860/rt2860sta.ko.dist
    depmod -a
    modprobe rt2860sta
    cp os/linux/rt2860sta.ko /lib/modules/$KV/kernel/drivers/staging/rt2860/

    # add wlan module to /etc/modules if it is not already added
    if [ $MODULES = "rt2860sta" ];
    then exit;
    else echo "rt2860sta" >> /etc/modules;
    fi

    exit

    ReplyDelete
  27. Thanks Chris, appreciate the instructions.
    Well done!

    ReplyDelete
  28. thank you very much!!
    I've followed all the instructions and it works perfectly!

    ReplyDelete
  29. Works flawlessly on Eee PC 901. Cheers!

    ReplyDelete
  30. Hey Chris, wondering if you could help with an issue i'm getting at step 5
    make -C /home/dev/2010_01_29_RT2860_Linux_STA_v2.3.0.0/os/linux -f Makefile.6 install
    mkdir: cannot create directory `/etc/Wireless': File exists
    make[1]: Entering directory `/home/dev/2010_01_29_RT2860_Linux_STA_v2.3.0.0/os/linux'
    rm -rf /etc/Wireless/RT2860STA
    rm: cannot remove `/etc/Wireless/RT2860STA/RT2860STA.dat': Permission denied
    make[1]: *** [install] Error 1
    make[1]: Leaving directory `/home/dev/2010_01_29_RT2860_Linux_STA_v2.3.0.0/os/linux'
    make: *** [install] Error 2

    Is there something I need to change in order to get appropriate permission to alter the /etc file?
    Thanks

    ReplyDelete
  31. Works perfect in eeepc 901. Tahnks.

    ReplyDelete
  32. Hey Chris
    Great post for this fix.
    After an upgrade to 10.04 LTS on an ASUS 901, I followed your well written instructions and my wifi sprung back into life and even after the reboot. Saved me hours of hacking about. Many thanks.

    ReplyDelete
  33. Thanks for this information. It worked for me and saved re-installing Kubuntu 9.10 It seems the regression testing in 10.04 didn't pick this up and should have.

    ReplyDelete
  34. Just wanted to say thank you. Fixed the problem completely.

    ReplyDelete
  35. This comment has been removed by the author.

    ReplyDelete
  36. Thanks a lot Chris, for a while there it felt like 9.04 all over again :-).

    ReplyDelete
  37. thank you Chris, I have been fighting with module rt2870 since upgrading to 10.4.
    your instruction is perfect and works immeditely also with module rt2870.
    thanks again from Italy

    ReplyDelete
  38. Thanks for the tip! I installed easypeasy1.6 on my EEE PC 1000. It always worked out of the box, but I always got 802.11g links and speeds, no matter what. I followed your instructions and I'm finally connecting at 135mb/s! Thanks again!

    ReplyDelete
  39. Mystified after nine hours of trying.
    OS: Ubu 10.04 LTS, updated ast of 29 May 2010.
    NIC: Ralink Technologies RT2860 Wireless N PCI card
    Downloaded makefiles per: http://ubuntuforums.org/showthread.php?t=1476007
    Adjusted /os/linux/config.mk, and /common/cmm_wpa.c
    Compiled w/gcc; no errors.
    Brought wlan0 down; unloaded old rt2860sta module;
    depmodded and modprobed new rt2860sta back in.
    Did not work. SEEMS to work.
    Backed up old driver,
    Copied newly-compiled rt2860sta driver into:
    /lib/modules/2.6.32-22-generic/kernel/drivers/staging/rt2860/
    Rebooted. NetworkManager Applet indicates wifi connecting.

    ifconfig
    now returns:
    ra0 Link encap:Ethernet HWaddr 00:0d:09:62:15:a5
    inet addr:192.168.1.3 Bcast:192.168.1.255 Mask:255.255.255.0
    inet6 addr: fe80::20d:9ff:fe62:15a5/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:13971 errors:0 dropped:0 overruns:0 frame:0
    TX packets:382 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:1806729 (1.8 MB) TX bytes:6083 (6.0 KB)
    Interrupt:21


    iwconfig
    now returns:
    ra0 Ralink STA ESSID:"tahoma" Nickname:"RT2860STA"
    Mode:Managed Frequency=2.462 GHz Access Point: C0:3F:0E:9F:20:74
    Bit Rate=54 Mb/s
    RTS thr:off Fragment thr:off
    Link Quality=94/100 Signal level:-64 dBm Noise level:-81 dBm
    Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
    Tx excessive retries:0 Invalid misc:0 Missed beacon:0


    iwlist ra0 scanning
    now returns:
    ra0 Scan completed :
    Cell 01 - Address: C0:3F:0E:9F:20:74
    Protocol:802.11b/g
    ESSID:"tahoma"
    Mode:Managed
    Frequency:2.462 GHz (Channel 11)
    Quality:44/100 Signal level:-72 dBm Noise level:-76 dBm
    Encryption key:on
    Bit Rates:54 Mb/s
    IE: WPA Version 1
    Group Cipher : TKIP
    Pairwise Ciphers (1) : TKIP
    Authentication Suites (1) : PSK

    The poor signal quality (44/100, weak signal/noise ratio) is a little weird,
    because the Netgear router is very powerful;
    my neighbors compliment me on the throughput they are getting when they use it.
    But this computer only gets throughput when I plug in ethernet cable.
    I would LOVE some help on this. Now at a total loss.
    Any suggestions extremely welcome!

    ReplyDelete
  40. Thanks Chris!

    Excellent! It worked for me!
    But a small complain about these bugs that don't let use linux out of the box. These makes many newbies coming from Windows run away. What a pity!

    Julio

    ReplyDelete
  41. Regarding my post as of yesterday: mystery partially solved. After another 9 hours of troubleshooting, the hard drive failed. Not a problem with the NIC after all.

    ReplyDelete
  42. another linux mistery for you:ra0 working on two newly installed lucid ubuntu systems: one @n 150 Mb/s , the other one @g 54 Mb/S, as the output of iwconfig.

    ReplyDelete
  43. Fantastic ! Now I can use my wifi im my MSI WIND U100.Thank you very very much !
    From brazil

    ReplyDelete
  44. Excellent job, my Viewsonic VPC190 works now, thanks a lot!!!!!

    ReplyDelete
  45. Worked beautifully for my desktop running 64-bit Kubuntu 10.04. Thank you!

    ReplyDelete
  46. Hello Chris !

    I had a little problem at step 5 :

    make -C tools
    make[1]: entrant dans le répertoire « /home/profiris/Bureau/2010_01_29_RT2860_Linux_STA_v2.3.0.0/tools »
    gcc -g bin2h.c -o bin2h
    make[1]: quittant le répertoire « /home/profiris/Bureau/2010_01_29_RT2860_Linux_STA_v2.3.0.0/tools »
    /home/profiris/Bureau/2010_01_29_RT2860_Linux_STA_v2.3.0.0/tools/bin2h
    cp -f os/linux/Makefile.6 /home/profiris/Bureau/2010_01_29_RT2860_Linux_STA_v2.3.0.0/os/linux/Makefile
    make -C /lib/modules/2.6.32-22-generic/build SUBDIRS=/home/profiris/Bureau/2010_01_29_RT2860_Linux_STA_v2.3.0.0/os/linux modules
    make: *** /lib/modules/2.6.32-22-generic/build: Aucun fichier ou dossier de ce type. Arrêt.
    make: *** [LINUX] Erreur 2


    This problem was that the headers to be able to compile were not installed either. I could install them with the command :

    sudo apt-get install linux-headers-2.6.32-22-generic

    after that the make command succeded !

    ReplyDelete
  47. Hi,

    trying to follow your description on an msi wind u100 netbook (xubuntu 10.04).
    Having a problem at step 5 (make):


    kick@netbook:~/temp/2010_01_29_RT2860_Linux_STA_v2.3.0.0$ sudo make make -C tools
    make[1]: Betrete Verzeichnis '/home/kick/temp/2010_01_29_RT2860_Linux_STA_v2.3.0.0/tools'
    gcc -g bin2h.c -o bin2h
    make[1]: gcc: Kommando nicht gefunden
    make[1]: *** [all] Fehler 127
    make[1]: Verlasse Verzeichnis '/home/kick/temp/2010_01_29_RT2860_Linux_STA_v2.3.0.0/tools'
    make: *** [build_tools] Fehler 2


    I tried MoiCJarod's

    sudo apt-get install linux-headers-2.6.32-22-generic

    but nothing changed.

    Can anyone help? Thanks!!!

    ReplyDelete
  48. Solved it(Found the solution here:
    http://ubuntuforums.org/showthread.php?t=1045703 )

    The make command worked after I logged in as root

    sudo su

    Hope this helps someone!

    ReplyDelete
  49. Thanks Chris --brilliant job. Thanks for the care. Nice to have a lucid box that talks at N speed.

    ookook

    ReplyDelete
  50. Very cool. Thanks for posting this simple fix for my ASUS eee 1000. Well done!

    ReplyDelete
  51. hmm. Aha. Thanks so much for posting this. My first attempt at making and installing a driver from source. A very helpful and friendly article.

    However, after reboot, now wicd doesn't see the wireless networks at all. Before it could see them, but wouldn't connect.

    Better start from scratch. Sigh.

    michael

    ReplyDelete
  52. ooh ..correction!

    Wicd can't see any wireless connections, but via iwconfig i see that somehow the wifi card has in fact connected to the access point, and is happily pinging the gateway.

    Woohoo!

    Now to figure out why Wicd has lost its enthusiasm.

    Thanks and kind regards, michael

    (running msi wind u100+ same issue as others here, Rt2860 stopped working at the Lucid upgrade)

    ReplyDelete
  53. Exactly what I was looking for

    ReplyDelete
  54. when I did this:
    cp RT2860STA.dat /etc/Wireless/RT2860STA/RT2860STA.dat
    speed increased from 54 to 300 Mb/s

    when I compiled the driver (according to this instruction) my system became very unstable

    ReplyDelete
  55. Thank you for your very fine tutorial, I'm now connected with my wind u100 netbook with the ralink2860 wlan-chipset and ubuntu 10.04 NRM! I've been followed your tut step by step, all the other tuts and scripts in the www had no effect. Greetings from Saxony/Germany, Chris

    ReplyDelete
  56. This worked for me with ubuntu netbook remix with 2.6.32-21 and 2.6.32-22 kernels but when I updated to 32-23 kernel I cannot make it work anymore. Modprobe tells me it cannot add the driver because if invalid module format.
    Any help? The newest kernel provided driver is better than the old ones but I am still having problems with certain WPA+WPA2 networks so I'd like to use this driver.
    TIA for any advice.

    ReplyDelete
  57. When i launch sudo make (step 5), I've got the following error :
    ludi@ludi-laptop:~/Téléchargements/modules/rt2860$ sudo make
    make -C tools
    make[1]: entrant dans le répertoire « /home/ludi/Téléchargements/modules/rt2860/tools »
    gcc -g bin2h.c -o bin2h
    make[1]: quittant le répertoire « /home/ludi/Téléchargements/modules/rt2860/tools »
    /home/ludi/Téléchargements/modules/rt2860/tools/bin2h
    cp -f os/linux/Makefile.6 /home/ludi/Téléchargements/modules/rt2860/os/linux/Makefile
    make -C /lib/modules/2.6.32-23-generic/build SUBDIRS=/home/ludi/Téléchargements/modules/rt2860/os/linux modules
    make[1]: entrant dans le répertoire « /usr/src/linux-headers-2.6.32-23-generic »
    CC [M] /home/ludi/Téléchargements/modules/rt2860/os/linux/../../common/rtmp_init.o
    CC [M] /home/ludi/Téléchargements/modules/rt2860/os/linux/../../common/cmm_info.o
    /home/ludi/Téléchargements/modules/rt2860/os/linux/../../common/cmm_info.c: In function ‘RTMPIoctlGetSiteSurvey’:
    /home/ludi/Téléchargements/modules/rt2860/os/linux/../../common/cmm_info.c:1922: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
    /home/ludi/Téléchargements/modules/rt2860/os/linux/../../common/cmm_info.c:1922: error: (Each undeclared identifier is reported only once
    /home/ludi/Téléchargements/modules/rt2860/os/linux/../../common/cmm_info.c:1922: error: for each function it appears in.)
    /home/ludi/Téléchargements/modules/rt2860/os/linux/../../common/cmm_info.c:1922: error: implicit declaration of function ‘signal_pending’
    /home/ludi/Téléchargements/modules/rt2860/os/linux/../../common/cmm_info.c:1922: error: implicit declaration of function ‘schedule_timeout’
    make[2]: *** [/home/ludi/Téléchargements/modules/rt2860/os/linux/../../common/cmm_info.o] Erreur 1
    make[1]: *** [_module_/home/ludi/Téléchargements/modules/rt2860/os/linux] Erreur 2
    make[1]: quittant le répertoire « /usr/src/linux-headers-2.6.32-23-generic »
    make: *** [LINUX] Erreur 2
    ludi@ludi-laptop:~/Téléchargements/modules/rt2860$


    I need your help to correct this error.

    Could you please send me your RT2860 driver source code because i'have error when i decompress the files ?
    Thank you.

    ReplyDelete
  58. The error "Invalid module format" occurs when the module has been built against a kernel that is not the currently running kernel.

    Check the currently running kernel version with "uname -a" and if it is a .PAE kind, install the relevant kernel-devel with "yum -y install kernel-PAE-devel".

    ReplyDelete
  59. Is it possible that this might also work for RT2870 (with name substitution of course)?

    ReplyDelete
  60. Hi Cris,

    I'm trying to follow your guide, but I failed at step 1. The downloaded file from Ralink web must be corrupted, as I get a "bzip2: (stdin) is not a bzip2 file.". Would it be possible to sent the file to me ?. Thanks in advance !!!

    ReplyDelete
  61. The download link has changed. The new link is here

    Or if you want a different version you can find it here

    ReplyDelete
  62. Sorry for the bad embedding. The path to the driver is here

    An the link to the list of updated drivers is here

    ReplyDelete
  63. Thank you for this Chris. Worked fine with the new sauce location from the previous poster.

    Leaves me scratching my head as to why RALink would disable the WPA cipher bits in the first place, and how it got through Canonical's QA process, but that's another topic.

    ReplyDelete
  64. Hi again Chris,

    Sorry to post again, but still have the same problem when I download it: I get the error "bzip2: (stdin) is not a bzip2 file.".

    Am I doing something wrong???.

    jag@Multivac:~/Descargas/kk$ bzip2 -d ./2010_07_16_RT2860_Linux_STA_v2.4.0.0.tar.bz2
    bzip2: ./2010_07_16_RT2860_Linux_STA_v2.4.0.0.tar.bz2 is not a bzip2 file.
    jag@Multivac:~/Descargas/kk$ bzip2 -t ./2010_07_16_RT2860_Linux_STA_v2.4.0.0.tar.bz2
    bzip2: ./2010_07_16_RT2860_Linux_STA_v2.4.0.0.tar.bz2: bad magic number (file not created by bzip2)

    You can use the `bzip2recover' program to attempt to recover
    data from undamaged sections of corrupted files.

    jag@Multivac:~/Descargas/kk$ bzip2recover ./2010_07_16_RT2860_Linux_STA_v2.4.0.0.tar.bz2
    bzip2recover 1.0.5: extracts blocks from damaged .bz2 files.
    bzip2recover: searching for block boundaries ...
    bzip2recover: sorry, I couldn't find any block boundaries.
    jag@Multivac:~/Descargas/kk$

    Thank you in advance for your help !

    jag

    ReplyDelete
  65. Hi again,

    I need more caffeine... So stupid.... File opened !

    Thank you so much for the help !!!

    jag

    ReplyDelete
  66. Hi Chris,

    Thank you for this guide. I'm finding it helpful in learning to use command terminal. I just installed Ubuntu 10.04 LTS a few days ago. This is my first time using Linux, so I'm just beginning to learn. On step 5, on the make command, I got the following warning several times:

    warning: the frame size of * bytes is larger than 1024 bytes

    I'm not sure what to do about this. I also got the following error messages:

    CC [M] /home/deli/Temp/RT2860/os/linux/../../sta/wpa.o
    CC [M] /home/deli/Temp/RT2860/os/linux/../../os/linux/rt_linux.o
    /home/deli/Temp/RT2860/os/linux/../../os/linux/rt_linux.c: In function ‘RtmpOSNetDevAttach’:
    /home/deli/Temp/RT2860/os/linux/../../os/linux/rt_linux.c:1689: error: ‘struct net_device’ has no member named ‘open’
    /home/deli/Temp/RT2860/os/linux/../../os/linux/rt_linux.c:1690: error: ‘struct net_device’ has no member named ‘stop’
    /home/deli/Temp/RT2860/os/linux/../../os/linux/rt_linux.c:1691: error: ‘struct net_device’ has no member named ‘hard_start_xmit’
    /home/deli/Temp/RT2860/os/linux/../../os/linux/rt_linux.c:1692: error: ‘struct net_device’ has no member named ‘do_ioctl’
    /home/deli/Temp/RT2860/os/linux/../../os/linux/rt_linux.c:1702: error: ‘struct net_device’ has no member named ‘get_stats’
    /home/deli/Temp/RT2860/os/linux/../../os/linux/rt_linux.c:1736: error: ‘struct net_device’ has no member named ‘validate_addr’
    make[2]: *** [/home/deli/Temp/RT2860/os/linux/../../os/linux/rt_linux.o] Error 1
    make[1]: *** [_module_/home/deli/Temp/RT2860/os/linux] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-24-generic'
    make: *** [LINUX] Error 2

    I've spent a lot of of time researching and studying, seeking to figure this out. I appreiciate the challenge, but any help I can get on this would also be appreciated.

    ReplyDelete
  67. I got it. I figured out what I was doing wrong and completed the steps. My WPA connection is working fine now. Thanks again for this guide! It was very helpful. It's been a great learning experience for me.

    Phillip

    P.S. Your link to download the Ralink driver package didn't work for me. After entering my name and email address, It gave me an error page. I navigated through the site to get to the download. You might need to update the link.

    ReplyDelete
  68. Thank you, thank you, thank you!!!
    After much frustration trying to get up and running in "n" after finding that the native driver in Lucid did not allow this and much frustration trying to understand the "read me" file, my laptop is now "n" capable and "smoking"

    ReplyDelete
  69. Chris,

    Thanks you very much. I was having a hard time with WPA just like you. This was extremely helpful. Thanks again, much appreciated on the effort on this.

    ReplyDelete
  70. Thank you so much, you rock!

    ReplyDelete
  71. It's worth noting that even though the latest driver has the .bz2 extension, it's actually gzipped.

    I executed

    mv 2010_07_16_RT2860_Linux_STA_v2.4.0.0.tar.bz2 2010_07_16_RT2860_Linux_STA_v2.4.0.0.tar.gz

    Before unzipping using tar -zxvf mv 2010_07_16_RT2860_Linux_STA_v2.4.0.0.tar.bz2

    Hope that helps someone else.

    ReplyDelete
  72. The instructions worked for me pretty well, i just had to replace rt2860sta with rt3090sta since i guess both those drivers compile from the same source code. just us 'lspci' to see the exact chipset your card uses

    ReplyDelete
  73. I really hate to post about the same problem, but I did not find the answer. You have probably the only published help on getting RT2680 working with Ubuntu.

    I am getting an error when trying to complete step 5: sudo make:


    make[2]: *** [/home/cag-media/2010_07_16_RT2860_Linux_STA_v2.4.0.0/os/linux/../../common/cmm_wpa.o] Error 1
    make[1]: *** [_module_/home/cag-media/2010_07_16_RT2860_Linux_STA_v2.4.0.0/os/linux] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.35-27-generic'
    make: *** [LINUX] Error 2

    I even researched and found that I may need GCC installed. It is.

    Please help! I'm stuck!

    ReplyDelete
  74. I did get past those errors. Now this is happening:

    sudo rmmod rt2860sta

    ERROR: Module rt2860sta does not exist in /proc/modules

    Any help would be appreciated.

    ReplyDelete
  75. simply thanks a lot for these instructions.

    Bruno / Switzerland

    ReplyDelete
  76. Vincent Riedweg9/30/2011 7:55 AM

    Chris,

    Just a BIG THANKS for that.

    Great job!!!

    Vincent.

    ReplyDelete
  77. Absolutely amazing!
    Followed instructions step-by-step and now the built-in wifi card of my laptop is working.
    Thank you very much for share this info!
    (Laptop Medion MD96630; Wifi card chipset Ralink RT2860; Linux Mint 11).
    P.S: I let the my laptop wifi button control blocked before erasing WinXP and installing Mint (due to this had 'SIOCSIFFLAGS: Operation not possible due to RF-kill' at end of Step 7; Solution -> Installed 'rfkill' application to unblock it under Linux).

    ReplyDelete
  78. I'm a bit new to linux. This fix worked for me before, but it stopped working and I read somewhere that updating the kernel with re-break the driver.

    What steps do I need to repeat to re-apply this fix to the new kernel? Do I need to re-compile the driver (all of step 5) or can I start with "sudo ifconfig wlan0 down" part of step 5?

    Also, if anyone has some advice on how to automate the process or simplify it to one click that would be amazing.

    ReplyDelete
  79. 2 DoThoughts: use Stef`s automation script.

    Thanks a lot to Author for his work.

    ReplyDelete
  80. This fix works perfectly in 12.04 as well. Thanks for posting it! After searching endlessly this is the ONLY fix I found that solved my problem!

    ReplyDelete
  81. Thank you soooo much for the explanations! You saved my day!

    Lydia

    ReplyDelete
  82. Thank you for providing the link of the instruction that you discovered. I will try to do these steps and see if it will work for me.

    ReplyDelete