I found the problem is that the directory /data/system/wpa_supplicant
is not creat after bootup
and I change to use Group system in create all relative directories.
&
out/target/product/generic/system/etc/wifi/wpa_supplicant.conf
still with  ctrl_interface=DIR=/data/system/wpa_supplicant/
GROUP=system

then there is the new log

And I also checked the wpa_supplicant source code.

======================
I/power   (  961): *** set_screen_state 1
E/WifiHW  (  961): ******* wifi_load_driver ********
E/WifiHW  (  961): check_driver_loaded 1
I/WifiHW  (  961): Loading WiFi Modules
D/SettingsWifiEnabler( 1154): Received wifi state changed from
Disabled to Enabling
I/WifiHW  (  961): insmod
E/WifiHW  (  961): ******* ok ********
E/WifiHW  (  961): ******* driver_status OK, ifconfig up ********
I/WifiHW  (  961): **1** inside wifi_start_supplicant
I/WifiHW  (  961): **1** inside ensure_config_file_exists
E/WifiHW  (  961): ***wpa_supplicant -Dwext -ira0 -c /system/etc/wifi/
wpa_supplicant.conf ***
E/WifiHW  (  961): *** wpa_supplicant prop can't find ***
E/WifiHW  (  961): *** wpa_supplicant is running state***
E/WifiHW  (  961): ******* wifi_connect_to_supplicant ********
I/WifiHW  (  961): *** access OK ***
I/WifiHW  (  961): *** Interface directory = /data/system/
wpa_supplicant
I/WifiHW  (  961):  Interface name = /data/system/wpa_supplicant/ra0
***
E/Wap_Supplicant(  961): wpa_ctrl_open (5)dest.sun_path=/data/system/
wpa_supplicant/ra0 sizeof(ctrl->dest.sun_path)=108 ctrl_path=/data/
system/wpa_supplicant/ra0
E/Wap_Supplicant(  961): wpa_ctrl_open (6)ctrl->s=75 &ctrl-
>dest=3d6aea sizeof(ctrl->dest)=110
E/WifiHW  (  961): Unable to open connection to supplicant on "/data/
system/wpa_supplicant/ra0": No such file or directory
D/WifiService(  961): ACTION_BATTERY_CHANGED pluggedType: 1
I/WifiHW  (  961): wifi_command called, cmd:BLACKLIST clear
E/WifiHW  (  961): ******* wifi_send_command ********
D/SettingsWifiEnabler( 1154): Received wifi state changed from
Enabling to Enabled
D/PowerManagerService(  961): setPowerState: mPowerState=6 newState=3
noChangeLights=false
D/PowerManagerService(  961):   oldKeyboardBright=false
newKeyboardBright=false
D/PowerManagerService(  961):   oldScreenBright=true
newScreenBright=true
D/PowerManagerService(  961):   oldButtonBright=true
newButtonBright=false
D/PowerManagerService(  961):   oldScreenOn=false newScreenOn=true
D/PowerManagerService(  961):   oldBatteryLow=false
newBatteryLow=false
I/power   (  961): *** set_screen_state 1
D/dalvikvm( 1023): GC freed 772 objects / 35496 bytes in 619ms
E/wpa_supplicant( 1169): Failed to initialize control interface 'DIR=/
data/system/wpa_supplicant/ GROUP=system'.
E/wpa_supplicant( 1169): You may have another wpa_supplicant process
already running or the file was
E/wpa_supplicant( 1169): left by an unclean termination of
wpa_supplicant in which case you will need
E/wpa_supplicant( 1169): to manually remove this file before starting
wpa_supplicant again.
I/wpa_supplicant( 1169): CTRL-EVENT-STATE-CHANGE id=-1 state=0
I//system/bin/wpa_supplicant( 1168): chown[ctrl_interface]: Operation
not permitted
D/dalvikvm(  961): GC freed 10660 objects / 603936 bytes in 266ms
I/logwrapper( 1168): /system/bin/wpa_supplicant terminated by
exit(255)
E/WifiHW  (  961): ******* wifi_connect_to_supplicant ********
E/WifiHW  (  961): Supplicant not running, cannot connect
I//system/bin/wpa_supplicant( 1172): chown[ctrl_interface]: Operation
not permitted
E/wpa_supplicant( 1173): Failed to initialize control interface 'DIR=/
data/system/wpa_supplicant/ GROUP=system'.
E/wpa_supplicant( 1173): You may have another wpa_supplicant process
already running or the file was
E/wpa_supplicant( 1173): left by an unclean termination of
wpa_supplicant in which case you will need
E/wpa_supplicant( 1173): to manually remove this file before starting
wpa_supplicant again.
I/wpa_supplicant( 1173): CTRL-EVENT-STATE-CHANGE id=-1 state=0
I/logwrapper( 1172): /system/bin/wpa_supplicant terminated by
exit(255)
E/WifiHW  (  961): ******* wifi_connect_to_supplicant ********
I/WifiHW  (  961): *** access OK ***
I/WifiHW  (  961): *** Interface directory = /data/system/
wpa_supplicant
I/WifiHW  (  961):  Interface name = /data/system/wpa_supplicant/ra0
***
E/Wap_Supplicant(  961): wpa_ctrl_open (5)dest.sun_path=/data/system/
wpa_supplicant/ra0 sizeof(ctrl->dest.sun_path)=108 ctrl_path=/data/
system/wpa_supplicant/ra0
E/Wap_Supplicant(  961): wpa_ctrl_open (6)ctrl->s=44 &ctrl-
>dest=3545e2 =110 sizeof(ctrl->dest)=1
E/Wap_Supplicant(  961): wpa_ctrl_open (5)
E/WifiHW  (  961): Unable to open connection to supplicant on "/data/
system/wpa_supplicant/ra0": No such file or directory
I//system/bin/wpa_supplicant( 1177): chown[ctrl_interface]: Operation
not permitted
E/wpa_supplicant( 1178): Failed to initialize control interface 'DIR=/
data/system/wpa_supplicant/ GROUP=system'.
E/wpa_supplicant( 1178): You may have another wpa_supplicant process
already running or the file was
E/wpa_supplicant( 1178): left by an unclean termination of
wpa_supplicant in which case you will need
E/wpa_supplicant( 1178): to manually remove this file before starting
wpa_supplicant again.
I/wpa_supplicant( 1178): CTRL-EVENT-STATE-CHANGE id=-1 state=0
I/logwrapper( 1177): /system/bin/wpa_supplicant terminated by
exit(255)
E/WifiHW  (  961): ******* wifi_connect_to_supplicant ********
I/WifiHW  (  961): *** access OK ***
I/WifiHW  (  961): *** Interface directory = /data/system/
wpa_supplicant
I/WifiHW  (  961):  Interface name = /data/system/wpa_supplicant/ra0
***
E/Wap_Supplicant(  961): wpa_ctrl_open (5)dest.sun_path=/data/system/
wpa_supplicant/ra0 sizeof(ctrl->dest.sun_path)=108 ctrl_path=/data/
system/wpa_supplicant/ra0
E/Wap_Supplicant(  961): wpa_ctrl_open (6)ctrl->s=44 &ctrl-
>dest=3545e2 =110 sizeof(ctrl->dest)=2
E/Wap_Supplicant(  961): wpa_ctrl_open (5)
E/WifiHW  (  961): Unable to open connection to supplicant on "/data/
system/wpa_supplicant/ra0": No such file or directory
V/WifiStateTracker(  961): Supplicant died unexpectedly
E/WifiHW  (  961): ******* wifi_close_supplicant_connection ********
I//system/bin/wpa_supplicant( 1182): chown[ctrl_interface]: Operation
not permitted
E/wpa_supplicant( 1183): Failed to initialize control interface 'DIR=/
data/system/wpa_supplicant/ GROUP=system'.
E/wpa_supplicant( 1183): You may have another wpa_supplicant process
already running or the file was
E/wpa_supplicant( 1183): left by an unclean termination of
wpa_supplicant in which case you will need
E/wpa_supplicant( 1183): to manually remove this file before starting
wpa_supplicant again.
I/wpa_supplicant( 1183): CTRL-EVENT-STATE-CHANGE id=-1 state=0
I/logwrapper( 1182): /system/bin/wpa_supplicant terminated by
exit(255)
D/NetworkStateTracker(  961): setDetailed state, old =IDLE and new
state=DISCONNECTED
D/ConnectivityService(  961): ConnectivityChange for WIFI:
DISCONNECTED/DISCONNECTED
I/WifiHW  (  961): wifi_stop_supplicant called
D/DataConnectionTracker( 1019): enableApnType(default),
isApnTypeActive = false and state = IDLE
D/SettingsWifiEnabler( 1154): Received wifi state changed from Enabled
to Disabling
I/WifiHW  (  961): **1** inside wifi_unload_driver
E/WifiHW  (  961): ******* before rmmod, ifconfig down ********
I/WifiHW  (  961): rmmod
E/WifiHW  (  961): check_driver_loaded 1
W/WifiHW  (  961): check_driver_loaded 2
D/SettingsWifiEnabler( 1154): Received wifi state changed from
Disabling to Disabled

=======================================

And I also checked the wpa_supplicant source code. (wpa_ctrl_open() in
wpa_ctrl.c)

==============part of wpa_ctrl.c=========================
#ifdef ANDROID
        chmod(ctrl->local.sun_path, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
        chown(ctrl->local.sun_path, AID_SYSTEM, AID_WIFI);
        /*
         * If the ctrl_path isn't an absolute pathname, assume that
         * it's the name of a socket in the Android reserved namespace.
         * Otherwise, it's a normal UNIX domain socket appearing in the
         * filesystem.
         */
        if (ctrl_path != NULL && *ctrl_path != '/') {
                os_snprintf(ctrl->dest.sun_path, sizeof(ctrl->dest.sun_path), 
"wpa_
%s",
                            ctrl_path);
                LOGE("wpa_ctrl_open (4)dest.sun_path=%s 
sizeof(ctrl->dest.sun_path)=
%d wpa_%s",ctrl->dest.sun_path,sizeof(ctrl->dest.sun_path),ctrl_path);
                if (socket_local_client_connect(ctrl->s,
                                                ctrl->dest.sun_path,
                                                
ANDROID_SOCKET_NAMESPACE_RESERVED,
                                                SOCK_DGRAM) < 0) {
                        close(ctrl->s);
                        unlink(ctrl->local.sun_path);
                        os_free(ctrl);
                        LOGE("wpa_ctrl_open (4)");
                        return NULL;
                }
                return ctrl;
        }
#endif
        ctrl->dest.sun_family = AF_UNIX;
        os_snprintf(ctrl->dest.sun_path, sizeof(ctrl->dest.sun_path), "%s",
                    ctrl_path);
        LOGE("wpa_ctrl_open (5)dest.sun_path=%s sizeof(ctrl->dest.sun_path)=
%d ctrl_path=%s",ctrl->dest.sun_path,sizeof(ctrl-
>dest.sun_path),ctrl_path);
        LOGE("wpa_ctrl_open (6)ctrl->s=%d &ctrl->dest=%x sizeof(ctrl->dest)=
%d",ctrl->s, &ctrl->dest,sizeof(ctrl->dest));
        if (connect(ctrl->s, (struct sockaddr *) &ctrl-
>dest,                          // <--- the problem is here
                    sizeof(ctrl->dest)) < 0) {
                close(ctrl->s);
                unlink(ctrl->local.sun_path);
                os_free(ctrl);
                LOGE("wpa_ctrl_open (5)");
                return NULL;
        }

        return ctrl;
==============================================
I think it is fail at connect() socket addr

but do not figure out why....????



On 3月3日, 上午3時07分, Brandon <robert...@gmail.com> wrote:
> In yourwpa_supplicant.conf, change your GROUP=system to GROUP=wifi.
> If you create /data/system/wpa_supplicantusing 0777 wifi wifi, your
> group needs to be wifi so the correct permissions can be used. I had
> this issue before until I changed the group, then it was able to make
> the interface.
>
> On Mar 2, 1:22 am, Gaan <gaan...@gmail.com> wrote:
>
>
>
> > I found that it may kernel config relative.
> > I open CONFIG_PACKET option in kernel.
> > it seemswpa_supplicantstart running.
> > but now I have another problem.
> > message with **** **** is dumped by adding debug message code.
>
> > ======= new log ==============
> > I/power   (  961): *** set_screen_state 1
> > E/WifiHW  (  961): ******* wifi_load_driver ********
> > E/WifiHW  (  961): check_driver_loaded 1
> > I/WifiHW  (  961): Loading WiFi Modules
> > D/SettingsWifiEnabler( 1169): Received wifi state changed from
> > Disabled to Enabling
> > I/WifiHW  (  961): insmod
> > rtusb init --->
> > ra0 (usb): not using net_device_ops yet
> > usbcore: registered new interface driver rt2870
> > E/WifiHW  (  961): ******* ok ********
> > E/WifiHW  (  961): ******* driver_status OK, ifconfig up ********
> > 0x1300 = 00064300
> > I/WifiHW  (  961): **1** inside wifi_start_supplicant
> > I/WifiHW  (  961): **1** inside ensure_config_file_exists
> > E/WifiHW  (  961): **** system_property_find ***
> > E/WifiHW  (  961): ***wpa_supplicant-Dwext -ira0 -c /system/etc/wifi/
> >wpa_supplicant.conf ***
> > E/WifiHW  (  961): ***wpa_supplicantis running state***
> > D/WifiService(  961): ACTION_BATTERY_CHANGED pluggedType: 1
> > E/WifiHW  (  961): ******* wifi_connect_to_supplicant ********
> > I/WifiHW  (  961): *** Interface directory = /data/system/
> >wpa_supplicant
> > I/WifiHW  (  961):  Interface name = /data/system/wpa_supplicant/ra0
> > ***
> > E/WifiHW  (  961): Unable to open connection to supplicant on "/data/
> > system/wpa_supplicant/ra0": No such file or directory
> > E/WifiHW  (  961): ******* wifi_send_command ********
> > D/SettingsWifiEnabler( 1169): Received wifi state changed from
> > Enabling to Enabled
> > E/wpa_supplicant( 1389): Failed to initialize control interface 'DIR=/
> > data/system/wpa_supplicant/ GROUP=system'.
> > E/wpa_supplicant( 1389): You may have anotherwpa_supplicantprocess
> > already running or the file was
> > E/wpa_supplicant( 1389): left by an unclean termination of
> >wpa_supplicantin which case you will need
> > E/wpa_supplicant( 1389): to manually remove this file before starting
> >wpa_supplicantagain.
> > I/wpa_supplicant( 1389): CTRL-EVENT-STATE-CHANGE id=-1 state=0
> > I//system/bin/wpa_supplicant( 1387): chown[ctrl_interface]: Operation
> > not permitted
> > Terminate the task(RtmpMlmeTask) with pid(1385)!
> > Terminate the task(RtmpCmdQTask) with pid(1386)!
> > Terminate the task(RtmpTimerTask) with pid(1384)!
> > I/logwrapper( 1387): /system/bin/wpa_supplicantterminated by
> > exit(255)
> > D/PowerManagerService(  961): setPowerState: mPowerState=6 newState=3
> > noChangeLights=false
> > D/PowerManagerService(  961):   oldKeyboardBright=false
> > newKeyboardBright=false
> > D/PowerManagerService(  961):   oldScreenBright=true
> > newScreenBright=true
> > D/PowerManagerService(  961):   oldButtonBright=true
> > newButtonBright=false
> > D/PowerManagerService(  961):   oldScreenOn=false newScreenOn=true
> > D/PowerManagerService(  961):   oldBatteryLow=false
> > newBatteryLow=false
> > I/power   (  961): *** set_screen_state 1
> > E/WifiHW  (  961): ******* wifi_connect_to_supplicant ********
> > I/WifiHW  (  961): *** Interface directory = /data/system/
> >wpa_supplicant
> > I/WifiHW  (  961):  Interface name = /data/system/wpa_supplicant/ra0
> > ***
> > E/WifiHW  (  961): Unable to open connection to supplicant on "/data/
> > system/wpa_supplicant/ra0": No such file or directory
> > 0x1300 = 00064300
> > E/wpa_supplicant( 1391): Failed to initialize control interface 'DIR=/
> > data/system/wpa_supplicant/ GROUP=system'.
> > E/wpa_supplicant( 1391): You may have anotherwpa_supplicantprocess
> > already running or the file was
> > E/wpa_supplicant( 1391): left by an unclean termination of
> >wpa_supplicantin which case you will need
> > E/wpa_supplicant( 1391): to manually remove this file before starting
> >wpa_supplicantagain.
> > I/wpa_supplicant( 1391): CTRL-EVENT-STATE-CHANGE id=-1 state=0
> > I//system/bin/wpa_supplicant( 1390): chown[ctrl_interface]: Operation
> > not permitted
> > Terminate the task(RtmpMlmeTask) with pid(1393)!
> > Terminate the task(RtmpCmdQTask) with pid(1394)!
> > Terminate the task(RtmpTimerTask) with pid(1392)!
> > I/logwrapper( 1390): /system/bin/wpa_supplicantterminated by
> > exit(255)
> > E/WifiHW  (  961): ******* wifi_connect_to_supplicant ********
> > I/WifiHW  (  961): *** Interface directory = /data/system/
> >wpa_supplicant
> > I/WifiHW  (  961):  Interface name = /data/system/wpa_supplicant/ra0
> > ***
> > E/WifiHW  (  961): Unable to open connection to supplicant on "/data/
> > system/wpa_supplicant/ra0": No such file or directory
> > 0x1300 = 00064300
> > I//system/bin/wpa_supplicant( 1395): chown[ctrl_interface]: Operation
> > not permitted
> > E/wpa_supplicant( 1396): Failed to initialize control interface 'DIR=/
> > data/system/wpa_supplicant/ GROUP=system'.
> > E/wpa_supplicant( 1396): You may have anotherwpa_supplicantprocess
> > already running or the file was
> > E/wpa_supplicant( 1396): left by an unclean termination of
> >wpa_supplicantin which case you will need
> > E/wpa_supplicant( 1396): to manually remove this file before starting
> >wpa_supplicantagain.
> > I/wpa_supplicant( 1396): CTRL-EVENT-STATE-CHANGE id=-1 state=0
> > Terminate the task(RtmpMlmeTask) with pid(1398)!
> > Terminate the task(RtmpCmdQTask) with pid(1399)!
> > Terminate the task(RtmpTimerTask) with pid(1397)!
> > I/logwrapper( 1395): /system/bin/wpa_supplicantterminated by
> > exit(255)
> > E/WifiHW  (  961): ******* wifi_connect_to_supplicant ********
> > I/WifiHW  (  961): *** Interface directory = /data/system/
> >wpa_supplicant
> > I/WifiHW  (  961):  Interface name = /data/system/wpa_supplicant/ra0
> > ***
> > E/WifiHW  (  961): Unable to open connection to supplicant on "/data/
> > system/wpa_supplicant/ra0": No such file or directory
> > V/WifiStateTracker(  961): Supplicant died unexpectedly
> > E/WifiHW  (  961): ******* wifi_close_supplicant_connection ********
> > 0x1300 = 00064300
> > init: no such service 'dhcpcd'
> > E/wpa_supplicant( 1401): Failed to initialize control interface 'DIR=/
> > data/system/wpa_supplicant/ GROUP=system'.
> > E/wpa_supplicant( 1401): You may have anotherwpa_supplicantprocess
> > already running or the file was
> > E/wpa_supplicant( 1401): left by an unclean termination of
> >wpa_supplicantin which case you will need
> > E/wpa_supplicant( 1401): to manually remove this file before starting
> >wpa_supplicantagain.
> > I/wpa_supplicant( 1401): CTRL-EVENT-STATE-CHANGE id=-1 state=0
> > I//system/bin/wpa_supplicant( 1400): chown[ctrl_interface]: Operation
> > not permitted
> > Terminate the task(RtmpMlmeTask) with pid(1403)!
> > Terminate the task(RtmpCmdQTask) with pid(1404)!
> > Terminate the task(RtmpTimerTask) with pid(1402)!
> > I/logwrapper( 1400): /system/bin/wpa_supplicantterminated by
> > exit(255)
> > 0x1300 = 00064300
> > E/WifiStateTracker(  961): Could not stop DHCP
> > D/NetworkStateTracker(  961): setDetailed state, old =DISCONNECTED and
> > new state=DISCONNECTED
> > init: untracked pid 1410 exited
> > D/SettingsWifiEnabler( 1169): Received wifi state changed from Enabled
> > to Disabling
> > init: no such service 'dhcpcd'
> > E/WifiStateTracker(  961): Could not stop DHCP
> > I/WifiHW  (  961): **1** inside wifi_unload_driver
> > E/WifiHW  (  961): ******* before rmmod, ifconfig down ********
> > Terminate the task(RtmpMlmeTask) with pid(1412)!
> > Terminate the task(RtmpCmdQTask) with pid(1413)!
> > Terminate the task(RtmpTimerTask) with pid(1411)!
> > usbcore: deregistering interface driver rt2870
> > RtmpOSNetDevDetach(): RtmpOSNetDeviceDetach(), dev->name=ra0!
> > I/WifiHW  (  961): rmmod
> > <--- rtusb exit
> > E/WifiHW  (  961): check_driver_loaded 1
> > W/WifiHW  (  961): check_driver_loaded 2
> > D/SettingsWifiEnabler( 1169): Received wifi state changed from
> > Disabling to Disabled
> > =============================
>
> > I think the problem is
> > E/WifiHW  (  961): Unable to open connection to supplicant on "/data/
> > system/wpa_supplicant/ra0": No such file or directory
>
> > anyone can help??
>
> > On 2月26日, 上午7時37分, Brandon <robert...@gmail.com> wrote:
>
> > > Did you check your system/bin to see ifwpa_supplicantwas present?
>
> > > Here is what's in my BoardConfig.mk in order to build wpa supplicant.
>
> > > #Wifirelated defines
> > > BOARD_WPA_SUPPLICANT_DRIVER      := WEXT
> > > BOARD_WPA_SUPPLICANT_PRIVATE_LIB :=
>
> > > On Feb 23, 3:56 am, Gaan <gaan...@gmail.com> wrote:
>
> > > > Hi everyone,
> > > >     I'm portingwifidriver (Ralink chip) on Android 2.0.1 board.
> > > > first of all I made some modifies
>
> > > > (1)   modify build/target/board/generic/BoardConfig.mk
>
> > > > add HAVE_CUSTOM_WIFI_DRIVER_2 := true
>
> > > > (2)   Android usingwpa_supplicantto managementwifi. Make sure
> > > > external/wpa_supplicant/.config is looking like this
>
> > > > # CONFIG_NO_WPA=y
>
> > > > CONFIG_OS=unix
>
> > > > CONFIG_IEEE8021X_EAPOL=y
>
> > > > CONFIG_EAP_MD5=y
>
> > > > CONFIG_EAP_MSCHAPV2=y
>
> > > > CONFIG_EAP_TLS=y
>
> > > > CONFIG_EAP_PEAP=y
>
> > > > CONFIG_EAP_TTLS=y
>
> > > > CONFIG_EAP_GTC=y
>
> > > > CONFIG_EAP_OTP=y
>
> > > > CONFIG_EAP_SIM=y
>
> > > > CONFIG_EAP_AKA=y
>
> > > > CONFIG_EAP_PSK=y
>
> > > > CONFIG_EAP_SAKE=y
>
> > > > CONFIG_EAP_GPSK=y
>
> > > > CONFIG_EAP_PAX=y
>
> > > > CONFIG_EAP_LEAP=y
>
> > > > # CONFIG_EAP_FAST=y
>
> > > > CONFIG_PKCS12=y
>
> > > > # CONFIG_PCSC=y
>
> > > > CONFIG_SMARTCARD=y
>
> > > > CONFIG_WIRELESS_EXTENSION=y
>
> > > > CONFIG_CTRL_IFACE=y
>
> > > > # CONFIG_DRIVER_HOSTAP=y
>
> > > > # CONFIG_DRIVER_HERMES=y
>
> > > > # CONFIG_DRIVER_MADWIFI=y
>
> > > > # CONFIG_DRIVER_ATMEL=y
>
> > > > CONFIG_DRIVER_WEXT=y
>
> > > > # CONFIG_DRIVER_NDISWRAPPER=y
>
> > > > # CONFIG_DRIVER_BROADCOM=y
>
> > > > # CONFIG_DRIVER_IPW=y
>
> > > > #
>
> ...
>
> 閱讀更多 >>

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to