Editing these 2 files should work.
1) /etc/network/interfaces
sudo nano /etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface home inet dhcp
iface other inet dhcp
iface default inet dhcp
2) /etc/wpa_supplicant/wpa_supplicant.conf
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="NETWORK1"
#psk="WIFIKEYS"
psk=197ee6a0f3bbb0ee1530cf248fdf876bc1385eb935a4b1dd548e4c43dd8b817f
id_str="home"
}
network={
ssid="NETWORK2"
#psk="WIFIKEYS"
psk=59d9627450791660c06434770cadaa0f446d07bbe22cd1d35795ddf7c335f7dd
id_str="other"
}
network={
key_mgmt=NONE
}
3) Optional: Parameter ‘psk’ can use ASCII passphrase (commented out above), but you can save wpa_supplicant a little time by pre-computing the PSK keys with wpa_passphrase.
wpa_passphrase "NETWORK1" "WIFIKEYS"