Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
RT3070 based usb-wifi dongle - wpa_supplicant not connecting
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
wedz
n00b
n00b


Joined: 15 Apr 2013
Posts: 4

PostPosted: Mon Apr 15, 2013 1:46 pm    Post subject: RT3070 based usb-wifi dongle - wpa_supplicant not connecting Reply with quote

Hi all,

I'm sorry to post this not actually a "Gentoo related" problem, but I have been reading through a lot of exactly same symptoms for Ralinks rt3070 based chipsets from these forums, and there seems to be a lot of knowledge around here on the subject.

I am actually running an ARM development board (based on Freescale iMX233), and I have created my rootfs with buildroot (ver. 2013.2).
Compiled kernel is based on Freescales mainline kernel with patches for 3.8.

I use cross compiling tools generated by buildroot, and compile my Ralinks official driver (http://www.mediatek.com/_en/07_downloads/01_windows.php?sn=501 - RT8070 /RT3070 /RT3370 /RT5370 /RT5372 USB). I think many people around here have been compiling same driver.
The driver is compiled ok, and I am able to load it into kernel, and I can bring "ra0" interface up:
Code:

# ifconfig ra0 up
[ 2401.580000] (Efuse for 3062/3562/3572) Size=0x2d [2d0-2fc]
[ 2402.140000] RTMP_TimerListAdd: add timer obj c4ae2170!
[ 2402.150000] RTMP_TimerListAdd: add timer obj c4ae21c8!
[ 2402.150000] RTMP_TimerListAdd: add timer obj c4ae2220!
[ 2402.160000] RTMP_TimerListAdd: add timer obj c4ae2118!
[ 2402.160000] RTMP_TimerListAdd: add timer obj c4ae2010!
[ 2402.170000] RTMP_TimerListAdd: add timer obj c4ae2068!
[ 2402.170000] RTMP_TimerListAdd: add timer obj c4aacba4!
[ 2402.180000] RTMP_TimerListAdd: add timer obj c4a9c260!
[ 2402.180000] RTMP_TimerListAdd: add timer obj c4a9c2c0!
[ 2402.190000] RTMP_TimerListAdd: add timer obj c4aaccc0!
[ 2402.190000] RTMP_TimerListAdd: add timer obj c4aacaf4!
[ 2402.200000] RTMP_TimerListAdd: add timer obj c4aacc64!
[ 2402.210000] -->RTUSBVenderReset
[ 2402.220000] <--RTUSBVenderReset
[ 2403.240000] CfgSetCountryRegion():CountryRegion in eeprom was programmed
[ 2403.250000] CfgSetCountryRegion():CountryRegion in eeprom was programmed
[ 2403.260000] Key1Str is Invalid key length(0) or Type(0)
[ 2403.260000] Key2Str is Invalid key length(0) or Type(0)
[ 2403.270000] Key3Str is Invalid key length(0) or Type(0)
[ 2403.280000] Key4Str is Invalid key length(0) or Type(0)
[ 2403.280000] 1. Phy Mode = 5
[ 2403.290000] 2. Phy Mode = 5
[ 2403.290000] NVM is Efuse and its size =2d[2d0-2fc]
[ 2403.430000] phy mode> Error! The chip does not support 5G band 5!
[ 2403.440000] (Efuse for 3062/3562/3572) Size=0x2d [2d0-2fc]
[ 2403.500000] 3. Phy Mode = 9
[ 2403.510000] AntCfgInit: primary/secondary ant 0/1
MCS Set = ff 00 00 00 01
[ 2403.700000] <==== rt28xx_init, Status=0
[ 2403.700000] 0x1300 = 00064300
# ifconfig
lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

ra0       Link encap:Ethernet  HWaddr 10:6F:3F:EC:C9:9F 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:209798 (204.8 KiB)  TX bytes:41862 (40.8 KiB)


Wifi scan works, I can see neighboring APs:
Code:

# iwlist ra0 scan
[ 2442.870000] ===>rt_ioctl_giwscan. 9(9) BSS returned, data->length = 1515
ra0       Scan completed :
          Cell 01 - Address: 7C:E9:D3:A8:73:7F
                    Protocol:802.11b/g/n
                    ESSID:"7CE9D3AED861"
                    Mode:Managed
                    Frequency:2.412 GHz (Channel 1)
-- snip --


I have created a very minimal wpa_supplicant.conf to /etc:
For testing purposes I have set my 2.4GHz encryption to WPA-TKIP, and password is "testataan"
Code:

network={
        ssid="O_o"
   scan_ssid=1
   key_mgmt=WPA-PSK
   proto=WPA
   psk="testataan"
}


The RT2870STA.dat file, that instructs the driver is located in /etc/Wireless/RT2870STA/RT2870STA.dat
It can be found in full here: http://paste.ubuntu.com/5710369/

Now, when I try to connect to my network, I use command:
Code:
# wpa_supplicant -Dwext -i ra0 -c /etc/wpa_supplicant.conf -K -d

That always ends up with these 2 messages:
Code:

ra0: Association request to the driver failed
ra0: Authentication with 54:04:a6:8f:b3:4a timed out.


I also uploaded full debug log (messages that come with -d -K parameters): http://paste.ubuntu.com/5710366/

What I would like to ask is what could be wrong here ? Why all WPA connections always fail ? Is my wpa_supplicant.conf file ok ? Is there some simple reason why "driver association" fails ?
Am I giving the password and encryption details correctly ? (I also did try wpa_passphrase, and it generated a hex string, but that didn't help).
I am not so experienced in this embedded world (and this is my first own linux project as well), so please don't hesitate to suggest anything!
Thank you!
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 1561
Location: Berlin, Germany

PostPosted: Mon Apr 15, 2013 3:33 pm    Post subject: Reply with quote

In my experience the ralink driver is very crappy. Install it only if you cannot use the in-kernel rt2800 driver for some reason.
Back to top
View user's profile Send private message
khayyam
Veteran
Veteran


Joined: 07 Jun 2012
Posts: 1549

PostPosted: Mon Apr 15, 2013 3:42 pm    Post subject: Reply with quote

wedz ...

Here isn't really the place to get general linux/embedded support, as the banner states "gentoo linux forums". I'll request admin move this to "Unsuported Software".

Anyhow, if it is a rt3070 then there is an in kernel driver, CONFIG_RT2800USB.

"This adds support for rt27xx/rt28xx/rt30xx wireless chipset family. Supported chips: RT2770, RT2870 & RT3070, RT3071 & RT3072"

So I'd suggest you use this rather than the one from ralink, the reason being that this will use CFG80211 and not WEXT, which seems to be root cause of problem your having above (note, iwlist, which uses WEXT works). Also, wpa_supplicant can be built with various build time switches, so you should check to see if either NL80211 and/or WEXT are enabled.

best ... khay
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 1561
Location: Berlin, Germany

PostPosted: Mon Apr 15, 2013 3:43 pm    Post subject: Reply with quote

the ralink driver only supports wireless extensions, and not cfg80211
Back to top
View user's profile Send private message
khayyam
Veteran
Veteran


Joined: 07 Jun 2012
Posts: 1549

PostPosted: Mon Apr 15, 2013 3:45 pm    Post subject: Reply with quote

chithanh wrote:
the ralink driver only supports wireless extensions, and not cfg80211

chithanh ... oh, I stand corrected.

best ... khay
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 7403
Location: Somewhere over Atlanta, Georgia

PostPosted: Mon Apr 15, 2013 3:47 pm    Post subject: Reply with quote

Moved from Networking & Security to Unsupported Software. As noted by khayyam, not about Gentoo so it fits better here.

- John
_________________
This space intentionally left blank.
Back to top
View user's profile Send private message
wedz
n00b
n00b


Joined: 15 Apr 2013
Posts: 4

PostPosted: Tue Apr 16, 2013 12:34 am    Post subject: Reply with quote

Hi,

First of all, thank you for all your suggestions guys. And once more, sorry for being so selfish and using this forum for non-gentoo related questions.

khayyam, I will heed your and chithanh's suggestion, and try using the driver in the kernel tonight.
But can you explain me how you noticed that WEXT is at fault in my logs? I would like to be able to understand how all this works, since I will probably need to support many type of configurations, and I expect I will see other issues with different encryption algorithms for example..
Also, what is the difference with CFG80211 and WEXT ? I may be totally off target here, but it was my understanding that WEXT is like an general interface, that drivers can support, so that kernel components (such as wpa_supplicant ?) can control vendor specific drivers.. ?

What is the correct way to configure rt2800usb driver? I mean things like encryption and passwords? I'm confused now with the ralink driver, since it seems to have that RT2860STA.dat file, that has some information about encryption, but I seem to configure all the necessary information already to wo wpa_supplicant.conf - maybe this is my downfall that I'm having 2 config files, and the driver is getting crazy ?
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 1561
Location: Berlin, Germany

PostPosted: Tue Apr 16, 2013 12:54 am    Post subject: Reply with quote

"wext" is the legacy wireless extensions, which are used by some old drivers in the kernel (e.g. ipw2200) and many external drivers.

cfg80211 is the new configuration interface, which is used by all modern drivers in the kernel. In contrast to wext it supports functions like regulatory domain support. wpa_supplicant is called with -Dnl80211 parameter to use this.
Back to top
View user's profile Send private message
wedz
n00b
n00b


Joined: 15 Apr 2013
Posts: 4

PostPosted: Tue Apr 16, 2013 1:34 am    Post subject: Reply with quote

chithanh, thank you for your explanation.

Do you have any advice regarding configuration of wpa_supplicant (or WEP/no encryption for that matter)?

Is there some guide how WLAN configuration should be done properly, so that I could get my head around it ? I need to figure out how to implement my own configuration system for users in the field. And I need to create some simple external interface for end users to setup their network configuration, without console access.
My current plan is to use a simple application on a smartphone, that will send the information to the board, and board will need to configure itself according to the instructions from the user..
Back to top
View user's profile Send private message
khayyam
Veteran
Veteran


Joined: 07 Jun 2012
Posts: 1549

PostPosted: Tue Apr 16, 2013 8:31 am    Post subject: Reply with quote

wedz wrote:
But can you explain me how you noticed that WEXT is at fault in my logs? I would like to be able to understand how all this works, since I will probably need to support many type of configurations, and I expect I will see other issues with different encryption algorithms for example.

wedz ... it wasn't so much that that I noticed WEXT at fault (and to which I should note chithanh corrected my assumption that the rt3070 driver uses cfg80211/nl80211) it was that iwlist (from wireless-tools which uses the old WEXT) worked whereas wpa_supplicant didn't. This suggesed to me that either the kernel driver didn't support cfg80211 or that wpa_supplicant was built without support for WEXT (which was the gist of the second pointer I provided). Having now been corrected its probably the latter which is the issue, as I said wpa_supplicant has many build time options, two of which are CONFIG_DRIVER_WEXT and CONFIG_DRIVER_NL80211. If I were to hazard a guess its probably the case that your build doesn't have CONFIG_DRIVER_WEXT=y but that is just the most obvious assumption as it may be the ralink provided driver or the *.dat.

wedz wrote:
Also, what is the difference with CFG80211 and WEXT? I may be totally off target here, but it was my understanding that WEXT is like an general interface, that drivers can support, so that kernel components (such as wpa_supplicant ?) can control vendor specific drivers.. ?

chithanh pretty much answered this but I'll add to that some links which might help: mac80211 and the various documentation on mac80211, and a brief rundown on wirless extentions

wedz wrote:
What is the correct way to configure rt2800usb driver? I mean things like encryption and passwords? I'm confused now with the ralink driver, since it seems to have that RT2860STA.dat file, that has some information about encryption, but I seem to configure all the necessary information already to wo wpa_supplicant.conf - maybe this is my downfall that I'm having 2 config files, and the driver is getting crazy ?

I'm not sure what options are available for the driver, but this is not really how they are "configured" this aspect (the authentication, encryption, etc) is done in userland via applications like wpa_supplicant, wireless-tools, iw, hostapd.

best ... khay
Back to top
View user's profile Send private message
wedz
n00b
n00b


Joined: 15 Apr 2013
Posts: 4

PostPosted: Wed Apr 17, 2013 1:35 pm    Post subject: Reply with quote

Thanks guys for your help, I will try to study up, and get my wlan working 8)
Back to top
View user's profile Send private message
sikol
n00b
n00b


Joined: 04 Jun 2013
Posts: 1

PostPosted: Tue Jun 04, 2013 8:21 am    Post subject: Re: RT3070 based usb-wifi dongle - wpa_supplicant not connec Reply with quote

wedz wrote:

Code:

network={
        ssid="O_o"
   scan_ssid=1
   key_mgmt=WPA-PSK
   proto=WPA
   psk="testataan"
}


hey wedz, i have work a lot at RT3070, and it worked fine. You can modify the RT2870STA.dat to let it work, or you can fix the bug of you wpa_supplicant.conf here. use wpa_passphrase "your_ssid" "your_psk" and replacement its output "psk=*****" with your psk="testataan".
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum