HowTo: WLAN Ralink RT2870 USB Stick + (K)Ubuntu 8.10

This is a HowTo about getting a Ralink RT2870 WLAN USB Stick on a Siemens Fujitsu PI 3645 with (K)Ubuntu 8.10 64bit (Intrepid Ibex) to work. The native Linux driver provided by Ralink Technology is being used.

I recently bought a Siemens Fujitsu Desktop PC PI 3645 and was really amazed that nearly all hardware was working out of the box with Kubuntu 8.10 64bit.

However the built-in WLAN adapter was not working. It showed up that it is a Ralink RT2870 USB Stick, somehow integrated although I haven’t found it yet.

My first try to get it working was with ndiswrapper. But I didn’t have a 64 bit Windows driver at hand, so I decided to use the original Linux driver provided by Ralink Technology.

The following posts have been of good use to me, still they have been a way too complicated or did not describe the way I got it working: “Followup on the Belkin F5D8053 and Ubuntu”, “Install linux drivers for ralink rt2870″ or “rt2870″.

UPDATE (2009/10/02): The links to the official Ralink drivers have been updated as version 2.2.0.0 of the driver package was released in Aug 2009. Still this version was not tested by me but I am happy if you leave a comment about your experiences.

Now let’s get started:

1.) First thing is to prepare the system for the driver compilation. Therefore it is needed to install certain tools and the headers of the running kernel:

  • sudo apt-get install build-essential linux-headers-`uname -r`

2.) Now the source for the Linux driver needs to be downloaded from the Linux support page of Ralink Technology.

  • Download this package (alternative mirror):
    wget http://www.ralinktech.com/license_us.php?n=2&p=0&t=U0wyRnpjMlYwY3k4eU1EQTVMekV5THpFMUwyUnZkMjVzYjJGa05UYzBNVFExTkRNNU5TNWllakk5UFQxU1ZESTROekJmVEdsdWRYaFRWRUZmVmpJdU15NHdMakF1ZEdGeUxuUmhjZz09Qw%3D%3D
  • Extract it somewhere:
    tar xvfj RT2870_LinuxSTA_V2.3.0.0.tar.tar.bz2

3.) Now the support of wpa_supplicant should be enabled in the file os/linux/config.mk of the driver package.

  • Open the file with your favorite text editor, for example GNU Emacs:
    emacs os/linux/config.mk
  • Change the following attributes from “no (=n)”:

    # Support Wpa_Supplicant
    HAS_WPA_SUPPLICANT=n

    # Support Native WpaSupplicant for Network Maganger
    HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n

    … to value “yes (=y)”:

    # Support Wpa_Supplicant
    HAS_WPA_SUPPLICANT=y

    # Support Native WpaSupplicant for Network Maganger
    HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y

4.) Afterwards the driver needs to be build and installed. Make sure to execute both commands in the root of the driver package and with superuser privileges:

  • sudo make
  • sudo make install

5.) Last thing is to add this driver to /etc/modules so that it is loaded automatically every time the system is rebooted.

  • Open the file with your favorite text editor, for example GNU Emacs:
    emacs /etc/modules
  • Add the following line:
    rt2870sta

    (others reported that they had only success by adding “alias ra0 rt2870sta“)

6.) If you do not want to reboot your machine, you should execute the following two lines with superuser privileges to load the driver and to integrate it in your networking configuration:

  • sudo modprobe rt2870sta
  • sudo /etc/init.d/networking restart

Now in my case with Kubuntu the KNetworkManager came up and listed me all available WLAN networks. Even without wpa_supplicant I was able to connect to my WPA2 encrypted network as KNetworkManager seems to have build-in WPA2 support.

16 Responses to “HowTo: WLAN Ralink RT2870 USB Stick + (K)Ubuntu 8.10”


  • Nice!

    It works with a lenovo 32-bit laptop running Kubuntu 8.10 & kdenetowrk

    Do you know how to make it work with WICD?

    Thanks,

    –Doug

  • very nice. worked perfectly.

  • When i get to the “sudo make” step, I get the following messages:
    fons@AcerPc:~/Wifidriver/2008_0925_RT2870_Linux_STA_v1.4.0.0$ sudo make
    [sudo] password for fons:
    make -C tools
    make[1]: Entering directory `/home/fons/Wifidriver/2008_0925_RT2870_Linux_STA_v1.4.0.0/tools’
    gcc -g bin2h.c -o bin2h
    make[1]: Leaving directory `/home/fons/Wifidriver/2008_0925_RT2870_Linux_STA_v1.4.0.0/tools’
    /home/fons/Wifidriver/2008_0925_RT2870_Linux_STA_v1.4.0.0/tools/bin2h
    cp -f os/linux/Makefile.6 /home/fons/Wifidriver/2008_0925_RT2870_Linux_STA_v1.4.0.0/os/linux/Makefile
    make -C /lib/modules/2.6.27-11-generic/build SUBDIRS=/home/fons/Wifidriver/2008_0925_RT2870_Linux_STA_v1.4.0.0/os/linux modules
    make[1]: Entering directory `/usr/src/linux-headers-2.6.27-11-generic’
    /home/fons/Wifidriver/2008_0925_RT2870_Linux_STA_v1.4.0.0/os/linux/config.mk:1: *** missing separator. Stop.
    make[1]: *** [_module_/home/fons/Wifidriver/2008_0925_RT2870_Linux_STA_v1.4.0.0/os/linux] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.27-11-generic’
    make: *** [LINUX] Error 2
    fons@AcerPc:~/Wifidriver/2008_0925_RT2870_Linux_STA_v1.4.0.0$

    Obviously something goes wrong. What mistake did I make?

    Fons

  • just do as root

    apt-get install linux-headers-`uname -r`

  • @apfelkraut , you may find that the driver included with 9.04 doesn’t support connections greater than 54Mb/s . A lot of reports of this in the ubuntuforums (and happening to me). So yes, it works – but not well.

  • I am limited to G only with 9.04… I tried using the method above, but no luck. It worked previously on older versions of ubuntu, It’s frustrating because I want to use MythTV with HD and need N speeds (over 5Ghz also) for HD content. Any word on how to update the driver, easily?

  • please help. i followed all the step but i still dont know what to do to get my wireless working, though it might be obvious to you. once again, please help,

    thanks

    • Jamie, I suppose you could complete successfully every step that I described so far?

      The network manager (“KNetworkManager” in case you are using KDE, “NetworkManager” in case of GNOME) should normally be started when you log into your desktop and come up with a list of all available WLAN networks. If not, maybe you have to start it manually by pressing “Alt”+”F2″ and entering the network manager of your desktop environment.

      If you run in a terminal window the command “ifconfig”, can you see at least the WLAN adapter, listed as “ra0″?

  • i use Tenda wifi, i do something like that
    but i got some error when i type: # sudo modprobe rt2870sta
    I got :
    Warning all config files need .conf /etc/modprobe.d/ndiswrapper it will be ignored in the future release
    all config files need .conf /etc/modprobe.d/blacklist it will be ignored in the future release
    when i type: iwconfig
    i got :
    l0
    eth0
    pan0
    i dont have ra0

  • @quakhu: My guess is that your device is not listed in the driver’s compatable list. Use a “lsusb” command to find out the USB ID of your device. it will be something like 0411,015d. Then check to see if, in the downloaded driver’s include directory, the rt2870sta.h file includes a line that reads USB_DEVICE(0×0411,0×015d), but with your USB codes. If not, add a line after all the others with your info. Then recompile and try inserting again. Now you should see the ra0.

  • I updated the links to the official Ralink drivers as version 2.2.0.0 of the driver package was released in Aug 2009.

    Still this version was not yet tested by me, but I would be happy if you could leave a comment about your experiences with it.

    Let’s see what Karmic Koala will offer, maybe I will give it a try on that release … but I do not own a 802.11n router, so I can check it only with my 802.11g Fritz!Box.

  • I downloaded the Ralink version 2.2.0.0 driver package. I am looking for the equivalent to the rt2870sta file.

  • There seems to be no links available to download the driver files at RALink EXCEPT the one that you provide above. They seem to be dropping it.

    http://www.ralinktech.com/download.php?t=U0wyRnpjMlYwY3k4eU1EQTVMekE0THpJMEwyUnZkMjVzYjJGa01ERTFPVGs0TmpRMk1DNWllakk5UFQweU1EQTVYekE0TWpCZlVsUXlPRGN3WDB4cGJuVjRYMU5VUVY5V01pNHlMakF1TUM1MFlYST1D

  • While compiling the driver I get an error with Karmic about net_device. I remember googling something like this before: ‘linux kernel 2.6.31 removes support for old net_device api’.
    The driver doesn’t work with kernel 2.6.31 & above?

Leave a Reply