BE AWARE
For kernels >= 2.6.35 make sure you read the the EDIT.
If you want to know which kernel you are using, open a terminal and enter:
uname -r
(if it’s greater than, or equal to 2.6.35, be sure to follow the instructions in the EDIT.
In Ubuntu 9.10 (Karmic), Ubuntu 10.04 (Lucid), and Ubuntu 10.10 (Maverick) there is an issue with USB Wireless N adapters based on the Ralink RT2870 chip.
The issue seems to be that 2 (conflicting?) driver modules are loaded… rt2870sta and rt2800usb… resulting in no wireless access.
The solution is to blacklist the rt2800usb module if it is loaded.
To see if they are both loaded, enter this in a terminal:
sudo lsmod | grep rt28
if they are both loaded, blacklist the rt2800usb module by opening the /etc/modprobe.d/blacklist.conf file (as root)
sudo gedit /etc/modprobe.d/blacklist.conf
and add the line:
blacklist rt2800usb
then save the file and reboot.
If after rebooting you can now ‘see’ the network, but it will not accept a WPA key (WEP seems fine)… you need to recompile the driver with WPA support… the driver can be found here:
2010_0709_RT2870_Linux_STA_v2.4.0.1.tar.bz2 (you can enter ‘any’ name and email)
or
Ralink Linux Driver Page
(HINT - change the files extension to tar.gz before unpacking… for some reason it comes up as an invalid bz2 archive, but unpacks properly as a tar.gz)
Before compiling - you are going to need to install build-essential, and linux-headers-generic.
sudo apt-get update && sudo apt-get install build-essential linux-headers-generic
If you use WPA/WPA2 encryption, you will have to change the lines
HAS_WPA_SUPPLICANT=n
and
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n
in:
/os/linux/config.mk
(inside the unpacked driver)
to
HAS_WPA_SUPPLICANT=y
and
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y
Once you have changed these to =y and saved the config.mk file…
[EDIT]
Newer kernels >= 2.6.35 will fail to compile (make) the driver because the driver makes use of the functions usb_buffer_alloc() and usb_buffer_free() which were renamed in kernel 2.6.35 … so if during the next (make && make install) step it fails with this error:
make[2]: *** [/home/mark/Desktop/RT2870/os/linux/../../common/cmm_mac_usb.o] Error 1 make[1]: *** [_module_/home/mark/Desktop/RT2870/os/linux] Error 2 make[1]: Leaving directory `/usr/src/linux-headers-2.6.35-27-generic' make: *** [LINUX] Error 2or similar.
The fix is to cd to the driver source directory (eg. 2010_0709_RT2870_Linux_STA_v2.4.0.1), and run the following 3 commands which will clean the build directory and replace the old calls with the new ones:
make clean
find . -name \*.[ch] -exec grep usb_buffer_alloc "{}" ";" -exec sed -i 's/usb_buffer_alloc/usb_alloc_coherent/g' "{}" ";"
find . -name \*.[ch] -exec grep usb_buffer_free "{}" ";" -exec sed -i 's/usb_buffer_free/usb_free_coherent/g' "{}" ";"
(hitting enter after each line)
Or, I’ve uploaded a pre-modified version of the driver that WILL compile on kernels >= 2.6.35 here:
2010_0709_RT2870_Linux_STA_v2.4.0.1.tar.bz2
Then carry on with the “sudo su” and “make && make install”, as per the instructions below.
[END EDIT]
To compile and install, open a terminal and enter:
sudo su
make && make install
It is important here not to use “sudo” alone, but “sudo su” because with sudo for some reason the installation script fails to create the necessary files and folders.
Now, while still root modprobe the driver module:
modprobe rt2870sta
Give it a minute to create the ra0 device node, and network manager should now be able to display all visible wireless networks in your area, meanwhile you can stop being root.
exit
Make sure that ra0 is up and running as it’s supposed to:
iwconfig
and check for a section similar to:
ra0 RT2870 Wireless ESSID:"" Nickname:"RT2870STA" Mode:Managed Frequency=2.412 GHz Access Point: Bit Rate=54 Mb/s RTS thr:off Fragment thr:off Link Quality=100/100 Signal level:-29 dBm Noise level:-71 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0
To make sure the module is loaded after a reboot, add it to the /etc/modules file:
sudo sh -c 'echo rt2870sta >> /etc/modules'
Your wireless card should now be working (it may require a reboot first)… Use network manager to set your WEP/WPA(2) key, and connect to your network.
Further info can be found at the following URLs:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/460323