[beagleboard] Wheezy USB wifi dongle goes thru many authentication cycles before being ready

I know your question was asked two months ago, but I thought I’d check and see if you ever came up with a solution, because I’m still running into the same problem with a different adapter.

I believe my problem is related to the power saving mode in the adapter, I’ve just not found the best way of making sure the power savings are not configured.

root@beaglebone:~# iw dev wlan0 get power_save
Power save: off
root@beaglebone:~# lsusb
Bus 001 Device 002: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 046d:082d Logitech, Inc.
Bus 001 Device 004: ID 13b1:002f Linksys AE1000 v1 802.11n [Ralink RT3572]

After I manually set power_save to off the wifi connection seems to stay up and stable, but the process of making sure it’s set correctly is the problem, especially because connman only likes to have one network up at a time. (I got the FTDI serial cable recently so I can at least see a bit more that’s going on.)

Here’s what I had in my dmesg output.

[ 11.666325] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 18.764839] wlan0: authenticate with 00:02:6f:fb:b0:90
[ 18.791509] wlan0: send auth to 00:02:6f:fb:b0:90 (try 1/3)
[ 18.792695] wlan0: authenticated
[ 18.798924] wlan0: associate with 00:02:6f:fb:b0:90 (try 1/3)
[ 18.800382] wlan0: RX AssocResp from 00:02:6f:fb:b0:90 (capab=0x411 status=0 aid=2)
[ 18.805428] wlan0: associated
[ 18.805558] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 18.805820] cfg80211: Calling CRDA for country: US
[ 18.805983] cfg80211: Regulatory domain changed to country: US
[ 18.805993] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 18.806005] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
[ 18.806015] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
[ 18.806025] cfg80211: (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 18.806035] cfg80211: (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 18.806045] cfg80211: (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 18.806054] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)
[ 18.806064] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm)
[ 20.334390] wlan0: disassociating from 00:02:6f:fb:b0:90 by local choice (reason=3)
[ 20.376015] cfg80211: Calling CRDA to update world regulatory domain
[ 20.376154] cfg80211: World regulatory domain updated:
[ 20.376165] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 20.376176] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 20.376187] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 20.376197] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 20.376207] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 20.376217] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 20.401485] wlan0: deauthenticating from 00:02:6f:fb:b0:90 by local choice (reason=3)

I followed someone’s suggestion from this list and created a file /etc/udev/rules.d/wifi_powersave_off.conf with the contents being a single line:

ACTION==“add”, SUBSYSTEM==“net”, KERNEL==“wlan*” RUN+="/usr/sbin/iw dev %k set power_save off"

but that didn’t seem to fix my problem with the power_save option defaulting to on.

I read an interesting post somewhere related to this in that a ping loop from a different machine on the network would likely be extremely stable in its times if power_save is off, but that it will bounce more if power_save is on. The explanation was that the access point itself will buffer packets longer in an attempt to allow the client to conserve energy.

Sorry, I have not found a solution, but then again have not really played around with it much in the last little while. If you or anyone else finds out anything I’d be interested in hearing about it.

I thought I’d mention that I crashed the OS on my BeagleBone last week, and got another fresh MicroSD card to boot and run some tests with. I downloaded and put the image http://downloads.angstrom-distribution.org/demo/beaglebone/archive/Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.12-beaglebone-2013.08.21.img.xz on the new SD card, and the system booted fine.

I created a /var/lib/connman/wifi.config file with the correct information for my local WiFi network:

[service_WimsWorld-5G]
Type = wifi
Name = WimsWorld-5G
Security = wpa2-psk
Passphrase = MyPasswordInPlainText
IPv4 = dhcp
IPv6.method=off
IPv6 = off

and this new image was able to connect to my network without further effort. I’d been fighting the adapter on and off, trying to figure out if it was the power save settings, or something else, for a long time. I didn’t have to go looking for a special firmware, whatever was needed was already in the image. This is HUGE for me… The only other change I’ve made so far is to modify /etc/default/ntpdate to have the line NTPSERVERS=“0.north-america.pool.ntp.org 1.north-america.pool.ntp.org 2.north-america.pool.ntp.org 3.north-america.pool.ntp.org” so that the time is correctly set on my machine.

root@beaglebone:~# lsusb
Bus 001 Device 002: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0781:a7a8 SanDisk Corp.
Bus 001 Device 004: ID 13b1:002f Linksys AE1000 v1 802.11n [Ralink RT3572]

I don’t know if the IPv4 and IPv6 lines in my WiFi Configuration are doing anything. I had them in the old WiFi config while I was attempting to make things stable. I’ll probably pull them out soon and see what happens, but I’m hoping that an EMC-Flash version of angstrom is available soon for me to overwrite my internal flash automatically.