Ralink RT5572 based WiFi Usb Dongle setup on Ubuntu 12.04
September 2, 2012
· ctheroux
Ubuntu 11.10
Ubuntu 11.04
Ubuntu
Linux
WiFI
Ubuntu 12.04
RT5572
Ralink
The WiFi USB dongles based on the newest RT5572 chip set do not work out of the box on Ubuntu. Unex DNUR-V72, D-Link DWA-160 Rev B and TP-Link TL-WDN3200 dongles are based on this chipset. You will need to compile the source code of the driver to make it work. Do not leave this page! This involves only a few easy steps.
- Save this page's link. You will have to reboot and come back to it.
- Un-plug the WiFi USB dongle from your computer.
- Reboot your computer.
- Download the driver's source code from the manufacturer website. Alternatively, you can download a version of this file from this site. Files have been already edited. Steps 9, 10 and 11 are then unnecessary. Note that the filename is slightly different (DPO_RT5572_LinuxSTA_2.6.0.1_20120629_EDITED.tar.bz2).
- Open a terminal window.
- Change to the directory that contains the driver's source code downloaded previously. For example,
cd /home/myuser/Downloads
- Extract the source code. You might need the modify the file name since Mediatek may publish newer source code. For example (there is two bz2 extensions!),
tar xvf DPO_RT5572_LinuxSTA_2.6.0.1_20120629.tar.bz2
- Change to the source code directory
cd DPO_RT5572_LinuxSTA_2.6.0.1_20120629
- Edit the file os/linux/config.mk. Set to y the two variables HAS_WPA_SUPPLICANT and HAS_NATIVE_WPA_SUPPLICANT_SUPPORT. Your file shall shows
# Support Wpa_Supplicant
# i.e. wpa_supplicant -Dralink
HAS_WPA_SUPPLICANT=y
# Support Native WpaSupplicant for Network Manager
# i.e. wpa_supplicant -Dwext
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y
- Edit the file os/linux/usb_main_dev.c. Add a line containing MODULE_LICENSE("GPL");. This line is important. The position of the line is important. Your file shall shows
MODULE_DESCRIPTION("RT2870 Wireless Lan Linux Driver");
MODULE_LICENSE("GPL");
#ifdef CONFIG_STA_SUPPORT
#ifdef MODULE_VERSION
- Edit the file common/cmm_mac_usb.c and add the lines "#define usb_buffer_alloc(a, b, c, d) usb_alloc_coherent(a, b, c, d)" and "#define usb_buffer_free(a, b, c, d) usb_free_coherent(a, b, c, d)". The position of the lines is important. Your file shall shows
#ifdef RTMP_MAC_USB
#define usb_buffer_alloc(a, b, c, d) usb_alloc_coherent(a, b, c, d)
#define usb_buffer_free(a, b, c, d) usb_free_coherent(a, b, c, d)
#include "rt_config.h"
- In the same directory as step #8, compile the driver's source code. Type the following command:
sudo make
- Install the driver. Type the following command:
sudo make install
- Plug your WiFi USB dongle.
- After a few seconds, you should see an interface called ra0 if you type the following command:
sudo ifconfig
- Configure your connection as you would normally do.
Comments
Leave a Comment
Replying to
Copyright 2012–2026, Claude "Tryphon" Théroux
how to create usb wifi auto enabled(detected) when computer reboot. thanks
make defconfig-wifi
make
sudo make install
sudo modprobe -r rt5572sta
sudo modprobe rt2800usb
Although the driver works out the box with Ubuntu 14.04 the free drivers perform horribly compared to the Mediatek drivers. I tried installing it on Ubuntu 14.04 but I get syntax errors and such probably due to new kernel because it works perfectly fine under Debian Wheezy. Any suggestions? I don't know if Ubuntu has any firmware to support in the repos I have checked but no luck.
Thanks!
Search for these lines:
#if LINUX_VERSION_CODE fsuid = current->fsuid;
pOSFSInfo->fsgid = current->fsgid;
current->fsuid = current->fsgid = 0;
and add directly after these lines the following code:
#else if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
#endif
This is a really dirty hack, but it works for me.
Thanks so much.
and insert
#if LINUX_VERSION_CODE fsuid = current->fsuid;
pOSFSInfo->fsgid = current->fsgid;
current->fsuid = current->fsgid = 0;
#else if LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)
#endif
pOSFSInfo->fs = get_fs();
set_fs(KERNEL_DS);
this is a real dirty hack, but it works.
pOSFSInfo->fsuid = __kuid_val(current_fsuid());
pOSFSInfo->fsgid = __kgid_val(current_fsgid());
instead of
pOSFSInfo->fsuid = current_fsuid();
pOSFSInfo->fsgid = current_fsgid();
and it worked for me. I think this may be a solution.
But when i get software updated from ubuntu i must do to the directory of the the driver run " make " and then " make install" to meke the adapter works again
This terrifice page has helped me in the past, but now I'm having trouble using a TP-Link WDN3200 usb adapter (rt5572) on Debian 7.3. When I get to your step 12 (make), I get this output:
===============================
make -C tools
make[1]: Entering directory `/home/myname/DPO_RT5572_LinuxSTA_2.6.0.1_20120629/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/myname/DPO_RT5572_LinuxSTA_2.6.0.1_20120629/tools'
/home/dclinton/DPO_RT5572_LinuxSTA_2.6.0.1_20120629/tools/bin2h
cp -f os/linux/Makefile.6 /home/myname/DPO_RT5572_LinuxSTA_2.6.0.1_20120629/os/linux/Makefile
make -C /lib/modules/3.8.7-yocto-standard/build SUBDIRS=/home/dclinton/DPO_RT5572_LinuxSTA_2.6.0.1_20120629/os/linux modules
make: *** /lib/modules/3.8.7-yocto-standard/build: No such file or directory. Stop.
make: *** [LINUX] Error 2
=====================
Do you have any ideas?
Thanks so much!
http://www.raspberrypi.org/forums/viewtopic.php?p=499744#p499744
sudo make uninstall
can someone please help? thanks
I run "sudo modprobe mt7601Usta" at the end and it worked fine! so happy..., it was really doing my head in.
(needless to say that if your chip is of a slightly different version, you should modprobe the correct module..)
My Xubuntu Linux on Fujitsu Siemens Lifebook C1020 workin fine with USB-WiFi TP-Link TL-WDN3200 ! I am happy !
Thanks
p.s.i have a laptop which runs ubuntu 12.10 i686 platform,with it,the driver and this wireless adapter works ok.
want help.
no solution for this issue?
thanks
me. And i am glad reading your article. But should remark on
some general things, The site style is ideal, the articles iis really nice : D.
Good job, cheers
Where else could I am getting that type of info written in such an ideal means?
I've a venture that I am simply now operating
on, and I've been on the look out for such information.
Have a look at my web site: Rayford