Set up a Wifi-Direct connection between Android and Raspberry Pi 3 Linux-ThrowExceptions

Exception or error:

I want to connect two devices using Wifi-Direct. One is a RaspBerry PI 3 (with Raspbian Jessie), the other is an Android smartphone. Raspberry as server and Android as client.

I decided to use wpa_supplicant in Raspbian and the WifiDirect example app for Android:

My wpa_supplicant.conf contains:


I am following this steps:

1) In the raspberry pi:

sudo wpa_supplicant  -B -iwlan0 -Dnl80211 -c/etc/wpa_supplicant.conf
sudo wpa_cli -iwlan0 p2p_group_add
ifconfig p2p-wlan0-0
wpa_cli -ip2p-wlan0-0 wps_pbc

2) Then in the Android app, I can see the raspberry as a peer but I get a connection failure.
I try with the settings app (Wifi => Advanced => Wifi Direct) and I can see the raspberry as a peer too but the diference is that when I try to make the connection, the application request me a PIN code and I am able to make the connection if I introduce the pin returned by p2p_pin any in the raspberry.

Im trying to understand this behavior:

Why is requesting me a PIN? This is the reason why I am not able to make the connection through the WifiDirect example app? Im missing something here?

Thank you.

How to solve:

Where you have:

wpa_cli -ip2p-wlan0-0 wps_pbc


sudo wpa_cli -ip2p-wlan0-0 wps_pin any 12345670

Leave a Reply

Your email address will not be published. Required fields are marked *