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.

24 thoughts on “HowTo: WLAN Ralink RT2870 USB Stick + (K)Ubuntu 8.10

  1. 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

  2. @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.

  3. 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?

  4. 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

    1. 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″?

  5. 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

  6. @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(0x0411,0x015d), 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.

  7. 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.

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

  9. 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?

  10. Thank you for your detailed step-by-step instructions for obtaining, compiling, and installing the Linux driver for

    the RT2870 USB device for Ubuntu 8.10.

    My USB device is at least now seen by the OS. lshw -C network and iwconfig now show the following for me.

    lshw -C network

    *-network:0
    description: Wireless interface
    physical id: 1
    logical name: ra0
    serial: 00:25:9c:e7:62:35
    capabilities: ethernet physical wireless
    configuration: broadcast=yes driver=RALINK WLAN driverversion=2.3.0.0 multicast=yes wireless=Ralink STA

    root@ubuntu0:/etc/network# iwconfig
    lo no wireless extensions.

    eth0 no wireless extensions.

    ra0 Ralink STA ESSID:”11n-AP” Nickname:”RT2870STA”
    Mode:Auto Frequency=2.412 GHz Access Point: Not-Associated
    Bit Rate:1 Mb/s
    RTS thr:off Fragment thr:off
    Encryption key:off
    Link Quality=10/100 Signal level:0 dBm Noise level:-87 dBm
    Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
    Tx excessive retries:0 Invalid misc:0 Missed beacon:0

    vnet0 no wireless extensions.

    pan0 no wireless extensions.

    But I still have not had any success in actually establishing network connectivity. I have attempted to setup
    the network

    1) manually, e.g.,

    iwconfig ra0 mode Managed
    iwconfig ra0 essid GXBL1

    and 2) using Network Manager

    but have had no success. Could you give me some direction? I would be happy to supply any additional
    information that you might need.

    Thanks,
    Bruce Driver

  11. I have wusb100v2 working with ubuntu 10 beta, and I have the most everything complete except I can not get the device to transmit, or work. I have ra0 listed as my network device, and I can bring it up and down, but I can not set the power level or transmit power. It gives me operation not supported 8b26

  12. Your tutorial worked like a dream on Linux Mint 9 (32 bit) and a realcheap usb wifi dongle (RT2870 chipset)from Hong Kong. I’m truly indebted to you – Thank you.

  13. hmm.. looks promising. in <=9.04 my wifi dongle (belkin N) worked flawlessly, ever since 9.10 i had to blacklist rt2800sta, but since the release of 10.04 (amongst slackware/sidux/debian/fedora/mint/sabayon…) i cannot seem to get it working (i think i've typed `modprobe` more times than i have "lol" now..) Must be a mainstream kernel problem? Literally installed/formatted over 50 different distros trying to find one that will work *out of the box*. No luck… writing from a windows xp box rofl.

    Anyway thanks for post it looks like it may finally work. I'll post back with my dongles hardware id and any other things i had to do if it works.

  14. I have a USB wireless-n adapter on Ubuntu 10.04. I installed WICD instead of the default Gnome Network Manager. I can see my network as plain as day but when I enter either the WPA 1/2 password and / or the preshared network key for my D-Link DIR-628, I get an incorrect password message in WICD. Am I missing something?

  15. I’m in your debt Mr Schmuhl. I can’t find your Flattr button to thank you for being the (nearly) only web site that links to the alternative Ralink download location for this elusive driver.
    Ralkink’s site seems to be permanently down.

    For your data:
    Device “NetComm 11n Wireless” usb
    The driver compiled perfectly using Karmic Gnome. I look forward to testing the compile again when I try out Natty next month.
    The device loads automatically with the kernel driver “rt2800usb” added to /etc/modprobe.d/blacklist.
    And thanks for the tip about toggling Wpa Supplicant mode on!

    It talks at 135Mbs to our new Fritz!BoxFon 7270. AVM have just released their beautiful technology on the Australian market and I’m simply amazed at the cleverness of this home network manager.
    And the DECT Fritzfon isn’t too bad either :-)

    PS love the boots/girl/woman pics. Ha!

    regards, Nan M

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>