0

Following How to connect to Wi-Fi AP through WPS?, I configured my wpa_supplicant (I'm trying to connect with WPS), the steps are these:

sudo systemctl stop NetworkManager.service
echo -e "ctrl_interface=/var/run/wpa_supplicant\nctrl_interface_group=0\nupdate_config=1" | sudo tee /etc/wpa_supplicant.conf
sudo wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant.conf

But when I run wpa_cli, I get:

Could not connect to wpa_supplicant: (nil) - re-trying

And when I use wpa_cli -i wlan0, I get:

Could not connect to wpa_supplicant: wlan0 - re-trying

I must use wpa_supplicant. I want to save my password there. How I can solve these errors?

At last I got wpa_supplicant working but I get this error and I think when I am using wps wpa_cli never exits:

Successfully initialized wpa_supplicant ioctl[SIOCSIWENCODEEXT]: Invalid argument ioctl[SIOCSIWENCODEEXT]: Invalid argument

never finish and i think crashed

When I try to use this:

sudo wpa_cli wps_pin mymac 68129231

that never finishes either. I dont know why wpa_supplicant can't work with wpa_cli. I can't use dhclient to save my psk can I?

Config of my wpa_supplicant:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1
Zanna
  • 70,465

1 Answers1

-2

I use Ubuntu 16.04 and I know how to fix this.

First, you have to make sure that you didn't change anything in /etc/network/interfaces.

Then you have to go to /etc/wpa_supplicant/action_wpa.sh and change the IFACE variable to

"$(cat /var/run/network/ifstate.wlp2s0)"

instead of

"${CTRL}#/run/wpa_supplicant"

Reboot your system and you will be able to use wpa_cli functions. But nmcli conflicts with wpa_cli, so don't use wpa_cli to reconnect or connect. https://lh6.googleusercontent.com/QGb8Cs3RMHVXs40VbZ1JCJv4PXG5VQbthB5SUB4NpwrfCj9_xwfZQQbP5wVT95fZllbb_sVQuXlTYiI=w1366-h620

Lan...
  • 911
  • Won't the interface name wlp2s0 be different for others? Can you make sure this answer will work for OP and anyone else? – Zanna Aug 10 '17 at 08:31
  • i thought you use ubuntu,if not there is another bug.my android was not be able to connect to wpa_supplicant and it couldn't boot wifi. – Lan... Aug 10 '17 at 08:43
  • Oh yes your answer only needs to work for Ubuntu users, but in the config you put cat /var/run/network/ifstate.wlp2s0 - I am not sure this is portable as others may not have the same interface name. Or will it always be wlp2s0? – Zanna Aug 10 '17 at 08:46
  • control interface is your choice but wpa_cli just work with certain interface which is the same in wpa_supplicant.conf but sometimes it replaced the wlan0 or wlp2s0 to a path and that path can be not exist in differential systems.However wpa_supplicant can read the standard plain-text after update-config or similar variables.change ctrl_interface to wlan0. – Lan... Aug 10 '17 at 09:40