2

I've got a generic Ralink wireless usb dongle, and a fresh install of Linux Mint 17 (cinnamon). I'd like to be able to use the dongle to connect to my wifi, so that i can free up some cat5 cables i have strewn about.

Unfortunately, it doesn't work by default, and I can't compile from source (it has errors). I apologize for the long post, but this is a condensed version of what I've tried in the last couple weeks.

To save some time, I'm going to paste the relevant system info below. First, uname -a

Linux stutter 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Here's the output from lsusb; to show the device is recognized. Device 5.

Bus 001 Device 005: ID 148f:7601 Ralink Technology, Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 003: ID 413c:2005 Dell Computer Corp. RT7D50 Keyboard
Bus 002 Device 002: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

The output from iwconfig; to show that it isn't being used as a wifi device. I understand there should be an "ra0" in this list. eth0 and eth1 are both wired ports on my motherboard - it has two.

eth0      no wireless extensions.
eth1      no wireless extensions.
lo        no wireless extensions.

Next, a lsmod, to show that the correct kernel modules are loaded. It's trimmed for brevity.

rt2800usb              27034  0 
rt2x00usb              20742  1 rt2800usb
rt2800lib              89076  1 rt2800usb
rt2x00lib              55307  3 rt2x00usb,rt2800lib,rt2800usb
mac80211              626489  3 rt2x00lib,rt2x00usb,rt2800lib
cfg80211              484040  2 mac80211,rt2x00lib
crc_ccitt              12707  1 rt2800lib
bnep                   19624  2 
rfcomm                 69160  0 
bluetooth             395423  10 bnep,rfcomm
....

So it ought to work out of the box, but it doesn't. My next thought was to compile from source. I go to the 2870 download page (http://www.mediatek.com/en/downloads/rt2870usbrt2870rt2770/), which i believe is the exact version this chipset was built for - although I don't have the manual for this device, so I'm not really sure. Anyway, I download the package, inflate it, modify the following lines in os/linux/config.mk:

HAS_WPA_SUPPLICANT=y
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y

Next I ensure that I've got all the right packages

sudo apt-get install build-essential linux-headers-$(uname -r) linux-firmware

And go back to the top level, trying out a "make". It doesn't take long before i hit the first errors:

/home/knetic/Downloads/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux/../../os/linux/rt_linux.c:1141:20: error: incompatible types when assigning to type ‘int’ from type ‘kuid_t’
   pOSFSInfo->fsuid = current_fsuid();
                    ^
/home/knetic/Downloads/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux/../../os/linux/rt_linux.c:1142:20: error: incompatible types when assigning to type ‘int’ from type ‘kgid_t’
   pOSFSInfo->fsgid = current_fsgid();
                    ^
make[2]: *** [/home/knetic/Downloads/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux/../../os/linux/rt_linux.o] Error 1
make[1]: *** [_module_/home/knetic/Downloads/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-24-generic'
make: *** [LINUX] Error 2

These errors are present in every version of the source on their site, not a single one of them builds for me. I'll admit that I could probably try to patch them myself, but I'd rather just buy a new device that has drivers which actually work, rather than trying to duct tape this one together.

So now I'm stuck - My stock drivers don't seem to believe that my device is for them, compiling from source seems to require a ton of patches, and nobody else seems to encounter these problems (every search seems to draw up an ocean of people who were able to compile from source).

I appreciate any help, I know this is sorta a niche question with a lot of info in it.

0

2 Answers 2

2

The Vendor+Product code 148f:7601 displayed by lsusb is info enough. By looking up WikiDevi, we can see your dongle is a TP-Link TL-WN727N v4, or a Shenzhen Ogemray Technology GWF-7A05. In any case, rt2800usb is not the appropriate driver: the command

 # modinfo rt2800usb | grep 148F | grep 7601

which searches for Vendor and Product code of your dongle among those for which rt2800usb is loaded, yields no output. Hence you need a different driver. This explains why, even after a successful compilation and installation of rt2800usb, your interface has not come up yet.

The same Wikidevi page suggests mt7601u_sta as the most likely Linux module. You can get it from here. This is surely the driver you are looking for: in the file DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/common/rtusb_dev_id.c, you can find the line

          {USB_DEVICE(0x148f,0x7601)}, /* MT 6370 */

which is what will appear in the output of modinfo mt7601u_sta.

This, however, is the end of the good news: it does not compile on either my Arch or my Debian Jessie systems. Also, Googling around it appears no one has managed to make it compile successfully on a recent kernel. I have seen reports for 3.12 to 3.15.

Just to be on the safe side, I also checked whether the newest backports, here, support this card. They do not, and you can check it yourself by compiling and installing the wifi defconfig, then trying modinfo on the newly minted rt2800usb. No luck.

2
  • Thank you for taking the time to do such a thorough look into things - I really appreciate it. If i could give you double-rep for that, I would. I had no idea that the ID displayed by lsusb was enough to find out what brand it was. Given that the device seems abandoned by its' makers, I'll just spring for a new device - One that I know is actively supported.
    – Knetic
    Jun 29, 2014 at 16:33
  • @Knetic yes,I agree this is the wiser choice Jun 30, 2014 at 5:23
1

From this question via "incompatible types when assigning to type ‘int’ from type ‘kgid_t’", try installing firmware-ralink before building (when in doubt, always search for the compiler error message):

sudo apt-get install firmware-ralink

Failing that, go with your last idea of purchasing a device known to work with Mint by default (which you may wish to do anyways, so you don't have to go through this every time you e.g. get a kernel update, or if you set up a new system).

4
  • That worked! The source now compiles. Thank you! However, after a sudo make install and subsequent modprobing, there's still no ra0 interface. I suspect I must have misremembered the ralink version, but running lsusb on the device doesn't give me anything other than that it's an "ralink compatible device". Are there any other ways of determining chipset version, or finding why there's no ra0 interface?
    – Knetic
    Jun 28, 2014 at 23:32
  • @Knetic Try ifup ra0 or ifup -a?
    – Jason C
    Jun 29, 2014 at 0:16
  • ifup -a gives me no output. ifup ra0 informs me that it's an unknown interface. iwconfig doesn't show anything, even though the module is definitely loaded and the device is definitely recognized.
    – Knetic
    Jun 29, 2014 at 1:47
  • I get E: Unable to locate package firmware-ralink
    – Jonathan
    Apr 27, 2015 at 0:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .