I am not sure it's gonna help - but when I faced this kind of problem.
I stopped trying it from GUI.

I made sure - my supplicant ran from console (as root), I tried connecting
with a wpa_cli and did all the steps in wifi.c manually (inserting
modules/fw_download or whatever is specific to chip)

Only then issues with UI become easier to crack.
(sorry for the suggestion being more philosophical than technical).

regards,
Pavan

2010/3/3 Gaan <gaan...@gmail.com>

> Hi, savoy
> I did in wpa_supplicant.conf and init.rc
> here goes my wpa_supplicant.conf & init.rc
>
> == external/wpa_supplicant/wpa_supplicant.conf ==
> # global configuration (shared by all network blocks)
> #
> # Parameters for the control interface. If this is specified,
> wpa_supplicant
> # will open a control interface that is available for external
> programs to
> # manage wpa_supplicant. The meaning of this string depends on which
> control
> # interface mechanism is used. For all cases, the existance of this
> parameter
> # in configuration is used to determine whether the control interface
> is
> # enabled.
> #
> # For UNIX domain sockets (default on Linux and BSD): This is a
> directory that
> # will be created for UNIX domain sockets for listening to requests
> from
> # external programs (CLI/GUI, etc.) for status information and
> configuration.
> # The socket file will be named based on the interface name, so
> multiple
> # wpa_supplicant processes can be run at the same time if more than
> one
> # interface is used.
> # /var/run/wpa_supplicant is the recommended directory for sockets and
> by
> # default, wpa_cli will use it when trying to connect with
> wpa_supplicant.
> #
> # Access control for the control interface can be configured by
> setting the
> # directory to allow only members of a group to use sockets. This way,
> it is
> # possible to run wpa_supplicant as root (since it needs to change
> network
> # configuration and open raw sockets) and still allow GUI/CLI
> components to be
> # run as non-root users. However, since the control interface can be
> used to
> # change the network configuration, this access needs to be protected
> in many
> # cases. By default, wpa_supplicant is configured to use gid 0 (root).
> If you
> # want to allow non-root users to use the control interface, add a new
> group
> # and change this value to match with that group. Add users that
> should have
> # control interface access to this group. If this variable is
> commented out or
> # not included in the configuration file, group will not be changed
> from the
> # value it got by default when the directory or socket was created.
> #
> # When configuring both the directory and group, use following format:
> # DIR=/var/run/wpa_supplicant GROUP=wheel
> # DIR=/var/run/wpa_supplicant GROUP=0
> # (group can be either group name or gid)
> #
> # For UDP connections (default on Windows): The value will be ignored.
> This
> # variable is just used to select that the control interface is to be
> created.
> # The value can be set to, e.g., udp (ctrl_interface=udp)
> #
> # For Windows Named Pipe: This value can be used to set the security
> descriptor
> # for controlling access to the control interface. Security descriptor
> can be
> # set using Security Descriptor String Format (see
> http://msdn.microsoft.com/
> # library/default.asp?url=/library/en-us/secauthz/security/
> # security_descriptor_string_format.asp). The descriptor string needs
> to be
> # prefixed with SDDL=. For example, ctrl_interface=SDDL=D: would set
> an empty
> # DACL (which will reject all connections). See README-Windows.txt for
> more
> # information about SDDL string format.
> #
> #ctrl_interface=wlan0
> ctrl_interface=DIR=/data/system/wpa_supplicant/ GROUP=system
>
>
> == system/core/rootdir/init.rc ==
>
>    # give system access to wpa_supplicant.conf for backup and restore
>     mkdir /data/misc/wifi 0770 system system
>    mkdir /data/misc/wifi/sockets 0770 system system
>    mkdir /data/system 0775 system system
>    mkdir /data/system/wpa_supplicant 0770 system system
>     mkdir /data/misc/dhcp 0770 dhcp dhcp
>    chown dhcp dhcp /data/misc/dhcp
>    chmod 0555 /system/bin/busybox
>
> and after booting up, I checked the directory, /data/system/
> wpa_supplicant & /data/misc/wifi/sockets both exist
> but it still can't connect. just don't know why???
>
>
> On 3月3日, 下午6時45分, pavan savoy <pavan.sa...@gmail.com> wrote:
> > aren't these problems similar to,
> http://osdir.com/ml/android-porting/2009-02/msg00139.html
> > ?
> >
> > modifications are required in init.rc and .conf file - If I remember
> > correctly (does seem a long time ago ...).
> >
> > regards,
> > Pavan
> >
> > 2010/3/3 Gaan <gaan...@gmail.com>
> >
> >
> >
> > > 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
> >
> > ...
> >
> > 閱讀更多 >>
>
> --
> unsubscribe: 
> android-porting+unsubscr...@googlegroups.com<android-porting%2bunsubscr...@googlegroups.com>
> website: http://groups.google.com/group/android-porting
>



-- 
--Pavan Savoy

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

Reply via email to