I want to connect from a Laptop (Linux Mint 20.2) with a running networkmanager to a RPI 3 Raspberry Pi OS Lite 2022-09-22 over Wi-Fi direct.

I'm a teacher at a school where all the interactive boards are connect to AppleTV-devices, which as a Linux user I can't use. As a workaround, I use a Miracast-Adapater in conjunction with gnome-network-displays. But since this always transfers the entire screen, I put together a VNC system that allows me to transfer individual windows (just by a click) to a raspberry-pi which is connected to the beamer.

To be independent of WLAN networks, I now want to create a network via WIFI-Direct between the rasperry-pi and my linuxmint laptop.

If I turn off NetworkManager on my laptop, I can establish a working network connection and use it to establish an ssh connection, for example. The informations on Connect Android smartphone with Wi-Fi Direct to a Raspberry Pi and Connect to Raspberry PI 3 over Wi-Fi direct were very helpful.

But if the NetworkManager is running, the connection always fails.

On the raspberry-pi the wpa_supplicant-configuration is:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
enter code hereupdate_config=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.

# In order to support 802.11n for the p2p Group Owner

# Device type
#   1-0050F204-1 (Computer / PC)
#   1-0050F204-2 (Computer / Server)
#   5-0050F204-1 (Storage / NAS)
#   6-0050F204-1 (Network Infrastructure / AP)

The linux laptop with the running NetworkManager I configure with:

wpa_cli set update_config 1
wpa_cli set ap_scan 1
wpa_cli set device_name laptop
wpa_cli set device_type 1-0050F204-1
wpa_cli set driver_param use_p2p_group_interface=1
wpa_cli set driver_param p2p_device=1
wpa_cli set p2p_go_intent 10
wpa_cli set p2p_go_ht40 1

Then I start the p2p-connection-process:

raspi ~# wpa_cli p2p_find
laptop ~# wpa_cli p2p_find

and wait some seconds and find out, which is the right MAC-address:

raspi ~# for i in $( wpa_cli -i p2p-dev-wlan0 p2p_peers ); do echo -n "$i "; wpa_cli -i p2p-dev-wlan0 p2p_peer $i | grep device_name=; done
laptop ~# for i in $( wpa_cli -i p2p-dev-wlan0 p2p_peers ); do echo -n "$i "; wpa_cli -i p2p-dev-wlan0 p2p_peer $i | grep device_name=; done

Finally I try to establish the connection, which is failing:

raspi ~# wpa_cli p2p_connect LAPTOP-MAC pin auth
(pin_number will be issued)
laptop ~# wpa_cli p2p_connect RASPI-MAC THE-GIVEN-PIN
Selected interface 'p2p-dev-wlan0'

The corresponding wpa_supplicant-messages with two extra empy lines are:

p2p-dev-wlan0: Control interface command 'P2P_CONNECT LAPTOP-MAC THE-GIVEN-PIN'
p2p-dev-wlan0: Determining shared radio frequencies (max len 2)
p2p-dev-wlan0: Shared frequencies (len=0): completed iteration
p2p-dev-wlan0: Shared frequencies (len=0): valid for P2P
p2p-dev-wlan0: Determining shared radio frequencies (max len 2)
p2p-dev-wlan0: Shared frequencies (len=0): completed iteration
p2p-dev-wlan0: P2P: num_unused_channels: 2
P2P: Setup freqs: freq=0 num_MCC=2 shared_freqs=0 num_unused=2
P2P: best_freq=0, go=1
P2P: No preferred frequency list available
P2P: Current operating channels are not available for P2P. Try to use another channel
P2P: Own frequency preference: 0 MHz
P2P: Create a new interface p2p-wlan0-0 for the group
nl80211: Create interface iftype 9 (P2P_GO)
nl80211: Ignored event 7 (NL80211_CMD_NEW_INTERFACE) for foreign interface (ifindex 7 wdev 0x0)
nl80211: Ignored event 7 (NL80211_CMD_NEW_INTERFACE) for foreign interface (ifindex 7 wdev 0x0)
nl80211: New interface p2p-wlan0-0 created: ifindex=7
nl80211: Interface p2p-wlan0-0 created for P2P - disable 11b rates
nl80211: NL80211_CMD_SET_TX_BITRATE_MASK (ifindex=7 NL80211_TXRATE_LEGACY=OFDM-only)
nl80211: Set TX rates failed: ret=-95 (Operation not supported)
P2P: Created pending virtual interface p2p-wlan0-0 addr RASPI-MAC
P2P: Request to start group negotiation - peer=LAPTOP-MAC  GO Intent=15  Intended Interface Address=RASPI-MAC wps_method=2 persistent_group=0 pd_before_go_neg=0 oob_pw_id=0

P2P: Cannot connect to unknown P2P Device peer=LAPTOP-MAC

P2P: Removing pending group interface p2p-wlan0-0
nl80211: wpa_driver_nl80211_if_remove(type=3 ifname=p2p-wlan0-0) ifindex=7 added_if=0
nl80211: Remove interface ifindex=7
nl80211: if_indices[16]:
nl80211: if_indices[16]:
nl80211: if_indices[16]:
nl80211: if_indices[16]:
P2P: Timeout (state=SEARCH)

Without a running NetworkManager such a connection works smoothly.

And: The gnome-network-display works of course with a running NetworkManager, I can ping it without problems.

My Question now is: How do I have to configure both systems (raspi und NetworkManager-laptop) in order to get a working connection?


The log of the successful connection-process with the MS-Displayadapter is:

P2P-DEVICE-FOUND de:98:40:9f:5f:e5 p2p_dev_addr=de:98:40:9f:5f:e5 pri_dev_type=7-0050F204-1 name='MSDisplayAdapter_E5' config_methods=0x88 dev_capab=0x25 group_capab=0x2a wfd_dev_info=0x015d022a0032 new=1
dbus: Register peer object '/fi/w1/wpa_supplicant1/Interfaces/0/Peers/de98409f5fe5'
wlan0: SME: Trying to authenticate with 04:d4:c4:61:c1:b0 (SSID='homessid' freq=2437 MHz)
wlan0: Trying to associate with 04:d4:c4:61:c1:b0 (SSID='homessid' freq=2437 MHz)
wlan0: Associated with 04:d4:c4:61:c1:b0
wlan0: WPA: Key negotiation completed with 04:d4:c4:61:c1:b0 [PTK=CCMP GTK=CCMP]
wlan0: CTRL-EVENT-CONNECTED - Connection to 04:d4:c4:61:c1:b0 completed [id=0 id_str=]
wlan0: CTRL-EVENT-SIGNAL-CHANGE above=1 signal=-56 noise=9999 txrate=52000
P2P-GO-NEG-SUCCESS role=GO freq=2437 ht40=0 peer_dev=de:98:40:9f:5f:e5 peer_iface=de:98:40:9f:5f:e5 wps_method=PBC
Using interface p2p-wlan0-0 with hwaddr f8:ac:65:6b:9c:27 and ssid "DIRECT-Jb"
p2p-wlan0-0: interface state UNINITIALIZED->ENABLED
p2p-wlan0-0: AP-ENABLED 
p2p-wlan0-0: CTRL-EVENT-CONNECTED - Connection to f8:ac:65:6b:9c:27 completed [id=0 id_str=]
p2p-wlan0-0: WPS-PBC-ACTIVE 
P2P-DEVICE-FOUND de:98:40:9f:5f:e5 p2p_dev_addr=de:98:40:9f:5f:e5 pri_dev_type=7-0050F204-1 name='MSDisplayAdapter_E5' config_methods=0x88 dev_capab=0x25 group_capab=0x0 wfd_dev_info=0x015d022a0032 new=0
p2p-wlan0-0: CTRL-EVENT-EAP-STARTED de:98:40:9f:5f:e5
p2p-wlan0-0: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1
p2p-wlan0-0: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=14122 method=254
p2p-wlan0-0: WPS-REG-SUCCESS de:98:40:9f:5f:e5 56789abc-def0-1234-5678-90abcdef0123
P2P-GROUP-STARTED p2p-wlan0-0 GO ssid="DIRECT-Jb" freq=2437 go_dev_addr=f8:ac:65:6b:9c:71
dbus: Register group object '/fi/w1/wpa_supplicant1/Interfaces/1/Groups/Jb'
p2p-wlan0-0: WPS-PBC-DISABLE 
p2p-wlan0-0: WPS-SUCCESS 
p2p-wlan0-0: CTRL-EVENT-EAP-FAILURE de:98:40:9f:5f:e5
wlan0: CTRL-EVENT-SIGNAL-CHANGE above=0 signal=-54 noise=9999 txrate=52000
p2p-wlan0-0: AP-STA-CONNECTED de:98:40:9f:5f:e5 p2p_dev_addr=de:98:40:9f:5f:e5
AP-STA-CONNECTED de:98:40:9f:5f:e5 p2p_dev_addr=de:98:40:9f:5f:e5
  • This question is incomprehensible. You are mixing incompatible networking systems. Regardless of what network manager you may be running this has NOTHING to so with ssh. The "wpa_supplicant-configuration" makes no sense. Start with some FACTS e.g. Which OS on the Pi and how you have configured it. wpa-cli has NOTHING to do with NetworkManager
    – Milliways
    Oct 17, 2022 at 11:31
  • Thank you for your notes. With ssh I just wanted to indicate what kind of service I would like to use. wpa_supplicant and NetworkManager are running in parallel on my laptop and there is now problem configuring and using wpa_supplicant with wpa_cli in parallel. As far as I understand the way gnome-network-display is working, my task should be implementable.[I will update some the OS-Versions]
    – tern
    Oct 17, 2022 at 12:37

1 Answer 1


NetworkManager is configured with nmcli.

While NetworkManager indirectly uses wpa_supplicant you should not attempt to directly configure it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.