# problem with wpa_cli

## LegionOfHell

After I upgraded my Gentoo, Running wpa_cli alone does not work, I have to include the interface name so that it reads: wpa_cli -i wlo1

Is there anyway to go back to when wpa_cli alone worked ? 

output of wpa_cli status alone(without -iwlo1): http://dpaste.com/10E825X

----------

## UberLord

Try disabling p2p in wpa_supplicant.conf: p2p_disabled=1

----------

## LegionOfHell

yeah that worked thanks

----------

## toralf

 *LegionOfHell wrote:*   

> yeah that worked thanks

 But why?

----------

## LegionOfHell

I have no idea... lol

----------

## LegionOfHell

p2p-dev-wlo1 is supposed to be the direct WIFI interface and wpa_cli defaults to it...disabling direct wifi(adding "p2p_disabled=1") makes wpa_cli default to the real wifi interface..

...but p2p-dev-wlo1 doesn't show up when you run "ip link"...which I find to be odd..Is there a way to list p2p interfaces at all ? 

Also, I have no clue why I am getting this after an upgrade? someone enabled p2p within the wpa_supplicant's source code (CONFIG_P2P=y) ? someone cares to explain what is going on here ? 

many thanks

----------

## Anon-E-moose

Do you have the p2p use flag set?

What does emerge -pv wpa_supplicant return

Edit to add: there is a readme for p2p in the tarball (not sure if it gets installed in the doc directory)

----------

## toralf

FWIW I do have

```
$ emerge -pvO wpa_supplicant 

 * --tree is broken with --nodeps. Disabling...

These are the packages that would be merged, in order:

[ebuild   R    ] net-wireless/wpa_supplicant-2.8-r1::gentoo  USE="dbus fils hs2-0 libressl qt5 readline -ap -bindist -eap-sim -eapol_test -fasteap -macsec -p2p -privsep (-ps3) (-selinux) -smartcard -tdls -uncommon-eap-types (-wimax) -wps" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

```

----------

## LegionOfHell

http://dpaste.com/2X47F8M

```
$ emerge -pv wpa_supplicant

These are the packages that would be merged, in order:

Calculating dependencies  ... ... done!

[ebuild   R    ] net-wireless/wpa_supplicant-2.8-r1::gentoo  USE="fils hs2-0 readline -ap -bindist -dbus -eap-sim -eapol_test -fasteap -libressl -macsec -p2p -privsep (-ps3) -qt5 (-selinux) -smartcard -tdls -uncommon-eap-types (-wimax) -wps" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
```

[Moderator edit: added [code] tags to preserve output layout. -Hu]

----------

## Anon-E-moose

You should only see "CONFIG_P2P=y" if the p2p use flag is set. 

I haven't looked at the code, but it should be inside an "ifdef".

As to your original problem and having to specify "p2p_disabled=1" you should only have to do that if p2p module was installed.

From my understanding if p2p is enabled then it's used for direct connect between devices, laptop <> laptop, or laptop <> android device, etc, all without going through the router. I don't think you can use p2p with the router.

 *Quote:*   

> Wi-Fi Direct, initially called Wi-Fi P2P(Peer to Peer), is a Wi-Fi standard enabling devices to easily connect with each other without requiring a wireless access point. Wi-Fi Direct allows two devices to establish a direct Wi-Fi connection without requiring a wireless router.

 

Edit to add: I just fired up my laptop and wpa_cli works just fine without specifying the interface.  and my device is listed as p2p-<dev name> 

I did an p2p_find and it started scanning for p2p devices (found the firestick downstairs) so evidently p2p works even without the use flag, at least the finding part, not sure if it would connect. 

So, still not sure why you had to disable p2p, I don't have to and I'm running 2.8-r1.

What does your wpa_supplicant.conf look like.

----------

## LegionOfHell

```
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

update_config=1

p2p_disabled=1

# eapol_version=1

# ap_scan=1

# fast_reauth=1

network={

   ssid="xxxx"

   psk="xxxxxx"

   priority=5

}
```

[Moderator edit: added [code] tags to preserve output layout. -Hu]

----------

## Anon-E-moose

Similar to mine (I have multiple wireless routers though).

Not sure why you would need to specify interface for wpa_cli

Ah, I duplicated what you did originally, with these results

If you do "wpa_cli status" it shows the p2p-dev-<dev name> status. (it's the default device)

You then need to use the interface name to see the device status.

If you use p2p_disable in the conf file, then it automatically turns off p2p stuff and the default device is then just the interface.

The status of which device gets listed without specification must have changed from what it used to be.

I don't know that I've ever done just "wpa_cli status" so I never noticed it. 

If you do "wpa_cli interface" it lists the interfaces, and p2p is first, but I notice they're in alphabetical order, so wlan0 is second on my system. 

A nice test would be to name the interface something before "p" in the alphabet and then see which comes first.

Edit to add: from what I can tell looking at source and ebuild, the CONFIG_P2P shouldn't show up in the .config file, unless the p2p use flag is set, but I haven't delved in depth into it.

ETA2: I did an ebuild config and P2P flags show up in the .config file, even though the p2p use flag wasn't set. Looks like a bug in the ebuild/config building script.

There was a bug report for -ap and a couple of other flags, but they didn't mention -p2p so it didn't get fixed.

----------

