原文 http://onlybernie.blogspot.tw/2015/10/
選擇 openssl-1.0.1h。進入openssl-1.0.1h,打上
source poky sdk env setup script
./Configure linux-generic32 --prefix=/home/bernie/app/openssl
修改 Makefile 中的 CC 為 CC= $(CROSS_COMPILE)gcc ... 後面為 sdk 的參數設定。
make
make install
編譯 openssl 安裝完成
========================================================================
進入 wpa_supplicant-2.2,打上
不用 source poky sdk env setup script,但是要 export PATH=sdk 的 bin
cp defconfig .config
在 .config 內加上
CC=arm-poky-linux-gnueabi-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-
abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/opt/poky/1.8/sysroots/cortexa8hf-vfp-neon-poky-linux-gnueabi
CFLAGS += -I /home/bernie/app/libnl-3.2.24/include/libnl3
CFLAGS += -I /home/bernie/app/openssl/include
LIBS += -L /home/bernie/app/openssl/lib
LIBS += -L /home/bernie/app/libnl-3.2.24/lib
CONFIG_LIBNL32=y-->這個要加,不然會出現 ld找不到 -lnl 的訊息
make
編譯完成後,將 wpa_supplicant 和 wpa_cli 丟至開發板 /usr/sbin
=======================================================================
wpa_supplicant 用法
mkdir /var/run/wpa_supplicant
vi /etc/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
update_config=1
network={
psk="12345678"
ssid="bernie"
}
##update_config=1 /* 讓 wpa_cli 程式可以更新 wpa_supplicant */
## ctrl_interface=/var/run/wpa_supplicant /* 讓 supplicant 可以建立行程 pid */
最後下指令:
wpa_supplicant -d -Dnl80211(也有可能是 wext) -c/etc/wpa_supplicant.conf -iwlan0 -B
root@am335x-evm:/# [ 684.159242] wlan0: authenticate with 18:00:2d:75:f7:80[ 684.170487] wlan0: send auth to 18:00:2d:75:f7:80 (try 1/3)
[ 684.199773] wlan0: authenticated
[ 684.205871] wlan0: associate with 18:00:2d:75:f7:80 (try 1/3)
[ 684.314794] wlan0: RX AssocResp from 18:00:2d:75:f7:80 (capab=0x431 status=0 aid=2)
[ 684.335695] wlan0: associated
[ 684.410374] wlcore: Association completed.
成功會有上述字樣
udhcpc -i wlan0
即可拿到 IP
沒有留言:
張貼留言