4

I connect with the following command:

sudo wpa_supplicant -B -D nl80211 -i wlan_card -c /etc/wpa_supplicant/connection.conf 

It connects fine, and keeps persistent connection. If AP goes down, the connection tears, if AP gets back up, the connection comes back. If I power down the wifi interface:

sudo ip link set wlan_card down 

It goes down. When I bring it up with:

sudo ip link set wlan_card up 

The connection, that was launched in the very beginning with wpa_supplicant, reconnects again.

Such stable, persistent connection is very good, but then it causes a problem, if I want to connect to a different AP.

When I try to use wpa_cli with any command, it just gives me the following error:

Failed to connect to non-global ctrl_ifname: (nil) error: No such file or directory 

When I try to disconnect with:

sudo iw dev wlan_card disconnect 

It disconnects, but reconnects right away, so, currently, I have to reserve to:

ps -AlF|grep -i wpa sudo kill -KILL wpa_pid 

I wish to know the correct method to stop the connection, or killing is the only way?

1
  • can you add the output of ps -AlF|grep -i wpa ? Commented Jul 30, 2017 at 10:11

2 Answers 2

5

Before connecting a to a different AP you can stop the running instance of the wpa_supplicant service:

sudo killall wpa_supplicant 

Configure your /etc/wpa_supplicant/connection.conf then connect through wpa_supplicant.

1

According to this you can use wpa_cli to disconnect properly by wpa_cli disconnect I used wpa_supplicant for a long time and I'm pretty sure killing the process will result in failure when you reconnect again.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.