wpa_supplicant does not connect with "ioctl[SIOCSIWENCODEEXT]: Invalid argument" error!

First of all, I think you'll have better luck if your router is set to use WPA2-AES and not TKIP.

Second, I believe you are taking the long, complicated route when the short, easy route would work perfectly well. First, I suggest you back up your current wpa_supplicant.conf file:

sudo mv /etc/wpa_supplicant/wpa_supplicant.conf  /etc/wpa_supplicant/wpa_supplicant.bak

Next, I suggest you edit /etc/network/interfaces:

auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet static
address 192.168.1.150
netmask 255.255.255.0
gateway 192.168.1.1
wpa-essid MYESSID12345
wpa-psk MYPASSWORD$1234567

Of course, substitute your details here. Restart the interface:

sudo ifdown wlan0 && sudo ifup -v wlan0

Test:

ping -c3 www.ubuntu.com

If you get ping results, you are connected.


I ran into this today as well. I pulled out a wpa_supplicant.conf file that has worked for me in the past on my Raspberry Pi devices and used it here. Once I tried with this file, my wpa_supplicant was consistently connecting.

I took some time today to try and disable some of the network= sections to try and narrow down which one section was applicable for my wireless network, but I gave up after a while. Taking out and putting back individual sections seemed to be narrowing things down, but then I don't know why it still wasn't connecting, so I gave up and put the whole thing back in there and got myself a DHCP IP address from my router.

Here was the /etc/wpa_supplicant/wpa_supplicant.conf file I used:

network={
    ssid="MYESSID12345"
    scan_ssid=1
    psk="MYPASSWORD$1234567"
    proto=RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP
    auth_alg=OPEN
    priority=999
}

network={
    ssid="MYESSID12345"
    psk="MYPASSWORD$1234567"
    proto=RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP
    auth_alg=OPEN
    priority=99
}

network={
    ssid="MYESSID12345"
    scan_ssid=1
    key_mgmt=NONE
    priority=2
}

network={
    ssid="MYESSID12345"
    psk="MYPASSWORD$1234567"
    proto=RSN
    key_mgmt=WPA-PSK
    pairwise=CCMP
    auth_alg=OPEN
    priority=-1
}

With this, I ran:

$ sudo -i
# cd /etc/wpa_supplicant
# wpa_supplicant -Dwext -i wlp1s0 -c wpa_supplicant.conf
Successfully initialized wpa_supplicant
ioctl[SIOCSIWENCODEEXT]: Invalid argument
ioctl[SIOCSIWENCODEEXT]: Invalid argument
...
wlp1s0: CTRL-EVENT-CONNECTED - Connection to ... completed [id=0 id_str=]

I still got the same errors in stdout, but things still looked better and more info in /var/log/syslog than before.

After this in a separate console:

# dhclient -v -r wlp1s0
# dhclient -v wlp1s0

I got my IP address and so I was able to proceed:

$ ping 8.8.8.8