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

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

I decided to use wpa_supplicant in Raspbian and a sample WifiDirect application for Android:

https://developer.android.com/guide/topics/connectivity/wifip2p.html

My wpa_supplicant.conf contains:

ctrl_interface=/var/run/wpa_supplicant update_config=1 device_name=raspberry device_type=1-0050F204-1 driver_param=use_p2p_group_interface=1 p2p_go_intent=1 p2p_go_ht40=1 

I do the following:

1) In raspberries pi:

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

2) Then in the Android app, I see raspberries as a peer, but my connection fails. I try to use the settings application (Wifi => Advanced => Wifi Direct), and I can see raspberries as a peer, but the difference is that when I try to establish a connection, the application asks me for a PIN code, and I can establish a connection if I insert the pin returned by p2p_pin by anyone in raspberries.

I am trying to understand this behavior:

Why is the PIN requested? For this reason, I can’t establish a connection through the WifiDirect sample application? Did I miss something?

Thanks.

+9
android p2p raspberry-pi raspbian wifi-direct
source share
1 answer

Where do you have:

 wpa_cli -ip2p-wlan0-0 wps_pbc 

using:

 sudo wpa_cli -ip2p-wlan0-0 wps_pin any 12345670 
0
source share

All Articles