You are not logged in.

#1 2018-02-26 16:32:26

gzyy132
Member
Registered: 2018-02-26
Posts: 3

wpa_cli scan gives no result, even though `iw dev interface scan` does

I'm in the process of installing arch linux anew, and what follows is executed in the shell provided when booting the device from an USB installation medium.
I can connect using the manual method to an unprotected network without many problems, however something goes wrong when trying to use `wpa_supplicant` to connect to a protected network.

I'm in particular following the wiki section on using `wpa_cli`. The interface is up as shown by `ip link`, and I can scan the available networks via `iw dev wlp6s0 scan` without problems.

I therefore created the wpa_supplicant configuration file as instructed in the wiki and started wpa_supplicant. This process was seemingly successful and I can verify that `wpa_supplicant` is running in the background with `ps aux | grep wpa`.

I now run `wpa_cli`, which starts with no error. The problem is that if now I run `scan` as instructed in the wiki, nothing happens. The only answer I receive is `OK`, and then nothing. Issuing `scan_results` consistently gives an empty list of results.

I'm quite sure that the first time I tried this, the scan actually worked, and I then proceeded with `add_network` and `set_network` as per the wiki. However other things went wrong so that I ended up rebooting and start anew from the USB, and now the scan doesn't give anything.

What can be causing of this?

Last edited by gzyy132 (2018-02-26 16:59:58)

Offline

#2 2018-02-26 17:16:17

gzyy132
Member
Registered: 2018-02-26
Posts: 3

Re: wpa_cli scan gives no result, even though `iw dev interface scan` does

Ok, I've figured it out. I'll leave the post in case it may help some googler having a similar problem in the future.

I noticed that when I started wpa_cli it said: Selected interface 'p2p-dev-wlp6s0', which didn't look correct, given that my actual interface was wlp6s0.

I googled it and found this github issue, where someone was having a similar problem.

The solution that worked for him, and for me, was to manually specify the correct interface with wpa_cli -i wlp6s0. With this, wpa_cli starts with the correct interface, scanning gives the expected result, and I could continue with the steps outlined in the relevant wiki page.

Problem solved. However, I wonder if it would be helpful to specify this point in the wiki? I realize it already says that one can use the -i switch to specify the interface, but I believe stating directly that the command to use is wpa_cli -i interface, with the -i being optional, would overall save time to many stumbling into this.

Last edited by gzyy132 (2018-02-26 17:18:01)

Offline

#3 2018-05-31 01:41:11

peevsie
Member
Registered: 2018-05-31
Posts: 1

Re: wpa_cli scan gives no result, even though `iw dev interface scan` does

gzyy132 wrote:

The solution that worked for him, and for me, was to manually specify the correct interface with wpa_cli -i wlp6s0

I was having the same issue and this worked for me too. Thanks for sharing!

Offline

#4 2018-05-31 02:08:23

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,452
Website

Re: wpa_cli scan gives no result, even though `iw dev interface scan` does

That shouldn't be needed if the interface was properly specified as a parameter when wpa_supplicant was started.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2018-05-31 02:49:21

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: wpa_cli scan gives no result, even though `iw dev interface scan` does

As per man page, wpa_cli choose first interface found with the control socket in socket path.

 -i ifname
              Specify the interface that is being configured.  By default, choose the first interface found with a control socket in
              the socket path.

So it chooses first socket from /run/wpa_supplicant (as most users use that it in ctrl_interface in wpa_supplicant.conf)

In my case I start wpa_supplicant with -i wlan0, but still I have to specify interface for wpa_cli, otherwise it chooses p2p-dev-wlan0

Offline

#6 2019-11-09 18:55:32

sergei_mipt
Member
Registered: 2019-11-09
Posts: 6

Re: wpa_cli scan gives no result, even though `iw dev interface scan` does

Trilby wrote:

That shouldn't be needed if the interface was properly specified as a parameter when wpa_supplicant was started.

I specified the correct interface when I started wpa_supplicant, however, when I started wpa_cli it used the wrong interface starting with 'p2p-dev'.
The image (URL) confirms this and came from my real recent installation.

Offline

#7 2019-11-09 19:02:01

sergei_mipt
Member
Registered: 2019-11-09
Posts: 6

Re: wpa_cli scan gives no result, even though `iw dev interface scan` does

@gzyy132 you saved my time. Thank you. To properly run wpa_cli it should be started with -i option. I'll try to amend the wiki.

UPDATE: there is a tip in the page with regards to this issue ("It is possible to specify the interface to be configured with the -i option; otherwise, the first found wireless interface managed by wpa_supplicant will be used."), so I am not going to modify the wiki. It is correct already. I was inattentive.

Last edited by sergei_mipt (2019-11-09 19:07:29)

Offline

#8 2019-11-09 19:26:01

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: wpa_cli scan gives no result, even though `iw dev interface scan` does

Please don't necrobump, sergei_mipt.

Closing.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB