execute wpa_supplicant + wpa_cli with a virtual network interface

Stefano Cappa stefano.cappa at mail.polimi.it
Sun Jan 11 10:03:00 EST 2015


A very small update (i'm working always on Kitkat):
The problem is the same, but now i know that  probably is not connected to the number of the interfaces.
I'm not sure, it's only an experiment, but if i kill and restart wpa_supplicant only on interface p2p0, and if i use wpa_cli (compiled with the android source code from AOSP 4.4.4) in this way:

*
|> interface
|Available interfaces:
|p2p0

|> p2p_group_add
|OK
|<3>P2P-GROUP-STARTED p2p-p2p0-0 GO ssid="DIRECT-uH-Android_263e" freq=2412 passphrase="JBKKjgRh" |go_dev_addr="MY_DEVICE_ADDRESS"

|> p2p_group_add
|FAIL
|<5>P2P: Failed to add group interface

|> interface
|Available interfaces:
|p2p-p2p0-0
|p2p0

|> p2p_group_add
|FAIL
|<5>P2P: Failed to add group interface
*

i have only 2 interfaces, but i can't create another virtual interface with wpa_supplicant.


If i use iw dev i can remove wlan0 with "iw wlan0 del" and i get this
*
|root at mako:/data/misc/wifi/sockets # iw dev                                     
|phy#0
|	Interface p2p-p2p0-0
|		ifindex 28
|		type P2P-GO
|	Interface p2p0
|		ifindex 27
|		type managed
*

With "busybox ifconfig -a" i can check that wlan0 is really not available, but only p2p0, p2p-p2p0-0 and other interfaces like "dummy0", "rmnet_usb3" and so on.

Ok, but if i try with wpa_cli to add two different interfaces with "p2p_group_add" i  get this error "<5>P2P: Failed to add group interface".

In logcat i can see this:
01-11 15:52:12.671: E/wpa_supplicant(6964): Failed to create interface p2p-p2p0-2: -12 (Out of memory)    <-------THIS ERROR
01-11 15:52:12.671: E/wpa_supplicant(6964): P2P: Failed to create new group interface
01-11 15:52:12.671: E/wpa_supplicant(6964): P2P: Failed to add group interface

I don't know if this email can be more useful to understand my problems.

Thank u,
Stefano Cappa


________________________________________
Da: hostap-bounces at lists.shmoo.com <hostap-bounces at lists.shmoo.com> per conto di Stefano Cappa <stefano.cappa at mail.polimi.it>
Inviato: sabato 10 gennaio 2015 17.36
A: hostap at lists.shmoo.com
Oggetto: RE: execute wpa_supplicant + wpa_cli with a virtual network interface

Yes, i tried to use p2p_connect and p2p_group_add during my experiments.

For example if i use p2p_group_add two times (Nexus 5 Android 4.4.4 KitKat) i get this:
*
|> p2p_group_add
|OK
|<3>P2P-GROUP-STARTED p2p-p2p0-0 GO ssid="DIRECT-UT-Android_b483" freq=2412 passphrase="yTxTY4Y2" |go_dev_addr="address"
|> p2p_group_add
|FAIL
|<5>P2P: Failed to add group interface     <----FAILED!
*

What do you think? Is normal that i get this error on Nexus 5, because is an Android Device with some limitations?

I don't know if i have problems with my configuration files or something else. But everything is possibile.
Can i send to you a private email with the ".conf" as attachment?

Thank u very much,
Stefano.

________________________________________
Da: hostap-bounces at lists.shmoo.com <hostap-bounces at lists.shmoo.com> per conto di Jouni Malinen <j at w1.fi>
Inviato: sabato 10 gennaio 2015 00.09
A: hostap at lists.shmoo.com
Oggetto: Re: execute wpa_supplicant + wpa_cli with a virtual network interface

On Fri, Jan 09, 2015 at 02:32:03PM +0000, Stefano Cappa wrote:
> Yes, i'm using this http://wireless.kernel.org/en/developers/p2p/howto and i can connect 2 device together with p2p-p2p0-1 interface, generated by wpa_supplicant. Perfect.
>
> But now i want another interface to execute the same protocol at the same time.
> If i try to lunch "p2p_connect go_address pbc go_intent=15" on the third device and "p2p_connect new_device_address pbc go_intent=1" is not working on the previous device, because the go_address device is a GO on the interface and can't be a client.
> For this reason i want to create another interface.

For P2P use cases, wpa_supplicant will create a new group interface when
needed. You should not (and in fact, cannot) add the virtual interface
manually for such an operation.

> Another approach, like your suggestions (without using directly iw):
> How can i start a p2p connection (on a device already connected to a third device as GO)  as client with another device that is a GO? I mean, if everything is ok, driver ok, kernel ok, os ok, everything...with wpa_cli how can i achieve this without creating an interface with iw, but using wpa_supplicant like in this post (http://wireless.kernel.org/en/developers/p2p/howto) ?

You would simply run another p2p_connect command (or p2p_group_add for
autonomous GO) while the other group is operating. For a quick test,
just run p2p_group_add twice and see whether you get two group
interfaces.

--
Jouni Malinen                                            PGP id EFC895FA
_______________________________________________
HostAP mailing list
HostAP at lists.shmoo.com
http://lists.shmoo.com/mailman/listinfo/hostap
_______________________________________________
HostAP mailing list
HostAP at lists.shmoo.com
http://lists.shmoo.com/mailman/listinfo/hostap


More information about the HostAP mailing list