32

I am trying to install a Ralink wifi adapter in Ubuntu Desktop 14.04.

The system is not detecting the wifi.

  1. lsusb lists the device as:

    Bus 002 Device 004: ID 148f:7601 Ralink Technology, Corp.
    
  2. I have the rt2800 USB driver listed in "/etc/modules";

  3. Following some instructions on the web, I tried this command:

    echo 148F 7601 | sudo tee /sys/bus/usb/drivers/rt2800usb/new_i
    
  4. lsmod | grep rt2800 returns the following:

    rt2800usb              26581  0 
    rt2x00usb              20041  1 rt2800usb
    rt2800lib              83150  1 rt2800usb
    rt2x00lib              48886  3 rt2x00usb,rt2800lib,rt2800usb
    mac80211              545990  3 rt2x00lib,rt2x00usb,rt2800lib
    crc_ccitt              12627  1 rt2800lib
    
Eric Carvalho
  • 54,385
  • I followed quite well the instructions above and it worked my pc recognized the adapter an successful connected to the wireless but when a try to get into Internet it freezes the browser and the OS, after that i can't do nothing.. did I do something wrong or miss any step ?? –  Jun 27 '14 at 16:16
  • Great! Good work! It's works on Ubuntu 14.04. Thnx. –  Jul 26 '14 at 09:50
  • i have tried that, but when i type the code "patch -p0 < ~/(ADD THE PATH)/rt2870-mt7601Usta-kuid_t-kgid_t.patch" in the terminal, i got the syntax error. could you provide me some other instructions? i am a real beginner in ubuntu world.thanks! – chinashieh Nov 28 '14 at 11:59
  • (ADD THE PATH) that where your patch is? For example, patch -p0 < ~/Downloads/rt2870-mt7601Usta-kuid_t-kgid_t.patch – Anıl Karaağaç Nov 28 '14 at 12:34
  • how can i find the patch? Is it the drivers that i have downloaded.i am new to ubuntu, sorry about ask such question! – chinashieh Nov 28 '14 at 12:57
  • The required driver can be easily installed from a PPA. Also, if you're running a kernel => 4.2 the adapter just works. Check my answer. – Eric Carvalho Oct 27 '15 at 12:25

5 Answers5

43

I suggest you get a temporary internet connection, ethernet, tethered or whatever is available. Then do:

sudo apt-get install linux-headers-generic build-essential git
git clone https://github.com/art567/mt7601usta.git
cd mt7601usta/src 
make
sudo make install
sudo mkdir -p /etc/Wireless/RT2870STA/
sudo cp RT2870STA.dat /etc/Wireless/RT2870STA/
sudo modprobe mt7601Usta

Your wireless should now be working.

You have compiled the driver for your current kernel version only. When Update Manager installs a later linux-image, after the required reboot, you must re-compile:

cd mt7601/src
make clean
make
sudo make install
sudo modprobe mt7601Usta

Please retain the files and these instructions for that time. Glad it's working!

Zanna
  • 70,465
chili555
  • 60,188
  • 1
    very very very very thanks for you,only such word could express my feeling now! the wireless work! Knowing poor about the ubuntu and something else, i have this problem confused for almost one day.I have read many times of your previous solutions about such kind of problem.but i still keep confused.Before post this question,i was imaging whether if you will help me solve this problem, thanksfully,you did.Thank you! – chinashieh Nov 28 '14 at 13:29
  • i have another question about this problem.If i update something,will it influence this driver?waiting for your answer. – chinashieh Nov 28 '14 at 13:35
  • Please see my edit above. If my answer has been helpful to you, please accept it. – chili555 Dec 01 '14 at 15:01
  • Great article. You made my day and dragged me out of hell !! :P – Sravan Nov 24 '17 at 11:31
  • Amazing. I would have marked as right answer. Thank you @chili555 – ArunKolhapur Feb 21 '18 at 00:31
  • is this also applicable to debian 10? As I'm facing same problem in debian. – Shivam Chhetri Nov 19 '19 at 12:51
  • @ShivamChhetri I don't know anything about Debian. This is a very old answer, so I doubt it. As the answer below suggests, isn't the module mt7601u included in all recent kernels? – chili555 Nov 19 '19 at 14:28
18

From Ubuntu 14.04 up to 15.04

The driver can be installed via a PPA:

sudo apt-add-repository ppa:thopiekar/mt7601
sudo apt-get update
sudo apt-get install mt7601-sta-dkms

Ubuntu 14.04 with kernel 4.2 and Ubuntu 15.10

The mt7601u driver was included in Linux kernel 4.2 but the firmware required by this adapter was not included in the package linux-firmware from Ubuntu 15.10 repository. The firmware can be downloaded from here and must be saved to /lib/firmware/mt7601u.bin ( <- must be lowercase). Run the following to download the firmware to the right location:

sudo wget -O /lib/firmware/mt7601u.bin https://github.com/porjo/mt7601u/tree/master/src/mcu/bin/MT7601.bin

Ubuntu 16.04 onward

The adapter just works.


The following adapters are supported:

  • 0b05:17d3
  • 0e8d:760a
  • 0e8d:760b
  • 13d3:3431
  • 13d3:3434
  • 148f:7601
  • 148f:760a
  • 148f:760b
  • 148f:760c
  • 148f:760d
  • 2001:3d04
  • 2717:4106
  • 2955:0001
  • 2955:1001
  • 2a5f:1000
  • 7392:7710
abggcv
  • 103
  • 4
Eric Carvalho
  • 54,385
  • I'm running ubuntu 15.10, and it doesn't work out of the box because the mt7601u.bin firmware file is missing. What package is supposed to provide that file? – ʇsәɹoɈ Jan 24 '16 at 20:00
  • @ʇsәɹoɈ Answer updated. – Eric Carvalho Feb 08 '16 at 13:41
  • Worked for 14.04..easier than compiling the driver – Jamess Nov 16 '16 at 07:23
  • I'm using ppa:thopiekar/mt7601, but after a kernel upgrade(still using linux kernel 3), when restart the computer, the wifi is lost, so I don't have any internet connection. So, apt-get command just get failed, my question is: are they any way to install this driver offline. For example, I just download the deb file and use the usb stick to copy from another computer(I have to manually download the deb? Or are the deb file are still cached in my computer? Thanks – ollydbg23 Sep 08 '17 at 00:43
  • I'm manually download the deb file from https://launchpad.net/~thopiekar/+archive/ubuntu/mt7601/+files/mt7601-sta-dkms_3.0.0.4-0~201602170732~rev26~pkg4~ubuntu14.04.1_all.deb which is for my ubuntu 14.04, and copy to the computer, and double click on the deb file and its still "Installing...", I'm not sure why it takes so long time to install, maybe it is compiling the kernel modules. – ollydbg23 Sep 08 '17 at 00:58
  • 1
    OK, problem solved, I see that the driver is correctly installed, but due to the secure boot setting, the driver can't be active, so I have to disable the secure boot feature, see here: UEFI/SecureBoot/DKMS - Ubuntu Wiki, I use the method 1, which just select the "Windows UEFI" type to "Other OS" type in the BIOS. – ollydbg23 Sep 08 '17 at 02:28
3

Download Driver and Patch by using the links.

Do not connect the USB:

sudo apt-get install --reinstall linux-headers-generic build-essential  
tar xjf DPO_MT7601U_LinuxSTA_3.0.0.4_20130913.tar.bz2  
cd DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/  
patch -p0 < ~/(ADD THE PATH)/rt2870-mt7601Usta-kuid_t-kgid_t.patch  
make  
su -c 'mkdir -p /etc/Wireless/RT2870STA/'  
su -c 'cp RT2870STA.dat /etc/Wireless/RT2870STA/RT2870STA.dat'  

Connect the USB

su -c '/sbin/insmod os/linux/mt7601Usta.ko'

If works:

su -c 'make install'
73Gavin
  • 138
  • 1
  • 7
user289087
  • 39
  • 2
  • 2
    Could you provide official/upstream links for the source and the patch used? – user.dz Jun 06 '14 at 16:21
  • I am currently downloading the file.....taking like, forever with a slow internet.....in the mean time, I had also performed the following commands:http://ubuntuforums.org/showthread.php?t=1608095&page=14 – user275399 Jun 06 '14 at 16:25
  • hope it doesnt change any of the settings and interfere with the above commands – user275399 Jun 06 '14 at 16:31
  • The source links are dead, try http://www.mediatek.com/en/downloads/mt7601u-usb/ and http://www.mediafire.com/download/fezezv1u28y7eey/rt2870-mt7601Usta-kuid_t-kgid_t.patch. The procedure worked fine for my Lexosys LEO NANO 150N. – tinkerbeast Oct 29 '14 at 17:44
  • 1
    When I try to use this compiled driver a get a kernel panic.

    3.13.0-40-generic and 14.04.1

    – Raphael Nov 27 '14 at 22:24
  • @Raphael I also get a kernel panic on Ubuntu 14.04 with kernel 3.16.7 although I got that to work on 13.10 with kernel 3.13.5. Any clues ? – Patryk Jan 13 '15 at 20:36
  • Dead links, Dead answer. Why this answer is still here ? – NickTux Jan 17 '15 at 21:09
2

What worked for me

kernel version: 4.13.*

  • restart the PC to ensure that no kernel update is pending
  • Get your current kernel version using uname -r command.
  • Get the folder drivers/net/wireless/mediatek/mt7601u from Linux-kernel source tree (https://github.com/torvalds/linux/).

    Must match with your kernel version. Upto the first two-digits, e.g. 4.13 in my case. You will find the exact matched kernel by checking the tags on Github's branch drop-down menu.

  • Remove the device from pc

  • Now, open the phy.c file from the downloaded folder.
  • find the function mt7601u_init_cal in the file
  • Look up for RXIQ. Comment out the lines

//ret = mt7601u_mcu_calibrate(dev, MCU_CAL_RXIQ, 0); //if (ret) // return ret;

  • Build the module using make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
  • run sudo rmmod mt7601u
  • run sudo insmod mt7601u.ko
  • now, insert the device to pc
  • check kernel messages using dmesg if anything is fatal error
  • Check if the new network interface is recognized using ifconfig command

Note

To make sure any of these works, you have to make sure you have updated binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel dkms installed. Depending on your distro, some of them can be slightly different.

src: https://github.com/kuba-moo/mt7601u/issues/64#issuecomment-324894792

kmonsoor
  • 165
0

This just means you are supposed to give the path to the patch file.

Just insert the complete location of the patch file. Assuming the file is located at /tmp/patch/rt2870-mt7601Usta-kuid_t-kgid_t.patch, you would use the following command:

patch -p0 < /tmp/patch/rt2870-mt7601Usta-kuid_t-kgid_t.patch

Note that you have to be in the directory where the file you want to patch is located. I assume it is in /tmp/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/, the directory you're already in.

s3lph
  • 14,314
  • 11
  • 59
  • 82
  • Now i have a new problem. After start Ubuntu and open Firefox or anything Ubuntu was blocked i reset is required: mouse does not move and keyboard lights are flashing: CAPS and Bloqs. – Guillermo de Pedro Sep 27 '14 at 14:44
  • The flashing lights indicate a kernel panic. After boot, hit ctrl+alt+f1 and login. search in /var/log/kern.log for errors. (somewhere at the end). Ask a new question for that and give those error messages. – s3lph Sep 28 '14 at 01:35
  • Thanks a lot. Continue at: http://askubuntu.com/questions/529616/keyboard-flashing-lights-after-wireless-configuration – Guillermo de Pedro Sep 28 '14 at 12:14