For WPA-PSK

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
fast_reauth=1 network={
ssid="my_network"
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP
psk="secret_password"
}

For WPA2PSK

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=1 network={
ssid="my_network"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="secret_password"
}

Starting wpa_supplicant

05-11 22:33