- If Wi-Fi access is not already enabled then issue the following connman command:$$ connmanctl enable wifi Enabled wifi
- Once Wi-Fi is enabled the wpa_supplicant daemon must be stopped and disabled before we make changes to its configuration$$ systemctl stop wpa_supplicant $ systemctl disable wpa_supplicant
- Next, restart wpa_supplicant with a new configuration for the driver, interface and config file:$$ wpa_supplicant -Dn180211 -iwlan0 -c/etc/wpa_supplicant.conf & Successfully initialized wpa_supplicant
- Now that WPA is initialized and configured we can new add a Wi-Fi Direct supported p2p group using the WPA Command Line Interface tool (wpa_cli)$$ wpa_cli
- Once the wpa_cli prompt is started we can add our new p2p group with the following command:> p2p_group_add
- When correctly initialized this should provide information at the command line as shown below, including the randomly generated SSID name (e.g., “DIRECT-wK”) and password (e.g., “MKbq90iM):OOK> Using interface p2p_wlan0-0 with hwaddr a0:c5:89:04:93:5b and ssid "DIRECT-wK"p2p_wlan0-0: interface state UNINITIALIZED->ENABLEDp2p_wlan0-0: AP-ENABLEDp2p_wlan0-0: CTRL-EVENT-CONNECTED - Connection to a0:c5:89:04:93:5b completed [id=0 id_str=]P2P-GROUP-STARTED p2p_wlan0-0GO ssid="DIRECT-wK" freq=2462 go_dev_addr=a0:c5:89:04:93:5a<3>P2P-GROUP-STARTED p2p_wlan0-0GO ssid="DIRECT-wK" freq=2462 passphrase="MKbq9OiM" go_dev_addr=a0:c5:89:04:93:5a
- With this set up the final step it to exit wpa_cli (CTRL+D) and set an IP address for this new p2p group interface:
: This configuration will not assign an IP address automatically so you need to set it manually for the other device as well (from the same subnet).