1. sudo iwlist scan //you will AP available, event the hidden ones
2. sudo iwconfig
sudo iwconfig wlan0 essid "atenas"
3. sudo iwconfig wlan0 key s:
4. get a IP from the dhcp:
sudo dhclient wlan0
those steps worked for me, I read in several sites whether the AP has WPA2 passphare you should use the wpa_supplicant method, it may be true, but in my case it was not necessary, just check it in case some of the above steps do not work
Best