关于wpa_supplicant:
用到wpa_cli命令
wpa_cli -iwlan0
add_network
set_network 1 ssid'"……"'
set_network 1 psk'"……"'
enable_network 1
select_network 1
save_config
dhclient -r wlan0
dhclient wlan0
//注意可能wlan0是down的状态,有时需要
或者/etc/init.d/networking restart
wpa_cli -iwlan0 scan
wpa_cli -iwlan0 scan_result
wpa_cli -iwlan0 status
sudo ifconfig wlan0 up
sudo ifconfig wlan0 192.168.1.126
应该能ping通局域网
wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B
wpa_supplicant.conf 可以在wpa_supplicant源码目录中找到:如下
ca wpa_supplicant
find -name *.conf ,不同的conf对用不同的加密方式
ps -aux |grep "wpa_supplicant"后会看到
/sbin/wpa_supplicant -B -P /run/sendsigs.omit.d/wpasupplicant.pid-u -s -O /var/run/wpa_supplicant
//wpa_wpa2.conf文件
ctrl_interface=/var/run/wpa_supplicant
network={
}
重启网络:/etc/init.d/networking restart
添加路由:route add default gw 192.168.1.1
添加DNS :/etc/resolv.confnameserver 192.168.1.1
sudo killall wpa_supplicant
会提示
Delete '/var/run/wpa_supplicant/wlan0' manually if it is not usedanymore
执行sudo rm /ver/run/wpa_supplicant
就可以成功执行sudo wpa_supplicant -Dwext
不加 -B 会打印如下内容
<3>Trying to associate with bc:d1:77:f6:9f:26(SSID='xiaofengche' freq=2437 MHz)
<3>Associated with 00:00:00:00:00:00
<3>CTRL-EVENT-DISCONNECTED bssid=bc:d1:77:f6:9f:26reason=0
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
<3>Trying to associate with bc:d1:77:f6:9f:26(SSID='xiaofengche' freq=2437 MHz)
<3>Associated with 00:00:00:00:00:00
<3>CTRL-EVENT-DISCONNECTED bssid=bc:d1:77:f6:9f:26reason=0
<3>CTRL-EVENT-SCAN-RESULTS
<3>WPS-AP-AVAILABLE
写错用户名 的反应 (fengche)
ioctl[SIOCSIWSCAN]: Device or resource busy
wlan0: Failed to initiate AP scan
ioctl[SIOCSIWSCAN]: Device or resource busy
wlan0: Failed to initiate AP scan
编译并安装无线驱动
①WLAN Driver build instruction
cd $MYDROID/hardware/ti/wlan/mac80211/compat_wl18xx
②Target file system setup
cd $MYDROID/hardware/ti/wlan/mac80211/compat_wl12xx
cp ./compat/compat.ko $OUT/system/lib/modules/
cp ./net/wireless/cfg80211.ko $OUT/system/lib/modules/
cp ./net/mac80211/mac80211.ko $OUT/system/lib/modules/
cp ./drivers/net/wireless/wl12xx/wl12xx.ko$OUT/system/lib/modules/
cp ./drivers/net/wireless/wl12xx/wl12xx_sdio.ko$OUT/system/lib/modules/
③WLAN firmware
Firmware files go to following location on target filesystem.
/system/etc/firmware/ti-connectivity/
④WLAN Calibration Instruction