[size=medium][color=red]如果supplicant已经启动,在连接具体AP时一直处于获取IP地址的状态,则很可能是dhcpcd服务没有启动,dhcpcd没有启动可以修改init.rc。将dhcpcd_eth0服务,wpa_supplicant服务放在zygote服务之下执行。[/color]如下:
service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
socket zygote stream 666
onrestart write /sys/android_power/request_state wake
onrestart write /sys/power/state on
onrestart restart media
onrestart restart netd
service wifi_up /system/bin/ifconfig eth0 up
disabled
oneshot
service wifi_down /system/bin/ifconfig eth0 down
disabled
oneshot
# modify and add for wifi dhcp serivce
service dhcpcd_eth0 /system/bin/logwrapper /system/bin/dhcpcd -f /system/etc/dhcpcd/dhcpcd.conf -d -B eth0
user root
group wifi inet
disabled
oneshot
# add service for wifi
service wpa_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant \
-Dwext -ieth0 -c/system/etc/wifi/wpa_supplicant.conf
user root
group wifi inet
socket wpa_eth0 dgram 660 wifi wifi
oneshot
[color=red]如果dhcpcd启动不了,也可以检查WifiStateTracker.java中的mInterfaceName是否正确,如果驱动定义的接口为eth0,则mInterfaceName也应该为eth0。
如果不是eth0,则因该检查init.rc中是否有setprop wifi.interface eth0的配置。[/color]
[/size]
service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
socket zygote stream 666
onrestart write /sys/android_power/request_state wake
onrestart write /sys/power/state on
onrestart restart media
onrestart restart netd
service wifi_up /system/bin/ifconfig eth0 up
disabled
oneshot
service wifi_down /system/bin/ifconfig eth0 down
disabled
oneshot
# modify and add for wifi dhcp serivce
service dhcpcd_eth0 /system/bin/logwrapper /system/bin/dhcpcd -f /system/etc/dhcpcd/dhcpcd.conf -d -B eth0
user root
group wifi inet
disabled
oneshot
# add service for wifi
service wpa_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant \
-Dwext -ieth0 -c/system/etc/wifi/wpa_supplicant.conf
user root
group wifi inet
socket wpa_eth0 dgram 660 wifi wifi
oneshot
[color=red]如果dhcpcd启动不了,也可以检查WifiStateTracker.java中的mInterfaceName是否正确,如果驱动定义的接口为eth0,则mInterfaceName也应该为eth0。
如果不是eth0,则因该检查init.rc中是否有setprop wifi.interface eth0的配置。[/color]
[/size]