玩嵌入式時,有時就是需要手動從 command 去指定 wifi ap,試了一會終於找到就順手記一下吧

在此用的 wifi ap 是走 WPA2 TKIP 加密的,其他加密或不加密的方式可以參考這篇討論串 'SET_NETWORK 0 psk "1234567890"' command timed out

# wpa_cli scan
# wpa_cli scan_result
Selected interface 'wlan0'
bssid / frequency / signal level / rate / protocol caps / flags / ssid
xx:xx:xx:xx:xx:xx 2412 -45 54M 802.11b/g BW20 [WPA2-PSK-TKIP][ESS] MyWifiAP

# wpa_cli -i wlan0 remove_network 0
# wpa_cli -i wlan0 add_network
0
# wpa_cli -i wlan0 set_network 0 ssid '"MyWifiAP"'
# wpa_cli -i wlan0 set_network 0 key_mgmt WPA-PSK
# wpa_cli -i wlan0 set_network 0 psk '"Password"'
# wpa_cli -i wlan0 set_network 0 pairwise TKIP
# wpa_cli -i wlan0 set_network 0 group TKIP
# wpa_cli -i wlan0 set_network 0 proto RSN
# wpa_cli -i wlan0 enable_network 0
# wpa_cli -i wlan0 select_network 0
# wpa_cli -i wlan0 status

如果碰到 IP address 未更新,那就再直接叫 dhcp client (如udhcpc等) 去更新 ip 即可


, , ,

changyy 發表在 痞客邦 PIXNET 留言(0) 人氣()