albfan / miraclecast

Connect external monitors to your system via Wifi-Display specification also known as Miracast
Other
3.68k stars 408 forks source link

wpa_supplicant over D-Bus #114

Open grawity opened 7 years ago

grawity commented 7 years ago

Instead of spawning a whole new wpa_supplicant instance it might be useful to re-use the already running one via D-Bus (fi.w1.wpa_supplicant1), similar to how NetworkManager works. That might help with #99, also with using WiFi and Miracast at the same time (#75).

albfan commented 7 years ago

Working in that direction would be great, but is a huge change. Any sample code or PR can be discussed and refined.

albfan commented 7 years ago

https://w1.fi/wpa_supplicant/devel/dbus.html#dbus_p2pdevice

Implementation on connman https://kernel.googlesource.com/pub/scm/network/connman/connman/+/master/gsupplicant/supplicant.c#3387

albfan commented 7 years ago

https://w1.fi/wpa_supplicant/devel/dbus.html#dbus_main "capabilities" tells you if device has p2p support

http://www.linuxwireless.org/en/users/Documentation/rfkill/ should be managed outside dbus

https://w1.fi/wpa_supplicant/devel/p2p.html as doc for wpa_supplicant on p2p

The enable disable implementation of p2p on connman is the only part I didn't get. I need to debug on that part

albfan commented 7 years ago

Enabling p2p just assures that wifi is enabled https://kernel.googlesource.com/pub/scm/network/connman/connman/+/master/src/technology.c#740

disabling wifi disable p2p

https://kernel.googlesource.com/pub/scm/network/connman/connman/+/master/src/technology.c#794

and disabling p2p just add a mark Powered false to p2p, but no one uses it. (As far as I can get)

albfan commented 7 years ago

More info:

https://www.softprayog.in/programming/d-bus-tutorial

https://wiki.gnome.org/NetworkManager/WifiDirect

albfan commented 5 years ago

I'm actively working on this implementation.

https://w1.fi/wpa_supplicant/devel/dbus.html seems to be all the doc needed. Just adding a new interface with similar conf file used now in miraclecast should work, but avoid config files at all is desired

wanted002 commented 3 years ago

Hi, alb~ Is there a PR or fork about this issue? By the way , will it fix issue #75 if implemented ? Thanks~

albfan commented 3 years ago

@wanted002 yes that will fix #75, a successful implementation is https://gitlab.gnome.org/GNOME/gnome-network-displays.

wanted002 commented 2 years ago

In gnome-network-displays, it talks with wpa via network-mamanger api . I think that's because NM is the frontend, and wpa is the backend. And in my opinion, miraclecast acts just like NM as a frontend, so, my question is : Can miraclecast talk with wpa via dbus directly without NM api ?

I'm actively working on this implementation.

https://w1.fi/wpa_supplicant/devel/dbus.html seems to be all the doc needed. Just adding a new interface with similar conf file used now in miraclecast should work, but avoid config files at all is desired

Hi, alb. Do you mean that a p2p iface should be added to wpa_supplicant with method-call 'CreateInterface' first, then miraclecast will talk with the new p2p iface over dbus , and the original interface object , e.g, '/fi/w1/wpa_supplicant1/Interfaces/0' which connected to a wifi infra AP as a STA will not be disturbed ???
How about miraclecast directly talk with the original interface object connected to a AP ? I see the P2PDevice interface to talk to under the object. However, when i do this and got a successful WFD session, my wifi SSID connected is changed to the P2P SSID 'Direct-XY-XYZ'.... and old wifi connection is broken. Any advices ? :( Muchas gracias ~~

albfan commented 2 years ago

dbus communication is the objetive for miraclecast. Allowing p2p interface at same time normal wifi interface. get coupled with NM is a tolerable thing.

Any PR about that will be accepted, all the stuff about network in miraclecast is just an undesired solution.

Perlovka commented 2 years ago

wpa_supplicant should be run with -u option to enable DBus control interface. Also, wpa_supplicant could be compiled without DBus support, maybe better to use wpa_supplicant control interface: https://w1.fi/wpa_supplicant/devel/ctrl_iface_page.html

albfan commented 2 years ago

@Perlovka yes, on many system it runs that way

$ ps -ef | grep wpa
root        1120       1  0 abr01 ?        00:00:24 /usr/sbin/wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -u -s

Of course, an option to configure wpa_supplicant without dbus would be welcome. (even from building or running)

semarainc commented 1 year ago

Hi, is there any progress on this feature?

Thank you

albfan commented 1 year ago

Looking for time or contributor to port successful implementation on https://gitlab.gnome.org/GNOME/gnome-network-displays here

sidevesh commented 11 months ago

Gnome 45 is gonna make screencasting built into the shell by integrating gnome network displays, it does not support sink functionality though and looks like it does not plan to https://gitlab.gnome.org/GNOME/gnome-network-displays/-/issues/316 It would be great if we can get this setup, also on that issue, it was mentioned that NetworkManager may need improvements in P2P support for this, would that be the case ?