benzea / gnome-network-displays

Miracast implementation for GNOME
GNU General Public License v3.0
367 stars 39 forks source link

How do you enable p2p? #64

Closed p00f closed 4 years ago

p00f commented 5 years ago

My adapter (TL-WN725N) supports WiFi Direct. Its driver is part of the kernel. I have networkmanager 1.20.2-1 and wpa_supplicant 2:2.9-1. Yet nmcli shows this:


        wifi (r8188eu), C0:25:E9:26:87:B0, hw, mtu 1500
        ip4 default, ip6 default
        inet4 192.168.1.8/24
        route4 0.0.0.0/0
        route4 192.168.1.0/24
        inet6 fe80::2a2b:4035:2d08:f5cf/64
        route6 fe80::/64
        route6 ::/0
        route6 ff00::/8
ArnoldSchiller commented 5 years ago
iw wlan0 interface add p2p0 type managed
nmcli connection edit type wifi-p2p con-name REMOTEDISPLAY
set wifi-p2p.peer MACADRESSFROMTHEREMOTEDISPLAY  
set wifi-p2p.wps-method pbc
set connection.autoconnect no
save
quit

But this only works if (in my case a rtl8192se)

wpa_cli p2p_find
Selected interface 'wlan0'
OK

It doesn't work on one of my devices, so it looks like (in this case a iwlwifi Ultimate-N 6300)

wpa_cli p2p_find
Selected interface 'wlan0'
FAIL
ArnoldSchiller commented 5 years ago

Since today I have a TP-LINK TL-WN821N version 6 - The thing has a RTL8192EU built in and not like version1,2 or 3 an ath9k - p2p only works when wpa_supplicant loads the nl80211 driver.

To ensure this, in /etc/network/interfaces I have

iface wlan1 inet dhcp
      wpa-driver nl80211,wext
      wpa-conf /etc/wpa_supplicant/wpa1.conf

and allowed the NetworkManager in the networkmanager.conf ifupdown.

[main]
plugins=ifupdown,keyfile

Oh yes and the driver of TP-Link itself doesn't work under Kernel 5.2 but this one here https://github.com/clnhub/rtl8192eu-linux

ArnoldSchiller commented 5 years ago

Note to the above post, the RTL8192EU does not run stable in p2p-mode. lwfinger also does not intend to support it. That's why I returned the stick. ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS] ran with the same configuration out of the box

benzea commented 4 years ago

@ChiDal what does iw phy say?

p00f commented 4 years ago

@ChiDal what does iw phy say?

Blank

p00f commented 4 years ago
iw wlan0 interface add p2p0 type managed
nmcli connection edit type wifi-p2p con-name REMOTEDISPLAY
set wifi-p2p.peer MACADRESSFROMTHEREMOTEDISPLAY  
set wifi-p2p.wps-method pbc
set connection.autoconnect no
save
quit

But this only works if (in my case a rtl8192se)

wpa_cli p2p_find
Selected interface 'wlan0'
OK

It doesn't work on one of my devices, so it looks like (in this case a iwlwifi Ultimate-N 6300)

wpa_cli p2p_find
Selected interface 'wlan0'
FAIL

wpa_cli p2p_find gives: Failed to connect to non-global ctrl_ifname: (nil) error: No such file or directory

p00f commented 4 years ago

I have the exact same error on Arch and rawhide

benzea commented 4 years ago

@ChiDal what does iw phy say?

Blank

To be honest, I don't really believe that … it should list all phy's and their capabilities. And you definitely have some phy's otherwise you wouldn't have wifi.

p00f commented 4 years ago

@ChiDal what does iw phy say?

Blank

To be honest, I don't really believe that … it should list all phy's and their capabilities. And you definitely have some phy's otherwise you wouldn't have wifi.

Screenshot from 2019-11-09 10-40-38

ArnoldSchiller commented 4 years ago

@ChiDal sudo su and then iw phy perhaps your user hasn't the right to access the wifi-device

benzea commented 4 years ago

It does not seem like one needs root privileges to query the phy information. I am a bit lost as to what this means. I mean, is the wifi adapter not managed through nl80211 but wext or something ancient like that?

p00f commented 4 years ago

@ChiDal sudo su and then iw phy perhaps your user hasn't the right to access the wifi-device

Still blank

benzea commented 4 years ago

But, what does iw dev show then?

p00f commented 4 years ago

But, what does iw dev show then?

Blank too

ArnoldSchiller commented 4 years ago

Very strange

cd /sys/devices/
find . | grep phy80211
benzea commented 4 years ago

Well … the explanation would be that the device still uses a wext driver. Which is ancient, and probably unsupported really …

benzea commented 4 years ago

To be honest, I am assuming that something is odd with that specific wifi device. I'll close this, as I don't know where to continue looking and everything kinda looks to me like it cannot work with that specific wifi device.

p00f commented 4 years ago

@benzea Pinged you so that you get notifications as the issue is closed. So it is indeed wext and I found this in realtek docs: image

The command worked without any errors (I tried both n=1 and n=3 from here: image ) .Also iwpriv lists p2p_set, p2p_get and p2p_get2 in available private ioctls But p2p_find still FAILs in wpa_cli

benzea commented 4 years ago

@ChiDal, I do understand that it is a pain, but I don't think we can support this at all.

From a gnome-network-displays point of view, it is an issue for NetworkManager or lower in the stack. However, wext is really old and has been replaced by newer and better interfaces. I don't think there is any interest in trying to properly support it.

The various projects might accept patches. But you are probably better off just forgetting about this hardware unfortunately.