Making KDE Connect to support WiFi Direct would be really helpful when I’m on a WiFi network that has client isolation. I managed to set up a WiFi Direct connection to my Android phone while still keeping my laptop connected to the WiFi that has internet. However, KDE Connect doesn’t see WiFi Direct as a valid option. Even though when I manually add laptop’s WiFi direct IP address KDE Connect shows ping value (meaning the connection work), but KDE Connect can’t find the laptop’s server meaning it possibly doesn’t try to run the server on the WiFi direct interface.
I know it’s a long shot, but I decided to share this particular use case which if implemented will result in usability similar to AirDrop I’ll be very happy sitting in a coffee shop sending files and clipboard to my phone without any reliance on their WiFi. I know Bluetooth option exist, but it’s quite slow for files.
I am interested in this too. (I was looking at this specifically for implementing it for KDE Connect). If you could share the process, we could come up with a prototype and get this upstreamed. I have several usecases for this already especially for situations when I am not home and am not connected to a central Wi-Fi
Using a combination of nmcli and wpa_cli I established a WiFi P2P connection to my phone and made sure they can ping each other through that connection. I could go into more detail here if you’d like.
Since the phone and the laptop were connected at that point I made an assumption that KDE Connect will just see the laptop but it’s not the case. When I added the IP manually into the Custom device list in KDE Connect it was able to ping it (on the screenshot) but otherwise didn’t see. I suspect that KDE Connect starts its server bound only to the WiFi interface.
Indeed, support of WiFi Direct will need to be added on both mobile and desktop side.
Using a combination of nmcli and wpa_cli I established a WiFi P2P connection to my phone and made sure they can ping each other through that connection. I could go into more detail here if you’d like.
Yes, I would like more details so that I can find way to recreate them in code/automate them.
I did my experiments on Ubuntu 24.04 with NetworkManager and with Intel AX210 Wifi adapter. I’m writing this from memory, so I hope I don’t miss too much steps.
Check that the P2P device appears
sudo nmcli device
You should see something similar to:
wlp1s0 wifi connected <Your‑SSID>
lo loopback connected (externally) lo
p2p-dev-wlp1s0 wifi-p2p disconnected
Launch the interactive wpa_cli on the P2P device
NetworkManager runs its own instance of wpa_supplicant, but you can talk to it directly for ad‑hoc testing:
sudo wpa_cli -i p2p-dev-wlp1s0
You’ll be dropped into a prompt.
3. Put the Android phone into Wi‑Fi Direct discovery mode
4. Discover the Android from the Ubuntu side
At the wpa_cli prompt, run:
p2p_find
You should see a short progress indicator, then a list of discovered peers appears (use p2p_peers to view them.
5. Initiate a P2P connection
p2p_connect 02:11:22:33:44:55 pbc
On the phone you’ll get a pop‑up asking to confirm the connection; tap Accept.
If everything goes well you’ll see something like:
OK
p2p_group_started wlan0 GO ssid=DIRECT-XX-MyPhone freq=2412
I’ve made more progress KDE Connect finally works on the WiFi Direct!
Here’s a much better way to create a WiFi Direct connection:
Put the Android phone into Wi‑Fi Direct discovery mode
2. Use wpa_cli to find out it’s mac adress
sudo wpa_cli -i p2p-dev-wlp1s0
then in the wpa_cli interface
p2p_find
You should see a short progress indicator, then a list of discovered peers appears or in my case just one peer.
3. Use the mac address to create and start a Network Manager connection
nmcli connection add connection.type wifi-p2p ifname p2p-dev-wlp1s0 wifi-p2p.peer 02:11:22:33:44:55 autoconnect no
nmcli con up wifi-p2p-p2p-dev-wlp1s0
This will automatically do everything that is needed to create the connection and Android phone will show a pop‑up asking to confirm the connection; tap Accept.
That’s it! Get the laptop WiFi Direct IP and add it manually to the KDE Connect. It works! It would be much better to be able to create WiFi Direct connection from KDE Connect’s interface but otherwise it’s super convenient to be able to use this direct connection on the go.