problem: iwconfig can only do WEP but not WPA 🙁 shiiiit…. guys this is too compliacted! make it simple! or people won’t be able to use your stuff.
1. become root by su or sudo bash
2. ifconfig wlan0 up
3. iwlist wlan0 scan
scans for available betworks
4. iwconfig wlan0 essid AccessPointName
if it is encrypted wifi
iwconfig wlan0 essid AccessPointName key s:YourWifiPassword
With this in mind it’s crucially important to point out that iwconfig does not support WPA/WPA2 negotiation & authentication when connecting to a wlan network. That is to say the only wifi networks you can connect to with iwconfig are open unencrypted networks and WEP enabled networks.
Now the reason you’re getting this strange error:
Error for wireless request "Set Encode" (8B2A) :
SET failed on device wlan0 ; Invalid argument.
is because iwconfig is expecting a WEP-key for the key: parameter. Because of the way WEP works, this key has to meet one of these conditions:
- ascii string that’s exactly 5 characters in length
- ascii string that’s exactly 13 characters in length
- hexidecimal string that’s exactly 10 characters in length
- hexidecimal string that’s exactly 26 characters in length