3

I'm using wpa_supplicant and wpa_cli.
I want to automatically disconnect when the signal sensitivity of the currently connected AP is low or bad.

I hope the action is as follows.

1) I am currently connected to the AP called "ABC".
2) If the signal strength (dbm) of the currently connected AP at an arbitrary moment is less than -70, the connection to the AP is disconnected.

Can I do this with wpa_supplicant and wpa_cli?
My little hope is that if you set it with the wpa_cli command that it would do this automatically.

  • 1
    write a script using iwconfig – Ipor Sircer Jan 4 '17 at 3:52
2

wpa_supplicant is only responsible for the encryption protocols (WPA, WPA2, etc.) and authenticaton handshakes. Signal strength and quality is measured by the kernel.

You can get information about the current signal strength e.g. with iw dev wlan0 link (information about the active link) or iw dev wlan0 station dump (information about all known stations, which is only the connected station for a managed interface).

It's not so difficult to write a shell script (using sleep, grep etc.) to monitor the current strength in regular intervals, and issue a disconnect command per wpa_cli if the signal strength is too low.

AFAIK, there's no specific command to that with wpa_cli, and it's not really necessary, because when the signal strength gets too bad, the kernel driver will disconnect on its own. So I'm not sure what are you gaining by disconnecting a bit earlier.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.