Ralink RT2870 based USB Wireless N adapters (Ubuntu)

Disabling WMM can affect VoIP. I do have a VoIP telephone connection.
I’ll keep it in mind but I’m not going to try it yet. That LaunchPad thread links to another one with several so called solutions. I don’t trust the solutions in that thread.
It boils down to “if one tries enough solutions it will somehow work” and the thread is outdated also.

My other laptop can connect using WPA2 to the same modem with the same USB stick so I don’t believe it is a WMM related problem.
I want to investigate the firmware for now. Is it possible to find the version number of the firmware in use?

B.T.W.: I’ve found a message of wpa_supplicant in the daemon log stating:

failed to disable WPA in driver

It only happens when in WPA2 mode not in WPA mode.

Oh, I agree about the thread… but… I take it your other system is using NetworkManager, which “somehow” seems to do the authentication differently.

I still think you should at least “try” it with WMM switched OFF… if it works, it probably means there is no other solution other than using WPA, or updating wpa_supplicant.

Indeed that other system is a regular desktop using NetworkManager.

Anyway, I did the test with WMM switched off on my server and it didn’t make any difference.
Fortunately, I’ve finally found the factor that did make the difference. Switching the network to WPA2 mode only (so not mixed WPA + WPA2) seems to be the only way to get it working.
Apparently the driver, module or firmware or whatever else can’t handle mixed mode and gets stuck. The older 2.6.31 kernel still handles mixed mode correctly.
I’ve done some tests with deliberately wrong settings. And if I set it to WPA2 + TKIP then I get more or less the same behavior as what the driver tries to do on a mixed mode network.

But there’s still something strange with the 2.6.35 kernel. Somehow it insists on loading the RT2870STA module although you’ve pointed out that it is in fact more likely to use the RT3070STA because the stick identifies itself that way.

Now I’ve this in /etc/modprobe.d/blacklist.conf:
blacklist rt2800usb
blacklist rt2800lib
blacklist rt2x00usb
blacklist rt2x00lib

blacklist rt2870sta
#blacklist rt3070sta

So those are all the appropriate modules for the usb stick as far as I know and I should expect it to obey this and thus loading rt3070sta but interestingly it still loads rt2870sta.
If I blacklist rt3070sta too, so that all appropriate modules are blacklisted then it also loads rt2870sta.
I can’t imagine that this behavior is hardcoded somewhere.

If you look in the recent firmware… rt3070 is just a symlink to rt2870, so I’m guessing it’s similar with the more recent driver module.

So I guess if you force the loading of rt3070, it still loads rt2870… though I would have expected blacklisting BOTH would have killed the connection :o

So are you sayiing that if you:
blacklist rt2800usb
blacklist rt2800lib
blacklist rt2x00usb
blacklist rt2x00lib
blacklist rt2870sta
blacklist rt3070sta

the connection STILL comes up, and loads rt2870sta ? … if so, what is the output from

lsmod

It may give a clue as to what is loading rt2870sta

Strange, and a little disappointing that the driver/kernel/firmware/wpa_supplicant can’t handle a router set to mixed mode ::slight_smile:

Thanks for letting us know that though… I’m sure someone will benefit from the info :wink:

It would be interesting to know if this is specific to the combination of your wireless card and router, or if it is a more general problem with ANY card and ANY router set to mixed mode.

Are you now considering the issue unresolvable, or are you still experimenting ?


on another note…

Did you ever try setting ‘HAS_WPA_SUPPLICANT=y’ and ‘HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n’ in config.mk before compiling… then bringing the network up with:

wpa_supplicant -Dralink -ira0 -c wpa_supplicant.conf -d

or

wpa_supplicant -Dralink -iwlan0 -c wpa_supplicant.conf -d

I’m still a bit bothered about why you’re wlan0 rather than ra0 as a logical device… as far as I’m aware, the ralink drivers should give you ra0, ra1, etc.

@ q7icmfm1x0h609c6xiok

I’m going to guess rt2870sta is being loaded in initrd … so if you updated it (now that rt2870sta is blacklisted in /etc/modprobe.d/blacklist.conf) that would stop it loading.

The problem with this is that there may not actually be a rt3070sta module.

What is the output from:

modinfo rt3070sta

rt2870sta being load in initrd? That might be possible although I don’t understand why because I did reinstall kernel 2.6.35 and so I rebuild the initrd I guess.
In my notes I read that I did a trick involving udev rules that was proposed on a website. It did it BEFORE the fresh reinstall of the kernel.
It involves this:

Create a new file /etc/udev/rules.d/network_drivers.rules with this line in it:
ACTION==“add”, SUBSYSTEM==“usb”, ATTR{idVendor}==“148f”, ATTR{idProduct}==“2870”, RUN+=“/sbin/modprobe -qba rt2870sta”

Create another new file /etc/modprobe.d/network_drivers.conf with this line in it:
install rt2870sta /sbin/modprobe –ignore-install rt2870sta $CMDLINE_OPTS; /bin/echo “148f 2870″ > /sys/bus/usb/drivers/rt2870/new_id

Then according to that website it should work. In my case it did not so I’ve removed those two files. I’ve tried it again and this time using 3070 in stead of 2870 but that didn’t work either so I removed that too.

The only uncertainty is that the file /sys/bus/usb/drivers/rt2870/new_id is still present. I can’t see its contents not even in superuser mode. I don’t know if it is present in a fresh install so I didn’t delete it.

modinfo rt3070sta indicates that the module isn’t present.

Removing those 2 files should have automagically removed the entry from /sys/bus/usb/drivers/rt2870/new_id, as it appears it is “injected” at each boot only if those files are present.

[EDIT]
Hmm… just had an idea… if you’ve removed those files, is the driver now aware of your device ID string ?, or is rt2870sta somehow getting loaded for an “unknown” device as a default… in which case it would probably be unaware of the correct section of the firmware to load.

I know this is only slightly related:

but it does point out that different sections of the firmware are used for different “devices”.

Adding the device ID to one of the installable drivers would be quite easy… and should leave you with ra0 rather than wlan0
[END EDIT]

But I’m still baffled where rt2870sta is being loaded, and why blacklisting has no effect… I know blacklist.conf will not stop drivers that are part of the kernel from being loaded, without updating initrd after blacklisting… so I’m afraid it’s just a bit of an assumption on my part that the rt2870sta module is being loaded by something contained in initrd … I’m not saying the module is itself “contained” in initrd, but your lsmod:

[b]Module Size Used by[/b] [b]rt2870sta 406818 1 crc_ccitt 1351 1 rt2870sta[/b]

seems to be saying rt2870sta is being used by one other module.

As far as I can remember, every lsmod I’ve seen it before read:

[b]Module Size Used by[/b] [b]rt2870sta 406818 0 crc_ccitt 1351 1 rt2870sta[/b]

OK, sometimes the rt2870sta module “size” varies depending on the version… but if I’m reading this correctly, something appears to be loading it as a dependency.

There definitely seems to be something rt2870 related in the kernel:

grep -i RT28 /boot/config-$(uname -r)*

output on my system (11.04 desktop)=

CONFIG_RT2800PCI=m CONFIG_RT2800PCI_RT33XX=y CONFIG_RT2800PCI_RT35XX=y # CONFIG_RT2800PCI_RT53XX is not set CONFIG_RT2800USB=m CONFIG_RT2800USB_RT33XX=y # CONFIG_RT2800USB_RT35XX is not set CONFIG_RT2800USB_UNKNOWN=y [b]<--- This maybe ?[/b] CONFIG_RT2800_LIB=m CONFIG_RT2860=m CONFIG_RT2870=m

That said, if there is no rt3070sta module, trying to load it seems somewhat pointess… I’ll keep digging :wink:
(see the EDIT above - I’m wondering if this is firmware “section” issue… ie. it’s using the wrong section)

Did any of that make sense to you, or should I try to re-order my line of thought ?


OK, this is a pure guess but see what you think anyway…

The parameter:
CONFIG_RT2800USB_UNKNOWN=y
says to the kernel, if an unknown RT2800USB device is encountered… load rt2800usb, but as that’s blacklisted, rt2870(staging) is loaded instead as it’s the most commonly used, and semi-works with most USB ralink devices.

So rt2870sta gets loaded before the blacklist.conf is read.

As it’s an “UNKNOWN” device (ie. the device ID is missing), rt2870sta uses the firmware section for RT2870 chipped cards, rather than the RT3070 section… which “semi” works with RT3070 chips

As I said, that it TOTAL speculation on my part… but it may explain things

So what I’m thinking is if we add your device ID to the most recent driver from ralink in the RT3070 section, and use the most recent firmware…

It would be nice to know for SURE where rt2870sta is getting loaded, so I’m off to see if I can find a way to discover this :wink:

IS the device ID set as a module alias ? … What is the output from:

modinfo rt2870sta | grep v148Fp3070

[EDIT]

BTW, if some of my previous post seemed a little bit like guess work… it was (kind of)… it was just me “thinking out loud” :slight_smile:

B.T.W.: the rt2870sta that is loading is indeed the version that belongs to the 2.6.35 kernel according to lsmod (so it’s no leftover from the 2.6.31 kernel).

OK, but is that new_id entry always present? Because in my Ubuntu desktop version there isn't a sys/bus/drivers folder at all.

NO… only when the module is loaded… which is why they have to be “injected” every time (or compiled in).

You cannot directly add the device ID to the driver (using this method), as the driver isn’t loaded yet… so you have to add the device ID to the USB subsystem, so when it’s detected by that subsystem, it modprobes the driver… NOW you can add the device ID to the driver.

The first file effectively adds the device ID to the USB subsystem and if the device is then detected, modprobes rt2870sta

The second file then adds the device ID to the drivers “new_id” file (now that it has been created) so the driver is aware of the device.

If (on your desktop version) you force rt2870sta to load with:

sudo modprobe rt2870sta

(or plug the device in)
you’ll see the drivers directory has now appeared :wink: … but that doesn’t necessarily mean it knows what to do with the device.

Two thing have to happen when you plug a USB device in…

  1. The USB subsystem has to be aware of the device ID so it knows what to do with the device, and what driver (if any) to load.
  2. The driver (after being loaded by the USB subsystem) also has to be aware of the device ID so it know that it is supposed to handle it.

The above is a kind of simplified version… the USB subsystem can often take an educated guess as to the device type if it doesn’t recognise the device ID

Non of this will survive a reboot if those files aren’t present (or are empty), or unless the device ID has been compiled into the driver and added to the USB subsytem.

BTW, I’m assuming that was a typo… it should be /sys/bus/usb/drivers/rt2870


I don't see any advantage in doing so. Post #10 in that launchpad thread reports also the name of interface as wlan0 so it happens more often.

I’m not saying that there is an advantage to having the logical name ra0 (that’s irrelevant) … but I was under the impression that the ralink staging drivers used ra0 etc. as the logical name, but rt2800usb used wlan0 etc.

Post #10 in the launchpad thread is using the rt2800usb driver… NOT rt2870sta

So I still have a sneeking suspicion that rt2800usb is coming into play somewhere here… or that rt2870sta hasn’t got the device ID string for your card compiled in.

Here’s the important bit (if you want to skip the rest)
What I think may be happening is the USB subsystem is aware of the device ID (from a previous driver compile/install) so is loading rt2870sta… but the driver (because it’s now the default version) isn’t aware of the device ID, or is using the wrong section or wrong version of the firmware.


B.T.W.: what does that size number mean?

not sure… I’ll see if I can find out.

[EDIT]
I haven’t got a clue ??? … but as you said it doesn’t seem to have any relationship to the size of rt2870sta.ko, that’s for sure… on my system

rt2870sta 450555 0
yet
rt2870sta.ko = 696712 bytes

I’m going to guess it’s the “loaded” size… but it’s a pure guess.
[END EDIT]


The device ID (148F:3070) is already in the RT3070 section if I recall it correctly. I did a test with kernel 2.6.35 with the firmware mentioned in the launchpad at that moment and it did not work.

Yes, but didn’t I add that device ID to the most recent drivers before you downloaded them from my dropbox ? … and even if I didn’t, they were never tested with the “latest” firmware were they ? (I don’t mean the firmware mentioned in that thread, I mean the very latest firmware)


ATM, I’m still trying to discover a way of being SURE where rt2870sta is being loaded…

Can you post the full output from:

modinfo rt2870sta

please.

and confirm that:

sudo lshw -C network

says the wireless device is using rt2870sta rather than rt2800usb

also, check to see if either of those are included in /etc/initramfs-tools/modules


BTW, I don’t know if it was a typo… but those 2 lines you originally added had the wrong ID string anyway:

Create a new file /etc/udev/rules.d/network_drivers.rules with this line in it: ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="148f", ATTR{idProduct}=="2870", RUN+="/sbin/modprobe -qba rt2870sta"

Create another new file /etc/modprobe.d/network_drivers.conf with this line in it:
install rt2870sta /sbin/modprobe –ignore-install rt2870sta $CMDLINE_OPTS; /bin/echo “148f 2870″ > /sys/bus/usb/drivers/rt2870/new_id

Isn’t your device ID 148f:3070 ?

Erm… sorry that was so long… I got a bit carried away :slight_smile:

hi,

i’m on linux 10.04 and got the Intex wireless usb adapter model no: IT-ULC21. I have been trying to follow the instructions but I think I’m missing something…

I can’t see the conflict is at the first pointer: here’s the output I get when I enter : sudo lsmod | grep rt28

rt2800usb              31531  0 
rt2x00usb               9703  1 rt2800usb
rt2x00lib              27509  2 rt2800usb,rt2x0

Moving on, I have a wireless icon in the top right corner that’s not showing any network at all. In previous tests before doing this fresh install, I added rt2800usb to blacklist which resulted in no wireless network AT ALL.

other commands and their output:

ifconfig ra0 up

ra0: ERROR while getting interface flags: No such device

iwconfig

lo        no wireless extensions.

eth0      no wireless extensions.

wlan0     IEEE 802.11bgn  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:on

lsusb

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 413c:2106 Dell Computer Corp. 
Bus 003 Device 002: ID 0461:4d81 Primax Electronics, Ltd 
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 005: ID 148f:2070 Ralink Technology, Corp. 
Bus 001 Device 002: ID 0bda:0181 Realtek Semiconductor Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I’m a total newbies so I kindly ask that you advise in plain, simple language.

Thanks.

Hi coolmac, welcome to the forum :slight_smile:

Your device should be included in rt2800usb… can you post the output from these commands to confirm:

modinfo rt2800usb | grep 2070

also

modinfo rt2870sta | grep 2070

also

modinfo rt3070sta | grep 148f

also

sudo lshw -C network

But I’ve also added the device ID (148f:2070) to this staging driver if you’d prefer to use that:
http://dl.dropbox.com/u/11876059/2011_0107_RT3070_RT3370_Linux_STA_v2.5.0.1_DPO.tar.bz2
just follow the instructions at the top, but with this driver.

thanks for the warm welcome! glad to be here…here’s the output

modinfo rt2800usb | grep 2070

alias:          usb:v148Fp2070d*dc*dsc*dp*ic*isc*ip*

modinfo rt2800sta | grep 2070

 could not find module rt2800sta

modinfo rt3070sta | grep 2070

ERROR: modinfo: could not find module rt3070sta


sudo lshw -C network

 *-network               
       description: Ethernet interface
       product: NetLink BCM57788 Gigabit Ethernet PCIe
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: eth0
       version: 01
       serial: f0:4d:a2:e9:10:00
       size: 10MB/s
       capacity: 1GB/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=tg3 driverversion=3.102 duplex=half firmware=sb latency=0 link=no multicast=yes port=MII speed=10MB/s
       resources: irq:27 memory:febf0000-febfffff
  *-network
       description: Wireless interface
       physical id: 1
       logical name: wlan0
       serial: 78:44:76:7f:75:d1
       capabilities: ethernet physical wireless
       configuration: broadcast=yes multicast=yes wireless=IEEE 802.11bgn

fingers crossed

You got the second command wrong… it should have been:

modinfo rt28[b]7[/b]0sta | grep 2070

But it’s unimportant… just try the drivers I gave you a link to.

You’ll still have to blacklist rt2800usb

thanks man. I have downloaded them and blacklisted rt2800usb.

If i’m to go ahead with the instructions as per first post of this topic,

there’s mention of installing “build-essential, and linux-headers-generic”. How can I do this on a computer that is offline…my thinking is it needs internet?

Am I wrong? -how do I proceed from here?-

thanks

Yes, I’m afraid it does need an active internet connection to install those packages… can’t you connect to the router with an ethernet cable ?

[EDIT]

If your 10.04 has never been updated, it may be best to remove the blacklisting of rt2800usb … connect to a router with an ethernet cable … run a complete system update … then check if your wireless “just works”, before installing the above mentioned driver :wink:

All right, I’m back again.

No problem at all… :wink:

First, it’s probably best to ignore rt3070sta (as a module), it doesn’t really exist anymore (at least not in Natty), 3070 based cards use rt2870sta, but load the rt3070.bin firmware.

Can you confirm this by running:

modinfo rt3070sta

I’m expecting -

ERROR: modinfo: could not find module rt3070sta

I’d also go with the staging driver over rt2800usb, which IMHO aren’t ready yet… indeed according to here:
http://linuxwireless.org/en/users/Drivers/rt2800usb

Broken Hardware encryption
and the latest commit here: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d53d9e67b55f6a9fc3f836c5c392eb41ce5676f4
Current problems: * [b]Cannot scan 11n AP's[/b] * No TX during first minute after association * [b][b]Broken Hardware encryption[/b][/b]

There is something very strange going on with your drivers… rt2870sta does have the device ID…

From modinfo rt2870sta

alias: usb:v[b]148F[/b]p[b]3070[/b]d*dc*dsc*dp*ic*isc*ip*
maybe left over from an earlier driver installation attempt... which would explain rt2870sta loading even if it's blacklisted.

but I’m still baffled why it’s wlan0, which suggests it’s using rt2800usb ???

Which driver is being used on the desktop edition ?

Is rt2870sta still blacklisted ?


OK, here’s what I’d do (but it’s up to you whether you want to mess with a working system)

  1. Download these drivers:
    http://dl.dropbox.com/u/11876059/q7icmfm%20-2011_0407_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.2_DPO.tar.bz2
    unpack them, cd into the direectory, change to root with sudo su, then run make && make install

  2. Make sure the ONLY thing that is blacklisted is rt2800usb … ie. un-blacklist -
    rt2800lib
    rt2x00usb
    rt2x00lib
    rt2870sta
    rt3070sta

  3. Reboot and test the card (or ifdown wlan0 then modprobe -r rt2870sta then modprobe rt2870sta then ifup ra0)

  4. if necessary, replace the firmware in /lib/firmware with the ones contained in the latest firmware from one of these Debian mirrors:
    Debian -- Error

Be aware - You cannot install this as you normally would a .deb… it’s best to backup the files you are going to replace in /lib/firmware

ie.

rt73.bin rt2561.bin rt2561s.bin rt2661.bin rt2860.bin rt2870.bin rt3070.bin <--- now replaced by a symlink rt3071.bin rt3090.bin <--- symlink

then manually unpack the files from the .deb (using fileroller), and place them in /lib/firmware


Then I would expect

iwconfig

to return something like -

[b]ra0[/b] 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

or similar.

If it does change to ra0, remember you’ll have to change it in /etc/network/interfaces

But as I said, it’s up to you if you want to mess with the wireless drivers/firmware, whilst it is (more or less) working :wink:

I managed to get an ethernet connection and ran sudo apt-get update…

I followed the instructions…delisted the blacklisted rt2800usb then restarted then ran sudo sh -c ‘echo rt2870sta >> /etc/modules’. Still no connection or any wireless connection.

i proceeded to blacklist it and installed the drivers then ran sudo make && make install. Restarted and still nothing shows. I then decided I’d delist the rt2800usb then see what happens. Wireless shows up but it doesn’t recognize any networks. which is wrong because the wireless is up and running. I then blacklisted rt2800usb and decided I’d come here again.

Output of a few commands that might help:

sudo lshw -C network

 *-network               
       description: Ethernet interface
       product: NetLink BCM57788 Gigabit Ethernet PCIe
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: eth0
       version: 01
       serial: f0:4d:a2:e9:10:00
       size: 100MB/s
       capacity: 1GB/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=tg3 driverversion=3.102 duplex=full firmware=sb ip=192.168.1.3 latency=0 link=yes multicast=yes port=MII speed=100MB/s
       resources: irq:27 memory:febf0000-febfffff

sudo ifconfig ra0 up

ra0: ERROR while getting interface flags: No such device

modinfo rt2870sta | grep 2070 and modprobe rt2870sta return nothing.

hope that gives you a clue. Thanks