首页 > 代码库 > TI WL1271 WiFi Linux 設定

TI WL1271 WiFi Linux 設定

1. /etc/wpa_supplicant.config 內容

ctrl_interface=/var/run/wpa_supplicant
network={
        ssid="ssid_namef"
        psk="password"
        key_mgmt=WPA-PSK
}


2. commands

wpa_supplicant -iwlan0 -c /etc/wpa_supplicant.conf&
sleep 1
ifconfig wlan0 down  <=== this line is necessary
sleep 1
ifconfig wlan0 up
sleep 5
udhcpc -i wlan0


Log:

=========================

root@am335x-evm:~#wpa_supplicant -iwlan0 -c /etc/wpa_supplicant.conf&
Successfully initialized wpa_supplicant
[  146.480895] wlcore: PHY firmware version: Rev 8.2.0.0.195
[  146.605834] wlcore: firmware booted (Rev 8.8.0.0.13)

root@am335x-evm:~# ifconfig wlan0 down
[  146.898712] wlcore: down

root@am335x-evm:~# ifconfig wlan0 up
[  148.330871] wlcore: PHY firmware version: Rev 8.2.0.0.195
[  148.455841] wlcore: firmware booted (Rev 8.8.0.0.13)
wlan0: Trying to[  151.675201] wlan0: authenticate with ac:22:0b:8d:99:06
 associate with ac:22:0b:8d:99:06 (SSID=‘ssid_name[  151.684906] wlan0: send auth to ac:22:)
f‘ freq=2442 MHz)
ioctl[SIOCSIWFREQ]: Device or resource busy
wlan0: Association request to the driver failed
[  151.715301] wlan0: authenticated
[  151.722412] wlan0: associate with ac:22:0b:8d:99:06 (try 1/3)
[  151.855316] wlan0: RX AssocResp from ac:22:0b:8d:99:06 (capab=0x411 status=0 aid=6)
[  151.870971] wlcore: Association completed.
[  151.877410] wlan0: associated
wlan0: Associated with ac:22:0b:8d:99:06
wlan0: WPA: Key negotiation completed with ac:22:0b:8d:99:06 [PTK=CCMP GTK=CCMP]
wlan0: CTRL-EVENT-CONNECTED - Connection to ac:22:0b:8d:99:06 completed (auth) [id=0 id_s]

root@am335x-evm:~# udhcpc -i wlan0
udhcpc -i wlan0
udhcpc (v1.20.2) started
Sending discover...
Sending select for 192.168.1.167...
Lease of 192.168.1.167 obtained, lease time 259200
/etc/udhcpc.d/50default: Adding DNS 8.8.8.8
/etc/udhcpc.d/50default: Adding DNS 168.95.1.1
root@am335x-evm:~# ifconfig
eth0      Link encap:Ethernet  HWaddr D0:FF:50:AC:C5:38 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 1C:BA:8C:7F:B6:96 
          inet addr:192.168.1.167  Bcast:0.0.0.0  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:40 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6826 (6.6 KiB)  TX bytes:984 (984.0 B)