Hi Ashwin
I  tried the wpa_supplicant code of donut  ,and then problem went
away.

Now my board can scan the ap and return the results, but it still can
not connect to ap.
Maybe it is because of the dhcp

and in init.rc,My  dhcp service is started by the follow line:

 service dhcpcd /system/bin/dhcpcd -f /system/etc/dhcpcd/dhcpcd.conf -
d eth1
 group system dhcp wifi
 disabled
 oneshot

but it seems that it can not work, the logs are:
D/WifiStateTracker(  713): Deconfiguring interface and stopping DHCP
D/WifiStateTracker(  713): DhcpHandler: DHCP request started
I/WifiStateTracker(  713): DhcpHandler: DHCP request failed: Timed out
waiting for DHCP to finish
V/WifiStateTracker(  713): Changing supplicant state: COMPLETED ==>
DORMANT
 D/WifiStateTracker(  713): Deconfiguring interface and stopping DHCP

and I started the dhcp manually, it says:flock
# dhcpcd -f /system/etc/dhcpcd/dhcpcd.conf -d eth1
eth1: flock `/data/misc/dhcp/dhcpcd-eth1.pid': Try again

Could you give me some clue?
Thanks!
--Weber
On Jul 21, 10:40 am, Ashwin Bihari <abih...@gmail.com> wrote:
> Weber,
>
> This is exactly what I faced when I recently tried to get theWiFiup
> and running on my Eclair based device..I had everything up and running
> on Donut and I copied the configuration and all and kept getting these
> 'permission denied' and 'operation not permitted' with the chown/mkdir
> related to ctrl_interface and so on..
>
> After monkeying with the wpa_supplicant.conf file and the init.rc file
> with the various user/group permissions..just on a whim I decided to
> do a diff between the older wpa_supplicant code and the new one and
> there were a few differences..I just brought back all of the older
> wpa_supplicant code and BOOMWiFiwas up and running in Eclair..
>
> I think wpa_supplicant is somehow broken in Eclair and needs to be
> patched to work..I'll have to go through my diff step by step and
> figure out what exactly breaks things..and I might do that over the
> next few weeks..
>
> Regards
> -- Ashwin
>
> On Tue, Jul 20, 2010 at 10:05 PM, Weber <qvbs...@gmail.com> wrote:
> > Hi
> > Just now I started the wpa_supplicant mannually, but is seem that it
> > can not be started,like this:
> > # wpa_supplicant -dd -Dwext -ieth1 -c /system/etc/wifi/
> > wpa_supplicant.conf&
> > # ioctl[SIOCSIWPMKSA]: Invalid argument
> > mkdir[ctrl_interface]: Permission denied
>
> > [1] + Done(255)                  wpa_supplicant -dd -Dwext -ieth1 -c /
> > system/etc/wifi/wpa_supplicant.conf
> > Then I grep and found that "mkdir[ctrl_interface]" is in
> > ctrl_iface_unix.c ,and what confused me is that it is not inside the"
> > ifdefANDROIDendif" but now I am using theandroidprivate socket.
>
> > by the way,Someone had mentioned in the groups that
> > wpa_supplicant/Android.mk
>
> > (3.1)
>
> > LOCAL_PATH := $(call my-dir)
>
> > WPA_BUILD_SUPPLICANT := true
>
> > ifneq ($(TARGET_SIMULATOR),true)
>
> >  ifneq ($(BOARD_WPA_SUPPLICANT_DRIVER),)
>
> >    WPA_BUILD_SUPPLICANT := true
>
> >    CONFIG_DRIVER_$(BOARD_WPA_SUPPLICANT_DRIVER) = y
>
> >  endif
>
> > (3.2) remove mark symbol, and look like this
>
> > ########################
>
> > local_target_dir := $(TARGET_OUT)/etc/wifi
>
> > include $(CLEAR_VARS)
>
> > LOCAL_MODULE := wpa_supplicant.conf
>
> > LOCAL_MODULE_TAGS := user
>
> > LOCAL_MODULE_CLASS := ETC
>
> > LOCAL_MODULE_PATH := $(local_target_dir)
>
> > LOCAL_SRC_FILES := $(LOCAL_MODULE)
>
> > include $(BUILD_PREBUILT)
>
> > But in My wpa_supplicant/Android.mk WPA_BUILD_SUPPLICANT :=
> > false ,Does this matter?
>
> > Thank you!
> > --Weber
> > On Jul 21, 9:22 am, Weber <qvbs...@gmail.com> wrote:
> >> Hi,I read yourwifiportingguide ,and followed it
> >> but the error still appears--By the way the version I use is eclair
> >> 2.1-update1
>
> >> E/WifiHW  (  708): Unable to open connection to supplicant on "/data/
> >> system/wpa_supplicant/sta": No such file or directory
>
> >> Here is myportingflow:
> >> 1.
> >> build/target/board/generic/BoardConfig.mk
> >> BOARD_WPA_SUPPLICANT_DRIVER := WEXT
> >> I also try to add ------HAVE_CUSTOM_WIFI_DRIVER_2 := true,but it still
> >> cannot work
> >> 2.
> >> 2.1 modify external/wpa_supplicant/common.c and set wpa_debug_level =
> >> MSG_DEBUG
> >> 2.2 modify common.h and change #define wpa_printf from if ((level) >=
> >> MSG_INFO) to if ((level) >= MSG_DEBUG)
> >> 3.
> >> system/etc/wifi/wpa_supplicant.conf and data/misc/wifi/
> >> wpa_supplicant.conf
> >> ctrl_interface=DIR=/data/system/wpa_supplicant GROUP=wifi
> >> update_config=1
> >> ap_scan=1
> >> 4.
> >> init.rc
> >>     mkdir /system/etc/wifi0777wifiwifi
> >>     chmod 0777 /system/etc/wifi
> >>     chmod 0777 /system/etc/wifi/wpa_supplicant.conf
> >>     chownwifiwifi/system/etc/wifi/wpa_supplicant.conf
>
> >>  ##wpa_supplicant control socket forandroidwifi.c (androidprivate
> >> socket)
> >> mkdir /data/misc/wifi0777wifiwifi
> >> mkdir /data/misc/wifi/sockets 0777wifiwifi
> >> chmod 0777 /data/misc/wifi
> >> chmod 0777 /data/misc/wifi/wpa_supplicant.conf
> >> chownwifiwifi/data/misc/wifi
> >> chownwifiwifi/data/misc/wifi/wpa_supplicant.conf
>
> >>     ## wpa_supplicant socket (unix socket mode)
> >>     mkdir /data/system/wpa_supplicant 0777wifiwifi
> >>     chmod 0777 /data/system/wpa_supplicant
> >>     chownwifiwifi/data/system/wpa_supplicant
> >>     chownwifiwifi/data/system
> >>     chownwifiwifi/data
>
> >>     ## wpa_supplicant socket (unix socket mode--another goup version)
> >> ----when it failed ,I try this one ,still failed
> >> #    mkdir /data/system/wpa_supplicant 0777 system system
> >> #    chmod 0777 /data/system/wpa_supplicant
> >> #    chown system system /data/system/wpa_supplicant
> >> #    chown system system /data/system
> >> #    chown system  system /data
> >> 5.init.rc
> >> service wpa_supplicant /system/bin/wpa_supplicant -dd -Dwext -ieth1 -
> >> c /system/etc/wifi/wpa_supplicant.conf
> >> group systemwifiinet
> >> disabled
> >> oneshot
>
> >> service dhcpcd /system/bin/dhcpcd -f /system/etc/dhcpcd/dhcpcd.conf -d
> >> eth1
> >> group system dhcpwifi
> >> disabled
> >> oneshot
>
> >> /system/etc/dhcpcd/dhcpcd.conf
> >> interface eth1
> >> option subnet_mask, routers, domain_name_servers
> >> 6.
> >> modifiedwifi.c to loader my libertas.ko and libertas_sdio.ko
> >> and add the bellow in init.rc
> >>     setpropwifi.interface "eth1"
> >>     setprop wlan.driver.status "ok"
> >>     setprop wlan.interface "eth1"
>
> >> but the erro is the same
> >> E/WifiHW (  708):Unable to open connection to supplicant on "/data/
> >> system/wpa_supplicant/eth1": No such file or directory
>
> >> I add some log in external/wpa_supplicant/wpa_ctrl.c
> >> and found that the error is generated in wpa_ctrl.c by the following
> >> line:
> >>  connect(ctrl->s, (struct sockaddr *) &ctrl->dest,sizeof(ctrl->dest))
> >> < 0)
>
> >> here are the logs
> >> I/PackageManager(  708): 
> >> Features:android.hardware.wifiandroid.hardware.location.networkandroid.hardware.bluetoothandroid.hardware.locationandroid.hardware.location.gpsandroid.hardware.touchscreenandroid.hardware.sensor.accelerometerandroid.hardware.sensor.compass
> >> V/ConnectivityService(  708): StartingWifiService.
> >> I/WifiService(  708): WifiService starting up with Wi-Fi enabled
> >> W/WifiQiu (  708): we...@ctrl is NULL after connect(...)for
> >> CTRL_IFACE_UNIX-ifNdefANDROID!
> >> E/WifiHW  (  708): Unable to open connection to supplicant on "/data/
> >> system/wpa_supplicant/eth1": No such file or directory
> >> D/wpa_supplicant(  773): Initializing interface 'eth1' conf '/system/
> >> etc/wifi/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A'
> >> bridge 'N/A'
> >> D/wpa_supplicant(  773): Configuration file '/system/etc/wifi/
> >> wpa_supplicant.conf' -> '/system/etc/wifi/wpa_supplicant.conf'
> >> D/wpa_supplicant(  773): Reading configuration file '/system/etc/wifi/
> >> wpa_supplicant.conf'
> >> D/wpa_supplicant(  773): ctrl_interface='DIR=/data/system/
> >> wpa_supplicant GROUP=wifi'
> >> D/wpa_supplicant(  773): update_config=1
> >> D/wpa_supplicant(  773): ap_scan=1
> >> D/wpa_supplicant(  773): Initializing interface (2) 'eth1'
> >> D/wpa_supplicant(  773): EAPOL: SUPP_PAE entering state DISCONNECTED
> >> D/wpa_supplicant(  773): EAPOL: KEY_RX entering state NO_KEY_RECEIVE
> >> D/wpa_supplicant(  773): EAPOL: SUPP_BE entering state INITIALIZE
> >> D/wpa_supplicant(  773): EAP: EAP entering state DISABLED
> >> D/wpa_supplicant(  773): EAPOL: External notification - portEnabled=0
> >> D/wpa_supplicant(  773): EAPOL: External notification - portValid=0
> >> D/wpa_supplicant(  773): SIOCGIWRANGE: WE(compiled)=22 WE(source)=15
> >> enc_capa=0xf
> >> D/wpa_supplicant(  773):   capabilities: key_mgmt 0xf enc 0xf
> >> D/wpa_supplicant(  773): WEXT: Operstate: linkmode=1, operstate=5
> >> D/wpa_supplicant(  773): Own MAC address: 00:1a:6b:a2:38:65
> >> D/wpa_supplicant(  773): wpa_driver_wext_set_wpa
> >> D/wpa_supplicant(  773): wpa_driver_wext_set_key: alg=0 key_idx=0
> >> set_tx=0 seq_len=0 key_len=0
> >> D/wpa_supplicant(  773): wpa_driver_wext_set_key: alg=0 key_idx=1
> >> set_tx=0 seq_len=0 key_len=0
> >> D/wpa_supplicant(  773): wpa_driver_wext_set_key: alg=0 key_idx=2
> >> set_tx=0 seq_len=0 key_len=0
> >> D/wpa_supplicant(  773): wpa_driver_wext_set_key: alg=0 key_idx=3
> >> set_tx=0 seq_len=0 key_len=0
> >> D/wpa_supplicant(  773): wpa_driver_wext_set_countermeasures
> >> D/wpa_supplicant(  773): wpa_driver_wext_set_drop_unencrypted
> >> D/wpa_supplicant(  773): Setting scan request: 0 sec 100000 usec
> >> D/wpa_supplicant(  773): Using existing control interface directory.
> >> D/wpa_supplicant(  773): ctrl_interface_group=1010 (from group name
> >> 'wifi')
> >> D/wpa_supplicant(  773): Added interface eth1
> >> D/wpa_supplicant(  773): RTM_NEWLINK: operstate=0 ifi_flags=0x1043
> >> ([UP][RUNNING])
> >> D/wpa_supplicant(  773): RTM_NEWLINK, IFLA_IFNAME: Interface 'eth1'
> >> added
> >> D/wpa_supplicant(  773): RTM_NEWLINK: operstate=0 ifi_flags=0x1003
> >> ([UP])
> >> D/wpa_supplicant(  773): RTM_NEWLINK, IFLA_IFNAME: Interface 'eth1'
> >> added
> >> D/wpa_supplicant(  773): RTM_NEWLINK: operstate=0 ifi_flags=0x1003
> >> ([UP])
> >> D/wpa_supplicant(  773): Wireless event: cmd=0x8b06 len=8
> >> D/wpa_supplicant(  773): State: DISCONNECTED -> SCANNING
> >> I/wpa_supplicant(  773): CTRL-EVENT-STATE-CHANGE id=-1 state=2
> >> D/wpa_supplicant(  773): Starting AP scan (broadcast SSID)
> >> D/wpa_supplicant(  773): Trying to get current scan results first
> >> without requesting a new scan to speed up initial association
> >> D/wpa_supplicant(  773): Received 0 bytes of scan results (0 BSSes)
> >> D/wpa_supplicant(  773): Scan results: 0
> >> I/wpa_supplicant(  773): CTRL-EVENT-SCAN-RESULTS  Ready
> >> D/wpa_supplicant(  773): No suitable AP found.
> >> D/wpa_supplicant(  773): Setting scan request: 0 sec 0 usec
> >> D/wpa_supplicant(  773): Starting AP scan (broadcast SSID)
> >> D/wpa_supplicant(  773): Scan requested (ret=0) - scan timeout 5
> >> seconds
> >> D/wpa_supplicant(  773): RTM_NEWLINK: operstate=0 ifi_flags=0x1003
> >> ([UP])
> >> D/wpa_supplicant(  773): Wireless event: cmd=0x8b19 len=8
> >> D/wpa_supplicant(  773): Received 0 bytes of scan results (0 BSSes)
> >> D/wpa_supplicant(  773): Scan results: 0
> >> I/wpa_supplicant(  773): CTRL-EVENT-SCAN-RESULTS  Ready
> >> D/wpa_supplicant(  773): No
>
> ...
>
> read more »

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

Reply via email to