A listing of random software, tips, tweaks, hacks, and tutorials I made for Ubuntu

How to compile rt2870sta successfully

Many people have issues on compiling the rt2870sta driver, since it is no longer updated. The current Linux headers are much too new for the drivers. Luckily, the solution is very simple.
NOTE: This tutorial is only for USB Wireless Sticks.

Open up a Terminal window, and type in it:


Look for a line a bit like this:

Bus 001 Device 004: ID 1234:5555 BRAND_OF_STICK

Remember the parts in bold.
Now type in a Terminal window:

bunzip2 DRIVER.tar.lzma.bz2
unlzma DRIVER.tar.lzma
tar -xf DRIVER.tar
cd 2010_0709_RT2870_Linux_STA_v2.4.0.1
gedit common/rtusb_dev_id.c

A text editor should pop up. Add a new line (before the #endif // RT2870 // line), press TAB, and type:


And replace the parts in bold by the ID you saw in the lsusb command.
Save and close the file.
Then type in the Terminal window:

sudo make
sudo make install
cat << EOF | sudo tee -a /etc/modprobe.d/blacklist.conf
blacklist rt2x00usb
blacklist rt2x00lib
blacklist rt2800usb
echo 'rt2870sta' | sudo tee -a /etc/modules

If you had any problems, feel free to comment below.

If this helped you, please link to this post and/or leave a comment!


4 responses to “How to compile rt2870sta successfully

  1. Kamil Rowiński September 12, 2011 at 11:33 am

    Actually adding a vendor and product id to rtusb_dev_id.c is not mandatory, because some devices are already enlisted in this file. Still it’s good that you have added this to your howto, because it can be a real pain. Anyway I would recommend checking if the device is included in this file before adding new entry.

    • Anonymous Meerkat October 1, 2011 at 2:18 am

      Yeah, I know, but it’s better to have the device than to not have it!
      I’ll update the post when I’ll have time.

  2. Ruben Kurz January 19, 2012 at 8:42 am

    Hello there, thanks for the guide.
    I tried it today for an ASUS N13 USb device, did everything as you posted, but it doesn’t work.
    The module isn’t loaded during the boot process, as i can see with lsmod.

    When I try to do sudo modprobe rt2870sta, it gives me this :

    WARNING: All config files need .conf: /etc/modprobe.d/blacklist, it will be ignored in a future release.
    FATAL: Error inserting rt2870sta (/lib/modules/3.0.0-14-generic-pae/kernel/drivers/net/wireless/rt2870sta.ko): Invalid module format

    Maybe you have a clue, I will be extremly thankful,



  3. l0pan August 5, 2013 at 7:20 pm

    I finally got my D-Link DWA-140 working in Ubuntu under vmware. The trick was to make RT8070 /RT3070 driver from instead of RT2870. It is necessary also to set ‘HAS_WPA_SUPPLICANT=y’ and ‘HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y’ in and add these to /etc/modprobe.d/blacklist.conf:
    blacklist rt2870usb
    blacklist rt2x00usb
    blacklist rt2x00lib
    blacklist rt2800usb
    blacklist rt2870sta

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: