This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

wifi reconnect in devkit 2.1 gingerbread

Other Parts Discussed in Thread: WL1271, DM3730

Hi,
I'm using the wl12xx driver and wifi stack in Devkit 2.1 Gingerbread. It works well enough for basic usage.

But there are problems. One major one is handling of reconnecting when the AP goes out of range or other form of loss.

I noticed in the userguide, it says:
http://processors.wiki.ti.com/index.php/TI-Android-GingerBread-2.3.4-DevKit-2.1_UserGuide
Known Issues
    After connection drop WiFi doesn't connect to Acess Point
automatically. User need to disconnect and connect again.

Has this issue been fixed since the release and if so, are there
patches available?

Thanks,
jayakumar

  • There are some patches applied for WLAN on the latest gingerbread tree. You can sync up with the latest sources from our gitorious.org/rowboat repo using the rowboat-gingerbread.xml manifest.

  • Thanks for your reply Vishveshwar. I will take a look. Would you know whether the patches fix the specific issue with wifi reconnects? I'm a bit wary of pulling in lots of changes.

  • You can always browse through the sources online. For your reference, the specific changes to WLAN is at http://gitorious.org/rowboat/hardware-ti-wlan/commits/rowboat-gingerbread

    If I recall correctly, the issue with reconnect is indeed solved with the latest sources/firmware version

  • Thanks Vishveshwar. As suggested, I repo sync-ed the changes in hardware-ti-wlan. After doing this, I found that wpa_supplicant could no longer start.

    # /system/bin/wpa_supplicant -Dwext -iwlan0 -c/data/misc/wifi/wp
    a_supplicant.conf -dd
    [ 1171.579376] wl1271: firmware booted (Rev 6.3.6.0.79_2)
    mkdir[ctrl_interface]: Permission denied
    [ 1172.614990] wl1271: down

    I then noticed that there also changes that have been made to external/wpa_supplicant_6 so I have synced that as well. And now I see:

    make: *** No rule to make target `out/target/product/beagleboard/obj/lib/libnl.so', needed by `out/target/product/beagleboard/obj/EXECUTABLES/wpa_supplicant_intermediates/LINKED/wpa_supplicant'. Stop.

    so I guess I need to keep pulling more and more changes. As you can imagine, makes me worried what else will break.

  • Ok. I got libnl added. Now, when testing on the first bootup I see:

    I/ActivityManager( 1511): Displayed com.android.settings/.WirelessSettings: +242ms
    I/ActivityManager( 1511): Starting: Intent { act=android.intent.action.MAIN cmp=com.android.settings/.wifi.WifiSettings } from pid 2875
    I/ActivityManager( 1511): Displayed com.android.settings/.wifi.WifiSettings: +132ms
    E/WifiHW ( 1511): insmod drv mod path /system/etc/wifi/wl12xx_sdio.ko drv mod arg
    E/WifiHW ( 1511): jaya insmod filename /system/etc/wifi/wl12xx_sdio.ko args
    D/Tethering( 1511): wlan0 is not a tetherable iface, ignoring
    E/WifiHW ( 1511): init_module ret 0
    E/WifiHW ( 1511): jaya wifi after insmod
    E/WifiHW ( 1511): jaya wifi yield
    D/wpa_supplicant( 2910): Initializing interface 'wlan0' conf '/data/misc/wifi/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'
    D/wpa_supplicant( 2910): Configuration file '/data/misc/wifi/wpa_supplicant.conf' -> '/data/misc/wifi/wpa_supplicant.conf'
    D/wpa_supplicant( 2910): Reading configuration file '/data/misc/wifi/wpa_supplicant.conf'
    D/wpa_supplicant( 2910): update_config=1
    D/wpa_supplicant( 2910): ctrl_interface='wlan0:0'
    D/wpa_supplicant( 2910): eapol_version=1
    D/wpa_supplicant( 2910): ap_scan=1
    D/wpa_supplicant( 2910): fast_reauth=1
    D/wpa_supplicant( 2910): Initializing interface (2) 'wlan0'
    D/wpa_supplicant( 2910): Interface wlan0 set UP - waiting a second for the driver to complete initialization
    D/wpa_supplicant( 2910): SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf
    D/wpa_supplicant( 2910): capabilities: key_mgmt 0xf enc 0xf flags 0x0
    D/wpa_supplicant( 2910): WEXT: Operstate: linkmode=1, operstate=5
    D/wpa_supplicant( 2910): Own MAC address: 00:03:47:72:a5:09
    D/wpa_supplicant( 2910): wpa_driver_wext_set_wpa
    D/wpa_supplicant( 2910): wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0
    D/wpa_supplicant( 2910): wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0
    D/wpa_supplicant( 2910): wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0
    D/wpa_supplicant( 2910): wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0
    D/wpa_supplicant( 2910): wpa_driver_wext_set_countermeasures
    D/wpa_supplicant( 2910): wpa_driver_wext_set_drop_unencrypted
    D/wpa_supplicant( 2910): RSN: flushing PMKID list in the driver
    D/wpa_supplicant( 2910): Setting scan request: 0 sec 100000 usec
    D/wpa_supplicant( 2910): WPS: Build Beacon and Probe Response IEs
    D/wpa_supplicant( 2910): WPS: * Version
    D/wpa_supplicant( 2910): WPS: * Wi-Fi Protected Setup State (0)
    D/wpa_supplicant( 2910): WPS: * Version
    D/wpa_supplicant( 2910): WPS: * Wi-Fi Protected Setup State (0)
    D/wpa_supplicant( 2910): WPS: * Response Type (2)
    D/wpa_supplicant( 2910): WPS: * UUID-E
    D/wpa_supplicant( 2910): WPS: * Manufacturer
    D/wpa_supplicant( 2910): WPS: * Model Name
    D/wpa_supplicant( 2910): WPS: * Model Number
    D/wpa_supplicant( 2910): WPS: * Serial Number
    D/wpa_supplicant( 2910): WPS: * Primary Device Type
    D/wpa_supplicant( 2910): WPS: * Device Name
    D/wpa_supplicant( 2910): WPS: * Config Methods (0)
    D/wpa_supplicant( 2910): WPS: * RF Bands (3)
    D/wpa_supplicant( 2910): EAPOL: SUPP_PAE entering state DISCONNECTED
    D/wpa_supplicant( 2910): EAPOL: KEY_RX entering state NO_KEY_RECEIVE
    D/wpa_supplicant( 2910): EAPOL: SUPP_BE entering state INITIALIZE
    D/wpa_supplicant( 2910): EAP: EAP entering state DISABLED
    E/wpa_supplicant( 2910): Failed to initialize control interface 'wlan0:0'.
    E/wpa_supplicant( 2910): You may have another wpa_supplicant process already running or the file was
    E/wpa_supplicant( 2910): left by an unclean termination of wpa_supplicant in which case you will need
    E/wpa_supplicant( 2910): to manually remove this file before starting wpa_supplicant again.
    D/wpa_supplicant( 2910): Failed to add interface wlan0
    D/wpa_supplicant( 2910): No keys have been configured - skip key clearing
    D/wpa_supplicant( 2910): State: DISCONNECTED -> DISCONNECTED
    I/wpa_supplicant( 2910): CTRL-EVENT-STATE-CHANGE id=-1 state=0 BSSID=00:00:00:00:00:00
    D/wpa_supplicant( 2910): wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)
    D/wpa_supplicant( 2910): WEXT: Operstate: linkmode=-1, operstate=5
    D/wpa_supplicant( 2910): EAPOL: External notification - portEnabled=0
    D/wpa_supplicant( 2910): EAPOL: External notification - portValid=0
    D/wpa_supplicant( 2910): wpa_driver_wext_set_wpa
    D/wpa_supplicant( 2910): wpa_driver_wext_set_drop_unencrypted
    D/wpa_supplicant( 2910): wpa_driver_wext_set_countermeasures
    D/wpa_supplicant( 2910): No keys have been configured - skip key clearing
    D/wpa_supplicant( 2910): Cancelling scan request
    D/wpa_supplicant( 2910): Cancelling authentication timeout
    D/wpa_supplicant( 2910): WEXT: Operstate: linkmode=0, operstate=6
    E/WifiHW ( 1511): Supplicant not running, cannot connect

    If I try it from the command line.

    root@localhost:/# ifconfig wlan0 up
    [ 726.228240] wl1271: firmware booted (Rev 6.3.6.0.79_2)
    root@localhost:/# iwlist wlan0 scan
    wlan0 Scan completed :
    Cell 01 - Address: 50:A7:33:7B:E8:E8
    Channel:1
    Frequency:2.412 GHz (Channel 1)
    Quality=30/70 Signal level=-80 dBm
    Encryption key:on
    ESSID:"AtlasAP1"

    So the interface looks fine. But wpa_supplicant still can't start.

    # /system/bin/wpa_supplicant -Dwext -iwlan0 -c/data/misc/wifi/wp
    a_supplicant.conf -dd
    mkdir[ctrl_interface]: Permission denied
    [ 771.655609] wl1271: down

    I straced it:

    # strace -o /tmp/foo -s 9999 -f -F /system/bin/wpa_supplicant -D
    wext -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -dd
    [ 798.516571] init: untracked pid 4734 exited
    [ 799.195129] wl1271: firmware booted (Rev 6.3.6.0.79_2)
    mkdir[ctrl_interface]: Permission denied
    [ 800.247802] wl1271: down

    4735 writev(3, [{"\3", 1}, {"wpa_supplicant\0", 15}, {"EAPOL: SUPP_PAE entering
    4735 writev(3, [{"\3", 1}, {"wpa_supplicant\0", 15}, {"EAPOL: KEY_RX entering s
    4735 writev(3, [{"\3", 1}, {"wpa_supplicant\0", 15}, {"EAPOL: SUPP_BE entering
    4735 writev(3, [{"\3", 1}, {"wpa_supplicant\0", 15}, {"EAP: EAP entering state
    4735 gettimeofday({1341981692, 788879}, NULL) = 0
    4735 mkdir("wlan0:0", 0770) = -1 EACCES (Permission denied)
    4735 write(2, "mkdir[ctrl_interface]", 21) = 21
    4735 write(2, ": ", 2) = 2
    4735 write(2, "Permission denied", 17) = 17
    4735 write(2, "\n", 1) = 1
    4735 writev(3, [{"\6", 1}, {"wpa_supplicant\0", 15}, {"Failed to initialize con
    4735 writev(3, [{"\3", 1}, {"wpa_supplicant\0", 15}, {"Failed to add interface

    I'm confused why it says -EACCESS. My guess is that y'all have changed something in init.rc as well. Will start looking down that road. Would really appreciate any advice/suggestions.

  • Ok. I found the changes you made to init.rc. I'm using omap3evm as the reference. I pulled the changes to BoardConfig.mk to set BOARD_WPA_SUPPLICANT_DRIVER   := NL80211 as well.

    Unfortunately, after rebuild, a new problem now:

    /system/bin/wpa_supplicant -Dnl80211 -iwlan0 -c/data/misc/wifi
    /wpa_supplicant.conf -dd -qq

    E/wpa_supplicant( 3679): Unsupported driver 'nl80211'.

    Not sure what/where nl80211 driver in wpa_supplicant is. Will start looking for that now.

  • Ok. I see. You've added dependency on hostap and also need to update openssl. Wow, the number of changes to get this fix is just growing and growing.

  • After adding hostap and openssl, things are better. But I think there's a problem. You guys have this patch:

    http://gitorious.org/rowboat/system-core/commit/b604c52e44d0460a5e3e6759313cd53da0feaff0%7C

    If I do that, then dhcp on eth0 breaks. I don't see any explanation for those changes by Ido Reis. It just says:

    revert android dhcp service names that include device name

    Doesn't mention consideration for how eth0/wlan0 can co-exist. Seems like a design mistake in rowboat that results in working wifi but broken eth0 dhcp. Please let me know if I am mistaken.

    Advice and suggestions would be welcome.

  • This is an upstream patch.

    Are you able have wlan working without applying this patch?

  • Thanks for your reply Vishveshwar. I'm not sure why you say it is an upstream patch, the author was Ido Reis from TI. To get wlan working, that patch was necessary, but it breaks ethernet. Without it, I just see scanning, authenticating, disconnected. But even with this patch, wifi reconnect only works about 50% of the time. I presume this thread we should keep focused on a proper solution for wifi reconnect that doesn't break ethernet.

  • Hi Jaya Kumar,

    I synced up with the latest sources from gitorious.org/rowboat repo using the rowboat-gingerbread.xml manifest and

    tried to reproduce the reconnection issue of Wi-Fi and the Ethernet dhcp breaking.

    However I was not able to reproduce these issues. The steps followed are

    Wi-Fi reconnect issue:

    Scenario 1:

    1. Turn on Wi-Fi connect to an AP (Cisco AP used).
    2. Turn off the AP and turn it ON again. Wi-Fi automatically connects to the AP.
    3. Step 2 was repeated around 5 times but everytime the connection was successful.

    Scenario 2:

    1. Turn on Wi-Fi and connect to SoftAP in Android phone.
    2. Take the phone out-of-range so that connection is lost and get the phone back into range. Automatic connection is successful.
    3. Step 2 repeated 10 time but no failure seen.

     Ethernet DHCP failure:

    1. Turned on AM37x.
    2. Make eth0 up. “ifconfig eth0 up”
    3. Start the dhcpcd service:
      1. start "dhcpcd_eth0:/system/bin/dhcpcd -AKBL eth0"

               eth0 will obtain the IP address.Verified by ping(log attached).

     Please letme know if the steps followed to reproduce the issues is correct.

    Regards,

    Abhijit

  • Hi Abhijit,

    Thanks for your reply. It was very useful. I'm glad to see Scenario 1 passing in your setup. This is exactly what I am doing where I am seeing 50% failure. This means it must be a problem on my side. By the way, what platform was your test done with? I am using DM3730 with WL1271/LS240. Ah, I see from your log that it is omap3evm. That is good, should be pretty close to my setup.

    I didn't understand the Ethernet DHCP remark. It appears you are starting dhcpd_eth0 manually on the command line. I agree that would work only on the command line. The Ido Reiss patch that is applied would prevent it from working normally from the Android UI which is what I found in my setup.

    Thanks!

  • Hi Jaya Kumar,

    I am using AM37x(omap3evm) with WL1271.

    For the ethernet DHCP i started dhcpcd_eth0 from command line after making the eth0 interface up.

    Did you try adding dhcpcd_eth0 service to init.rc?

    Regards,

    Abhijit

  • How to Spy Android Phone?

    Do you want to learn about your child status whey you buy a new Android phone for you child? Do you want to learn your employees whether take full use of Android mobile phone and work efficiently? Just free download phone spy to Android smart phone to try.

    OX mobile spy is both a mobile phone information backup software and a spy-tracking software, Which all depends on how to use it and how to review of it.

    Download:   http://download.cnet.com/OX-Mobile-Spy/3000-2162_4-75909600.html

  • I have some problems in installation, and the support team is very kind and patient to help me deal with the problems. I have a good enjoyment of this ox mobile spy.