Not to necro a thread, but if you're using WPA2 you need to supply a country code at the top of the wpa_supplicant such as
# Only WPA-PSK is used. Any valid cipher combination is accepted.
country=US
ctrl_interface=/var/run/wpa_supplicant
update_config=1
network={
ssid="Foo"
psk="Bar"
}
wowlan_triggers=magic_pkt
I was having trouble connecting to our local internet until I did this.