Install Required Software’s
iw and wpa_supplicant userspace command line tools are required in-order to perform wi-fi Direct / p2p operations on Ubuntu Linux.
iw:
sudo apt-get update && sudo apt-get install iw
wpa_supplicant version 1.x:
sudo apt-get install wpa-supplicant or
#for Latest Ubuntu
sudo apt-get install wpasupplicant
Wireless Adapter Supports Wi-Fi Direct
To verify the p2p Group/Client support for your Wireless Adapter use iw command as a sudo/root
$ sudo iw list
Grep and check for following block to see the supported modes for your wi-fi adapter.
Supported interface modes:
- * IBSS
- * managed
- * monitor
- * AP
- * P2P-GO
- * P2P-Client
If you see P2P-GO(Group Owner) and P2P-Client, then your wireless NIC supports Wi-Fi Direct.
P2P Commands
The following commands are used with wpa_cli.
- p2p_find
- p2p_stop_find
- p2p_connect
- p2p_invite
- p2p_group_add
- p2p_remove_group
- terminate
- status
For full list of commands please check this post: wpa_supplicant and wpa_cli
wpa_cli commands will used with wpa_supplicant daemon for wi-fi Direct connection establishments.
Wi-Fi Direct Connection Methods
In-order to establish the connection there are different types of connection methods, they are
- PBC – Push Button Control method
- PIN – Secret PIN number method
- Invite – Invitation Method
Hi,
Does this have a follow up post?
I will come back to you guys sooner with update on this post.
Hi. have you progressed towards it?
Thanks for posting 🙂
I had progressed, but i do not have time to post the progress. Will update you soon.
Just a point: In ubuntu 13.10 the package wpa-supplicant is called wpasupplicant, without ‘-‘.
don’t you have 3rd posting? there’s just 404error.
Thanks for your finding. Please check it now: https://thangamaniarun.wordpress.com/2014/03/30/how-to-setup-wi-fi-direct-on-androidubuntu-terminal-part3/
Hi Guys,
I need your help to resolve “p2p_find” FAIL message. Below is the complete description of my setup.
I want to establish wi-fi direct connection between two Dell Laptops running on Ubuntu 14.04.3 LTS. Wi-fi chip is Broadcomm BCM4313. p2p_find command fails. This is the code flow: wpa_cli_cmd_p2p_find() -> wpa_cli_cmd() -> wpa_ctrl_command() ->_wpa_ctrl_command() -> recv(). recv() call receives “FAIL” as reply. Running wpa_supplicant and wpa_cli on both laptops,
1. wpa_supplicant-2.4,
a. .config file in wpa_supplicant-2.4 has below configurations,
CONFIG_DRIVER_NL80211=y
# optional, depending on libnl version you want to use:
# CONFIG_LIBNL20=y
CONFIG_CTRL_IFACE=y
CONFIG_WPS=y
CONFIG_WPS2=y
CONFIG_P2P=y
CONFIG_AP=y
# and maybe DBus
b. cp wpa_supplicant.conf /etc/wpa_supplicant.conf
c. sudo make && sudo make install
d. p2p.conf file
ctrl_interface=/var/run/wpa_supplicant
ap_scan=1
device_name=my-device-name
device_type=1-0050F204-1
# If you need to modify the group owner intent, 0-15, the higher
# number indicates preference to become the GO. You can also set
# this on p2p_connect commands.
#p2p_go_intent=15
# optional, can be useful for monitoring, forces
# wpa_supplicant to use only channel 1 rather than
# 1, 6 and 11:
#p2p_listen_reg_class=81
#p2p_listen_channel=1
#p2p_oper_reg_class=81
#p2p_oper_channel=1
e. Start wpa supplicant,
./wpa_supplicant -Dnl80211 -c /path/to/p2p.conf -i wlan0 -dt
f. ./wpa_cli
>p2p_find
FAIL
————————————————————————————————————————————————————————
lsmod output
bcma 52096 3 b43,brcmsmac
cordic 12574 1 brcmsmac
brcmutil 15618 1 brcmsmac
b43 387371 0
mac80211 630728 2 b43,brcmsmac
cfg80211 484040 3 b43,brcmsmac,mac80211
——————————————————————————————————————————————————————————
iw list output
* P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* P2P-client: 0x40 0xd0
* P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* IBSS
* IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* IBSS: 0x40 0xb0 0xc0 0xd0
Device supports RSN-IBSS.
Device supports HT-IBSS.
* managed
* managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* managed: 0x40 0xd0
* monitor
* monitor
* AP
* AP/VLAN
* AP/VLAN
* AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
Regards,
Gangadhar