(A) Wpa - Supplicant + Wpa - Cli User Guide: '" "' Select - Network
(A) Wpa - Supplicant + Wpa - Cli User Guide: '" "' Select - Network
(A) Wpa - Supplicant + Wpa - Cli User Guide: '" "' Select - Network
WiFi connection by using the wpa_cli. The wpa_supplicant had supported all
kinds of security connections and WPS defined in the 802.11 specification. So,
we suggest use the wpa_supplicant to do the WiFi connection rather than the
iwconfig wireless tool.
3.Connect to AP
a.OPEN
wpa_cli -p/var/run/wpa_supplicant remove_network 0
wpa_cli -p/var/run/wpa_supplicant ap_scan 1
wpa_cli -p/var/run/wpa_supplicant add_network
wpa_cli -p/var/run/wpa_supplicant set_network 0 ssid '"dlink"'
wpa_cli -p/var/run/wpa_supplicant set_network 0 key_mgmt NONE
wpa_cli -p/var/run/wpa_supplicant select_network 0
#WEP key index is X from 0 to 3, change X for other key index and select it.
#wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_keyX
12345678901234567890123456
#wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_tx_keyidx X
4.Ad-hoc mode
a.OPEN
wpa_cli -p/var/run/wpa_supplicant scan
wpa_cli -p/var/run/wpa_supplicant scan_results
wpa_cli -p/var/run/wpa_supplicant remove_network 0
wpa_cli -p/var/run/wpa_supplicant ap_scan 2
wpa_cli -p/var/run/wpa_supplicant add_network
wpa_cli -p/var/run/wpa_supplicant set_network 0 ssid '"Adhoc_test"'
wpa_cli -p/var/run/wpa_supplicant set_network 0 mode 1
wpa_cli -p/var/run/wpa_supplicant set_network 0 key_mgmt NONE
wpa_cli -p/var/run/wpa_supplicant select_network 0
b.WEP40
wpa_cli -p/var/run/wpa_supplicant scan
wpa_cli -p/var/run/wpa_supplicant scan_results
wpa_cli -p/var/run/wpa_supplicant remove_network 0
wpa_cli -p/var/run/wpa_supplicant ap_scan 2
wpa_cli -p/var/run/wpa_supplicant add_network
wpa_cli -p/var/run/wpa_supplicant set_network 0 ssid '"Adhoc_test"'
wpa_cli -p/var/run/wpa_supplicant set_network 0 mode 1
wpa_cli -p/var/run/wpa_supplicant set_network 0 key_mgmt NONE
wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_key0 1234567890
wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_tx_keyidx 0
wpa_cli -p/var/run/wpa_supplicant select_network 0
c.WEP104
wpa_cli -p/var/run/wpa_supplicant scan
wpa_cli -p/var/run/wpa_supplicant scan_results
wpa_cli -p/var/run/wpa_supplicant remove_network 0
wpa_cli -p/var/run/wpa_supplicant ap_scan 2
wpa_cli -p/var/run/wpa_supplicant add_network
wpa_cli -p/var/run/wpa_supplicant set_network 0 ssid '"Adhoc_test"'
wpa_cli -p/var/run/wpa_supplicant set_network 0 mode 1
wpa_cli -p/var/run/wpa_supplicant set_network 0 key_mgmt NONE
wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_key0
12345678901234567890123456
wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_tx_keyidx 0
wpa_cli -p/var/run/wpa_supplicant select_network 0
6.WPS Connection
Push Button:
wpa_cli -p/var/run/wpa_supplicant remove_network 0
wpa_cli -p/var/run/wpa_supplicant wps_pbc any
Pin Code:
wpa_cli -p/var/run/wpa_supplicant remove_network 0
wpa_cli -p/var/run/wpa_supplicant wps_pin any 12345670
or
wpa_cli -p/var/run/wpa_supplicant remove_network 0
wpa_cli -p/var/run/wpa_supplicant wps_pin any
PING
This command can be used to test whether wpa_supplicant is replying to the control interface commands.
The expected reply is PONG if the connection is open and wpa_supplicant is processing commands.
STATUS
Request current status information. The output is a text block with each line in
variable=value format. For example:
bssid=02:00:01:02:03:04
ssid=test network
pairwise_cipher=CCMP
group_cipher=CCMP
key_mgmt=WPA-PSK
wpa_state=COMPLETED
LIST_NETWORKS
List configured networks.
network id / ssid / bssid / flags
0 example network any [CURRENT]
(note: fields are separated with tabs)
SCAN
Request a new BSS scan.
SCAN_RESULTS
Get the latest scan results.
bssid / frequency / signal level / flags / ssid
00:09:5b:95:e0:4e 2412 208 [WPA-PSK-CCMP] jkm private
02:55:24:33:77:a3 2462 187 [WPA-PSK-TKIP] testing
00:09:5b:95:e0:4f 2412 209 jkm guest
(note: fields are separated with tabs)
ADD_NETWORK
Add a new network. This command creates a new network with empty configuration. The new network is
disabled and once it has been configured it can be enabled with ENABLE_NETWORK command. ADD_-
NETWORK returns the network id of the new network or FAIL on failure
SAVE_CONFIG
Save the current configuration.