Configure Wireless Networks on Raspbian
Add wlan0 to /etc/network/interfaces
auto wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
List available WiFi Networks
iwlist wlan0 scan
Add the network details to wpa-supplicant
FILE : /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="mynetwork"
psk="mypassword"
}
Reconfigure the wireless interface
ifup wlan0
wpa_cli -i wlan0 reconfigure