Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miraclecast as source #4

Open
albfan opened this issue Jan 27, 2015 · 57 comments · May be fixed by #455
Open

miraclecast as source #4

albfan opened this issue Jan 27, 2015 · 57 comments · May be fixed by #455

Comments

@albfan
Copy link
Owner

albfan commented Jan 27, 2015

From #47 (comment)
Here is a Q&D (quick and dirty) for use laptop as source:

Start miracle-wifid as usual

$ sudo miracle-wifid --log-level trace

Start miracle-wifictl

$ sudo miracle-wifictl --log-level trace
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                 
     3 wlp3s0                   archlinux-alberto             

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 

 0 peers and 1 links listed.
[miraclectl] # select 3
link 3 selected

Now do something to make your device visible (like start screen mirroring)

[ADD] Peer: f2:27:65:35:b6:8f@3
[PROV] Peer: ff:ff:ff:ff:ff:ff@3 Type: pbc PIN: 
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                 
     3 wlp3s0                   archlinux-alberto             

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 
     3 ff:ff:ff:ff:ff:ff@3           Alberto Fanjul Alonso            no        

 1 peers and 1 links listed.
[miraclectl] # connect ff:ff:ff:ff:ff:ff@3
[CONNECT] Peer: ff:ff:ff:ff:ff:ff@3
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                 
     3 wlp3s0                   archlinux-alberto             

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 
     3 ff:ff:ff:ff:ff:ff@3           Alberto Fanjul Alonso            yes        

 1 peers and 1 links listed.

Search on miracle-wifid output for a message like this

TRACE: wpa: raw message: <3>P2P-GROUP-STARTED p2p-wlp3s0-3 client ssid="DIRECT-ZP-Alberto Fanjul Alonso" freq=2462 psk=5d3ce6a19876398db2d9b7566cc1d8e3a87c36b449ff3fd601f95d60718cdd4e go_dev_addr=ff:ff:ff:ff5:ff:ff ip_addr=192.168.49.200 ip_mask=255.255.255.0 go_ip_addr=192.168.49.1

At this point you have your devices paired show they can see each other

Start a stream on laptop (using vlc for example)

$ cvlc screen:// :screen-fps=25 :screen-caching=100 --sout '#transcode{vcodec=MJPG,vb=0,width=1022,height=575,acodec=none}:http{mux=ogg,dst=:8554/myscreen}'

On the other device use some viewer to reproduce that:( I've used vlc for android)

that stream can be viewed opening url: http://192.168.49.200:8554/myscreen

Develops needed:

  1. autocomplete peer-id on miracle-wifictl
  2. miracle-sinkctl need a command to launch automatically that external command (miracle-sinkctl does the same with gstreamer)
  3. provide a gstreamer command to stream screen (See examples here https://coderwall.com/p/_inesq/gstreamer-commands-for-desktop-streaming-to-raspberry-pi)
  4. Develop an android app based on vlc for android to make device visible, pair with laptop and receive config from miracle-sinkctl about url to open
@albfan
Copy link
Owner Author

albfan commented Aug 18, 2016

If you have two laptops avaliable, sink can be too another miraclecast. Now with existing raspberry pi image #100 sink I can test it easily.

Help wanted!

@Hans-Maulwurf
Copy link

When I follow your instructions above, I don't get any to my TV (tested with Samsung and LG). Connecting works fine, but usually after this, the source automatically starts sending the video-content to the TV. When I use the cvlc commend, nothing happenes.

@albfan
Copy link
Owner Author

albfan commented Aug 29, 2016

That description suppose that you control both sides (just to prove it can work) When using against a miracast device (as your tv) is needed to parse devices communication to see -at least- on which port your tv expect the stream. Run it with miracle-wifid --log-level trace and let's see if we can setup manually the correct stream.

@Hans-Maulwurf
Copy link

Hans-Maulwurf commented Aug 29, 2016

ok, I have a Samsung TV at the moment here and it's not possible to connect (maybe this is a new issue)

wifid:

miracle-wifid logs
[muench@muench-arch ~]$ sudo systemctl stop NetworkManager.service 
[sudo] Passwort für muench: 
[muench@muench-arch ~]$ sudo miracle-wifid --log-level trace
INFO: miracle-wifid - revision 1.0 Aug 26 2016 07:02:19
DEBUG: friendly-name from local hostname: muench-arch (manager_read_name() in ../../../src/wifi/wifid.c:366)
DEBUG: link: new link: wlo1 (6) (link_new() in ../../../src/wifi/wifid-link.c:71)
DEBUG: supplicant: new supplicant for wlo1 (supplicant_new() in ../../../src/wifi/wifid-supplicant.c:2087)
INFO: link: add link: wlo1
INFO: link: manage link wlo1
DEBUG: supplicant: start supplicant of wlo1 (supplicant_start() in ../../../src/wifi/wifid-supplicant.c:2610)
DEBUG: supplicant: spawn supplicant of wlo1 (supplicant_spawn() in ../../../src/wifi/wifid-supplicant.c:2459)
INFO: supplicant: wpa_supplicant found: /usr/bin/wpa_supplicant
INFO: supplicant: wpas spawned as pid:14299
DEBUG: supplicant: open supplicant of wlo1 (supplicant_open() in ../../../src/wifi/wifid-supplicant.c:2250)
TRACE: wpa: raw message: OK

TRACE: wpa: raw message: OK

TRACE: wpa: raw message: p2p_device_address=d8:fc:93:ad:51:5c
p2p_state=IDLE
wifi_display=1
ifname=p2p-dev-wlo1
address=d8:fc:93:ad:51:5c
ifname=wlo1
address=d8:fc:93:ad:51:5b

DEBUG: supplicant: local p2p-address is: d8:fc:93:ad:51:5c (supplicant_status_fn() in ../../../src/wifi/wifid-supplicant.c:1807)
TRACE: wpa: raw message: OK

TRACE: wpa: raw message: OK

TRACE: wpa: raw message: FAIL

TRACE: wpa: raw message: OK

DEBUG: link: link wlo1 started (link_supplicant_started() in ../../../src/wifi/wifid-link.c:277)
TRACE: wpa: raw message: FAIL

DEBUG: supplicant: sent P2P_FIND to wpas on wlo1 (supplicant_p2p_start_scan() in ../../../src/wifi/wifid-supplicant.c:2020)
TRACE: wpa: raw message: OK

DEBUG: supplicant: p2p-scanning now active on wlo1 (supplicant_p2p_find_fn() in ../../../src/wifi/wifid-supplicant.c:1901)
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>P2P-DEVICE-FOUND fe:f1:36:c5:3d:47 p2p_dev_addr=fe:f1:36:c5:3d:47 pri_dev_type=7-0050F204-1 name='[TV] Betrieb TV' config_methods=0x188 dev_capab=0x25 group_capab=0x80 wfd_dev_info=0x01131c440036 new=1
TRACE: wpa: raw message: <3>P2P-DEVICE-FOUND fe:f1:36:c5:3d:47 p2p_dev_addr=fe:f1:36:c5:3d:47 pri_dev_type=7-0050F204-1 name='[TV] Betrieb TV' config_methods=0x188 dev_capab=0x25 group_capab=0x80 wfd_dev_info=0x01131c440036 new=1
DEBUG: peer: new peer: fe:f1:36:c5:3d:47 @ wlo1 (peer_new() in ../../../src/wifi/wifid-peer.c:52)
INFO: peer: add peer: fe:f1:36:c5:3d:47
DEBUG: peer: peer fe:f1:36:c5:3d:47 @ wlo1 started (peer_supplicant_started() in ../../../src/wifi/wifid-peer.c:162)
DEBUG: supplicant: requesting data for new peer fe:f1:36:c5:3d:47 (supplicant_event_p2p_device_found() in ../../../src/wifi/wifid-supplicant.c:962)
TRACE: wpa: raw message: fe:f1:36:c5:3d:47
pri_dev_type=7-0050F204-1
device_name=[TV] Betrieb TV
manufacturer=SAMSUNG_ELECTRONICS
model_name=UE60J6200
model_number=T-HKMFDEUC-1460.4
serial_number= 
config_methods=0x188
dev_capab=0x25
group_capab=0x80
level=-45
age=3
listen_freq=2467
wps_method=not-ready
interface_addr=00:00:00:00:00:00
member_in_go_dev=00:00:00:00:00:00
member_in_go_iface=00:00:00:00:00:00
go_neg_req_sent=0
go_state=unknown
dialog_token=0
intended_addr=00:00:00:00:00:00
country=__
oper_freq=0
req_config_methods=0x0
flags=[REPORTED]
status=0
invitation_reqs=0
wfd_subelems=00000601131c440036

TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-STARTED 
DEBUG: supplicant: connect to fe:f1:36:c5:3d:47 via pbc/(null) (supplicant_peer_connect() in ../../../src/wifi/wifid-supplicant.c:739)
TRACE: wpa: raw message: <3>P2P-FIND-STOPPED 
TRACE: wpa: raw message: <3>P2P-FIND-STOPPED 
DEBUG: supplicant: p2p-scanning stopped on wlo1 (supplicant_event_p2p_find_stopped() in ../../../src/wifi/wifid-supplicant.c:904)
TRACE: wpa: raw message: OK

TRACE: wpa: raw message: <3>P2P-GO-NEG-SUCCESS role=client freq=2412 ht40=0 peer_dev=fe:f1:36:c5:3d:47 peer_iface=fe:f1:36:c5:3d:47 wps_method=PBC
TRACE: wpa: raw message: <3>P2P-GO-NEG-SUCCESS role=client freq=2412 ht40=0 peer_dev=fe:f1:36:c5:3d:47 peer_iface=fe:f1:36:c5:3d:47 wps_method=PBC
DEBUG: supplicant: set STA-MAC for fe:f1:36:c5:3d:47 from <none> to fe:f1:36:c5:3d:47 (via GO-NEG-SUCCESS) (supplicant_event_p2p_go_neg_success() in ../../../src/wifi/wifid-supplicant.c:1195)
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-BSS-ADDED 0 24:e9:b3:f1:c9:d8
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-BSS-ADDED 1 00:1a:8c:a0:f1:36
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-BSS-ADDED 2 00:1a:8c:a0:f1:37
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-BSS-ADDED 3 c0:25:06:cb:94:78
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-BSS-ADDED 4 00:1a:8c:a0:f1:3d
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-BSS-ADDED 5 00:1a:8c:a0:f1:3e
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-BSS-ADDED 6 00:1a:8c:a0:f1:3f
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-BSS-ADDED 7 00:1a:8c:a0:f1:2e
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-BSS-ADDED 8 00:1a:8c:a0:f1:2d
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>WPS-AP-AVAILABLE 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>WPS-AP-AVAILABLE 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-BSS-ADDED 0 fe:f1:36:c5:3d:47
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>WPS-AP-AVAILABLE-PBC 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>SME: Trying to authenticate with fe:f1:36:c5:3d:47 (SSID='DIRECT-t1[TV] Betrieb TV' freq=2412 MHz)
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>WPS-AP-AVAILABLE-PBC 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>WPS-AP-AVAILABLE 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-BSS-REMOVED 0 fe:f1:36:c5:3d:47
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>WPS-AP-AVAILABLE 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-BSS-ADDED 9 00:1a:8c:a0:f1:2c
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>WPS-AP-AVAILABLE 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>WPS-AP-AVAILABLE 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>WPS-AP-AVAILABLE 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>WPS-AP-AVAILABLE 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-BSS-ADDED 10 00:1a:8c:a0:f1:35
TRACE: wpa: raw message: IFNAME=wlo1 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlo1 <3>WPS-AP-AVAILABLE 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-BSS-ADDED 1 fe:f1:36:c5:3d:47
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>WPS-AP-AVAILABLE-PBC 
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>SME: Trying to authenticate with fe:f1:36:c5:3d:47 (SSID='DIRECT-t1[TV] Betrieb TV' freq=2412 MHz)
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>Trying to associate with fe:f1:36:c5:3d:47 (SSID='DIRECT-t1[TV] Betrieb TV' freq=2412 MHz)
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>Associated with fe:f1:36:c5:3d:47
TRACE: wpa: raw message: <3>P2P-GROUP-FORMATION-FAILURE 
TRACE: wpa: raw message: <3>P2P-GROUP-FORMATION-FAILURE 
DEBUG: supplicant: peer [TV] Betrieb TV connection failed (supplicant_event_p2p_group_formation_failure() in ../../../src/wifi/wifid-supplicant.c:1305)
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-DISCONNECTED bssid=fe:f1:36:c5:3d:47 reason=3 locally_generated=1
TRACE: wpa: raw message: <3>P2P-GROUP-REMOVED p2p-wlo1-0 client reason=FORMATION_FAILED
TRACE: wpa: raw message: <3>P2P-GROUP-REMOVED p2p-wlo1-0 client reason=FORMATION_FAILED
DEBUG: supplicant: stray P2P-GROUP-REMOVED: <3>P2P-GROUP-REMOVED p2p-wlo1-0 client reason=FORMATION_FAILED (supplicant_event_p2p_group_removed() in ../../../src/wifi/wifid-supplicant.c:1287)
TRACE: wpa: raw message: IFNAME=p2p-wlo1-0 <3>CTRL-EVENT-BSS-REMOVED 1 fe:f1:36:c5:3d:47
TRACE: wpa: raw message: IFNAME=p2p-dev-wlo1 <3>CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
TRACE: wpa: raw message: <3>CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD
DEBUG: supplicant: unhandled wpas-event: <3>CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD (supplicant_event() in ../../../src/wifi/wifid-supplicant.c:1483)
TRACE: wpa: raw message: <3>P2P-DEVICE-LOST p2p_dev_addr=fe:f1:36:c5:3d:47
TRACE: wpa: raw message: <3>P2P-DEVICE-LOST p2p_dev_addr=fe:f1:36:c5:3d:47
DEBUG: supplicant: lost peer fe:f1:36:c5:3d:47 (supplicant_event_p2p_device_lost() in ../../../src/wifi/wifid-supplicant.c:986)
DEBUG: peer: peer fe:f1:36:c5:3d:47 @ wlo1 stopped (peer_supplicant_stopped() in ../../../src/wifi/wifid-peer.c:172)
DEBUG: peer: free peer: fe:f1:36:c5:3d:47 @ wlo1 (peer_free() in ../../../src/wifi/wifid-peer.c:90)
INFO: peer: remove peer: fe:f1:36:c5:3d:47

and wifictl:

miracle-wifictl logs
[muench@muench-arch ~]$ sudo miracle-wifictl 
[sudo] Passwort für muench: 
[ADD] Link: 6
[miraclectl] # kist
Command not found
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                 
     6 wlo1                     muench-arch                   

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 

 0 peers and 1 links listed.
[miraclectl] # select 6
link 6 selected
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                 
     6 wlo1                     muench-arch                   

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 

 0 peers and 1 links listed.
[miraclectl] # p2p-scan
[ADD] Peer: fe:f1:36:c5:3d:47@6
[miraclectl] # help
Available commands:
  list                                      List all objects
  select [link]                             Select default link
  show [link|peer]                          Show detailed object information
  set-friendly-name [link] <name>           Set friendly name of an object
  p2p-scan [link] [stop]                    Control neighborhood P2P scanning
  connect <peer> [provision] [pin]          Connect to peer
  disconnect <peer>                         Disconnect from peer
  quit                                      Quit program
  help                                      Print help
[miraclectl] # connect fe:f1:36:c5:3d:47@6
[FAIL] Peer: fe:f1:36:c5:3d:47@6 Reason: unknown
[REMOVE] Peer: fe:f1:36:c5:3d:47@6
[miraclectl] #

@midi1996
Copy link

midi1996 commented Aug 31, 2016

I tried with one of those Chinese receivers, but it doesnt maintain the connection until I send RTSP stream, even if I initialize it beforehand, I need the specific IP of the receiver to send my stream, so what it does is it successfully connects, then writes "Waiting for RTSP" at this moment it should start receiving, but meanwhile I need to get its IP address but apparently it doesnt wait too much and disconnects quickly.

[ADD] Link: 3
[ADD] Peer: 38:1d:d9:05:5f:ac@3
[miraclectl] # select 3
link 3 selected
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                 
     3 wlp2s0                   ubuntu                        

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 
     3 38:1d:d9:05:5f:ac@3      AnyCast-D9055FAC               no        

 1 peers and 1 links listed.
[miraclectl] # connect 38:1d:d9:05:5f:ac@3
[CONNECT] Peer: 38:1d:d9:05:5f:ac@3
[DISCONNECT] Peer: 38:1d:d9:05:5f:ac@3

@albfan
Copy link
Owner Author

albfan commented Sep 1, 2016

I did a successful connection so that should be something related to devices configuration.

@muqsith
Copy link

muqsith commented Sep 25, 2016

Dear @albfan
Many thanks for this working piece of software and guidance.
I am trying to connect my Desktop(Ubuntu 16.04 LTS) to my Sony Bravia TV, but currently I am not able to proceed further.

Log from Terminal#1

sudo systemctl stop NetworkManager.service
sudo miracle-wifid --log-level trace

DEBUG: supplicant: connect to 32:f7:72:64:bd:fe via pbc/(null) (supplicant_peer_connect() in ~/miraclecast/src/wifi/wifid-supplicant.c:739)
TRACE: wpa: raw message: OK

TRACE: wpa: raw message: <3>P2P-GO-NEG-SUCCESS role=client freq=2417 ht40=0 peer_dev=32:f7:72:64:bd:fe peer_iface=32:f7:72:64:bd:fe wps_method=PBC
TRACE: wpa: raw message: <3>P2P-GO-NEG-SUCCESS role=client freq=2417 ht40=0 peer_dev=32:f7:72:64:bd:fe peer_iface=32:f7:72:64:bd:fe wps_method=PBC
DEBUG: supplicant: set STA-MAC for 32:f7:72:64:bd:fe from <none> to 32:f7:72:64:bd:fe (via GO-NEG-SUCCESS) (supplicant_event_p2p_go_neg_success() in ~/miraclecast/src/wifi/wifid-supplicant.c:1195)
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlan0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlan0 <3>CTRL-EVENT-BSS-REMOVED 7 32:f7:72:64:bd:fe
TRACE: wpa: raw message: IFNAME=wlan0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlan0 <3>WPS-AP-AVAILABLE 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlan0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlan0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlan0 <3>WPS-AP-AVAILABLE 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlan0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlan0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlan0 <3>WPS-AP-AVAILABLE 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-BSS-ADDED 0 32:f7:72:64:bd:fe
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>WPS-AP-AVAILABLE 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlan0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlan0 <3>CTRL-EVENT-BSS-ADDED 8 32:f7:72:64:bd:fe
TRACE: wpa: raw message: IFNAME=wlan0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlan0 <3>WPS-AP-AVAILABLE 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>WPS-AP-AVAILABLE-PBC 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>SME: Trying to authenticate with 32:f7:72:64:bd:fe (SSID='DIRECT-me-BRAVIA' freq=2417 MHz)
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>Trying to associate with 32:f7:72:64:bd:fe (SSID='DIRECT-me-BRAVIA' freq=2417 MHz)
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>Associated with 32:f7:72:64:bd:fe
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-EAP-STARTED EAP authentication started
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-EAP-STATUS status='started' parameter=''
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=14122 method=1
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-EAP-STATUS status='accept proposed method' parameter='WSC'
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-EAP-METHOD EAP vendor 14122 method 1 (WSC) selected
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>WPS-CRED-RECEIVED 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>WPS-SUCCESS 
TRACE: wpa: raw message: <3>P2P-GROUP-FORMATION-SUCCESS 
TRACE: wpa: raw message: <3>P2P-GROUP-FORMATION-SUCCESS 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-EAP-STATUS status='completion' parameter='failure'
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-EAP-FAILURE EAP authentication failed
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-DISCONNECTED bssid=32:f7:72:64:bd:fe reason=3 locally_generated=1
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>SME: Trying to authenticate with 32:f7:72:64:bd:fe (SSID='DIRECT-me-BRAVIA' freq=2417 MHz)
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>Trying to associate with 32:f7:72:64:bd:fe (SSID='DIRECT-me-BRAVIA' freq=2417 MHz)
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>Associated with 32:f7:72:64:bd:fe
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>WPA: Key negotiation completed with 32:f7:72:64:bd:fe [PTK=CCMP GTK=CCMP]
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-CONNECTED - Connection to 32:f7:72:64:bd:fe completed [id=0 id_str=]
TRACE: wpa: raw message: <3>P2P-GROUP-STARTED p2p-wlan0-4 client ssid="DIRECT-me-BRAVIA" freq=2417 psk=912de440ff20ecfc2f577f64e6d2512202a8a2617184f8b8978fd4acb74cd9bb go_dev_addr=32:f7:72:64:bd:fe [PERSISTENT]
TRACE: wpa: raw message: <3>P2P-GROUP-STARTED p2p-wlan0-4 client ssid="DIRECT-me-BRAVIA" freq=2417 psk=912de440ff20ecfc2f577f64e6d2512202a8a2617184f8b8978fd4acb74cd9bb go_dev_addr=32:f7:72:64:bd:fe [PERSISTENT]
DEBUG: supplicant: ssid: DIRECT-me-BRAVIA (supplicant_event_p2p_group_started() in ~/miraclecast/src/wifi/wifid-supplicant.c:1220)
DEBUG: supplicant: new group: p2p-wlan0-4 (supplicant_group_new() in ~/miraclecast/src/wifi/wifid-supplicant.c:489)
DEBUG: supplicant: start remote group on new group p2p-wlan0-4 as client/0 (supplicant_event_p2p_group_started() in ~/miraclecast/src/wifi/wifid-supplicant.c:1255)
DEBUG: supplicant: dhcp-comm-p2p-wlan0-4: L:192.168.179.200 (supplicant_group_comm_fn() in ~/miraclecast/src/wifi/wifid-supplicant.c:254)
DEBUG: supplicant: dhcp-comm-p2p-wlan0-4: S:255.255.255.0 (supplicant_group_comm_fn() in ~/miraclecast/src/wifi/wifid-supplicant.c:254)
DEBUG: supplicant: dhcp-comm-p2p-wlan0-4: G:192.168.179.1 (supplicant_group_comm_fn() in ~/miraclecast/src/wifi/wifid-supplicant.c:254)
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-DISCONNECTED bssid=32:f7:72:64:bd:fe reason=2
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>WPS-AP-AVAILABLE-PBC 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>SME: Trying to authenticate with 32:f7:72:64:bd:fe (SSID='DIRECT-me-BRAVIA' freq=2417 MHz)
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>WPS-AP-AVAILABLE-PBC 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlan0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlan0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlan0 <3>WPS-AP-AVAILABLE 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-BSS-REMOVED 0 32:f7:72:64:bd:fe
TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=p2p-dev-wlan0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlan0 <3>CTRL-EVENT-BSS-REMOVED 8 32:f7:72:64:bd:fe
TRACE: wpa: raw message: IFNAME=wlan0 <3>CTRL-EVENT-SCAN-RESULTS 
TRACE: wpa: raw message: IFNAME=wlan0 <3>WPS-AP-AVAILABLE 
TRACE: wpa: raw message: <3>P2P-GROUP-REMOVED p2p-wlan0-4 client reason=IDLE
TRACE: wpa: raw message: <3>P2P-GROUP-REMOVED p2p-wlan0-4 client reason=IDLE
DEBUG: supplicant: remove group p2p-wlan0-4 (supplicant_event_p2p_group_removed() in ~/miraclecast/src/wifi/wifid-supplicant.c:1291)
DEBUG: supplicant: free group p2p-wlan0-4 (supplicant_group_free() in ~/miraclecast/src/wifi/wifid-supplicant.c:174)
DEBUG: supplicant: killing DHCP-process pid:28451.. (supplicant_group_free() in ~/miraclecast/src/wifi/wifid-supplicant.c:198)
DEBUG: caught SIGCHLD for 28451, reaping child (manager_signal_fn() in ~/miraclecast/src/wifi/wifid.c:174)
TRACE: wpa: raw message: FAIL
Log from Terminal#2

sudo miracle-wifictl

[ADD] Link: 3
[miraclectl] # select 3
link 3 selected
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                 
     3 wlan0                    muqsith-desktop               

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 

 0 peers and 1 links listed.
[miraclectl] # p2p-scan
[miraclectl] # p2p-scan stop
[miraclectl] # p2p-scan stop
[miraclectl] # p2p-scan
[ADD] Peer: 32:f7:72:64:bd:fe@3
[miraclectl] # p2p-scan stop
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                 
     3 wlan0                    muqsith-desktop               

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 
     3 32:f7:72:64:bd:fe@3      KDL-40R560C                    no        

 1 peers and 1 links listed.
[miraclectl] # connect 32:f7:72:64:bd:fe@3
[CONNECT] Peer: 32:f7:72:64:bd:fe@3
[DISCONNECT] Peer: 32:f7:72:64:bd:fe@3
[miraclectl] # connect 32:f7:72:64:bd:fe@3
[CONNECT] Peer: 32:f7:72:64:bd:fe@3
[DISCONNECT] Peer: 32:f7:72:64:bd:fe@3
[miraclectl] # connect 32:f7:72:64:bd:fe@3
[CONNECT] Peer: 32:f7:72:64:bd:fe@3
[DISCONNECT] Peer: 32:f7:72:64:bd:fe@3
[miraclectl] # connect 32:f7:72:64:bd:fe@3
[CONNECT] Peer: 32:f7:72:64:bd:fe@3
[DISCONNECT] Peer: 32:f7:72:64:bd:fe@3
[miraclectl] # connect 32:f7:72:64:bd:fe@3
[CONNECT] Peer: 32:f7:72:64:bd:fe@3
[DISCONNECT] Peer: 32:f7:72:64:bd:fe@3
[FAIL] Peer: 32:f7:72:64:bd:fe@3 Reason: lost
[REMOVE] Peer: 32:f7:72:64:bd:fe@3
[miraclectl] # 

In another terminal I am trying to stream out my screen to the TV

Streaming from Terminal#3

I keep below command ready, when I see the successful connection status in terminal#2, I just press return key here in terminal#3

ffmpeg -f x11grab -show_region 1 -s 1920x1080 -r 25 -i :0.0+0,0 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -tune zerolatency -f mpegts udp://192.168.179.1:1010

I could learn protocol and port from my android phone through "Packet Capture" app. My android phone connects very well to the tv and renders the screen.

Inference

The desktop successfully connects to the TV but immediately disconnects.
Success:

TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-CONNECTED - Connection to 32:f7:72:64:bd:fe completed [id=0 id_str=]

Failure:

TRACE: wpa: raw message: IFNAME=p2p-wlan0-4 <3>CTRL-EVENT-DISCONNECTED bssid=32:f7:72:64:bd:fe reason=2

Later

TRACE: wpa: raw message: <3>P2P-GROUP-REMOVED p2p-wlan0-4 client reason=IDLE

Please kindly help.
Maybe I am doing something wrong while executing the commands or at ffmpeg command.

@midi1996
Copy link

I dont think we can yet swnd an RTPS stream to the TV rn. I dont know if that's what's supposed to happen on normal conditions but for now this thread shows how to stream to a device but by using WiFi direct with a purpose of a local network instead of Display streaming. That's what explains the TV disconnectings also, it may be that the TV doesnt find any supported streaming capabilities in the connected device.

@albfan
Copy link
Owner Author

albfan commented Sep 25, 2016

@muqsith After succesfull connect there's no miracast protocol implemented. When you use miraclecast as sink (say from a phone) it starts a RTSP negotiation (one where port it is streaming, what features it implements...) and from miracle-wifictl that's not implemented.

See last comments from @derekdai on https://gitter.im/albfan/miraclecast. Two get this implemented a first simple approach is to connect to miraclecast running on different devices (if you have a raspberry pi or two laptops should be easy) Controlling both sides is easy to fill whatever is left unimplemented on miracle-wifictl. From there next step is to test on devices without access to it's implementation like your TV.

@ghost
Copy link

ghost commented Oct 7, 2016

I can't connect with "unknown reason" message
here the trace of my log

DEBUG: supplicant: terminating wpas (pid:25165) (supplicant_failed() in /home/mate/Downloads/miraclecast-master/src/wifi/wifid-supplicant.c:2330)
DEBUG: supplicant: close supplicant of rename5 (supplicant_close() in /home/mate/Downloads/miraclecast-master/src/wifi/wifid-supplicant.c:2294)
DEBUG: caught SIGCHLD for 25165, reaping child (manager_signal_fn() in /home/mate/Downloads/miraclecast-master/src/wifi/wifid.c:178)
TRACE: wpa: raw message: <3>P2P-GO-NEG-SUCCESS role=GO freq=2437 ht40=0 peer_dev=92:d8:f3:bf:f5:89 peer_iface=92:d8:f3:bf:f5:89 wps_method=PBC
DEBUG: supplicant: set STA-MAC for 92:d8:f3:bf:f5:89 from  to 92:d8:f3:bf:f5:89 (via GO-NEG-SUCCESS) (supplicant_event_p2p_go_neg_success() in /home/mate/Downloads/miraclecast-master/src/wifi/wifid-supplicant.c:1195)
TRACE: wpa: raw message: IFNAME=p2p-wlp2s0-0 <5>Failed to initialize driver interface
DEBUG: supplicant: unhandled wpas-event: IFNAME=p2p-wlp2s0-0 <5>Failed to initialize driver interface (supplicant_event() in /home/mate/Downloads/miraclecast-master/src/wifi/wifid-supplicant.c:1483)
TRACE: wpa: raw message: <3>P2P-GROUP-FORMATION-FAILURE 
DEBUG: supplicant: peer Mebox connection failed (supplicant_event_p2p_group_formation_failure() in /home/mate/Downloads/miraclecast-master/src/wifi/wifid-supplicant.c:1305)
[FAIL] Peer: 92:d8:f3:bf:f5:89@3 Reason: unknown

@derekdai
Copy link
Contributor

derekdai commented Oct 12, 2016

Here is another way to transmit your screen and audio from miracle-wifictl side to miracle-sinkctl side.

After P2P groupt established (both peers have its own IP), runs gstplayer in sink side

$ gstplayer -d 3 -a -p 1991 -r 720x480

And run gst-launch to send out screen and audio of your desktop

GST_DEBUG=3 gst-launch-1.0 ximagesrc use-damage=false \
    ! videoscale method=nearest-neighbour \
    ! "video/x-raw, width=720, height=480, framerate=30/1" \
    ! videoconvert \
    ! "video/x-raw, width=720, height=480, framerate=30/1, format=NV12" \
    ! vaapiencode_h264 \
    ! mpegtsmux name=muxer \
    ! rtpmp2tpay \
    ! udpsink host=192.168.50.100 port=1991 \
      pulsesrc device="alsa_output.pci-0000_00_1b.0.analog-stereo.monitor" \
    ! audioconvert \
    ! avenc_aac compliance=experimental \
    ! muxer.

You have to replace the IP address, port and device name to make it work. If for some reason your gstreamer1.0-vaapi doesn't work, replace vaapiencode_h264 with x264enc.

The device name of pulsesrc can check with command pacmd list-sinks.

The time skew of pipeline above between peers is kind of high, can anyone help me reduce it? Thanks!

derekdai added a commit to derekdai/miraclecast that referenced this issue Apr 3, 2017
complete migrate from cmake to meson

some minor identation tweaks

remove headers from source list

replace add_global_arguments() with add_project_arguments()

fix issues TingPing suggests

# This is a combination of 5 commits.
# This is the 1st commit message:
mirage from cmake to meson

# This is the commit message #2:

complete migrate from cmake to meson

# This is the commit message albfan#3:

some minor identation tweaks

# This is the commit message albfan#4:

remove headers from source list

# This is the commit message albfan#5:

replace add_global_arguments() with add_project_arguments()
@albfan
Copy link
Owner Author

albfan commented May 20, 2017

@derekdai I added your fork as a remote and start to review your changes. I think wip/source-impl is not valid anymore right?

@derekdai
Copy link
Contributor

@albfan you are right.

I moved files in demo/ to res/ as you requested, Extracted encoder from miracle-dispd to res/gstencoder, some stability enhancement, etc.

@albfan
Copy link
Owner Author

albfan commented May 23, 2017

Ok, I can deal with that changes from your repo. No problem

dzink added a commit to dzink/miraclecast that referenced this issue Sep 5, 2021
Prevent issue duplication and manage user expectations by indicating up front that source is not yet implemented (see issue albfan#4).
albfan pushed a commit that referenced this issue Sep 6, 2021
Prevent issue duplication and manage user expectations by indicating up front that source is not yet implemented (see issue #4).
mcp292 added a commit to mcp292/miraclecast that referenced this issue Nov 17, 2021
albfan pushed a commit that referenced this issue Nov 18, 2021
@albfan albfan linked a pull request Nov 1, 2022 that will close this issue
@albfan
Copy link
Owner Author

albfan commented Nov 14, 2022

right now run as source work until the dhcp communication. So next step is to disable (maybe add a debug parameter) timeout on connect and open manually a miracle-dhcp server and client and use created interface to reach the connected signal.

After that, same rstp as gnome-network-displays can be used to share screen

@OliveiraICTS
Copy link

OliveiraICTS commented Feb 20, 2023

Hi Albfan,

I´m here again rsrs..

I´d like firt to thanks and glad you for making miraclecast work as WFD_Sink and mirroring WFD_Source as Windows 11 and many other new devices.

Now I´m trying the inverse. We developed a Windows-App with works as WFD_Sink. Windows 11 already have it featore, but, our application will accept as Source Device ( Miracast and AirPlay) - Our AirPlay development was based on RPiPlay with the contribuitters mada successfull reverse engineering because it uses many proproetary plists, keys exchanging and sends video streammers encrypted.

Well. I was trying to use miraclecast as WFD_Source. It can find our miracast WFD_Sink running and also Windows WFD_Sink running, but, when I tried to connect it looks like connecting, bot nothing happens on other side.[[

IMPORTANT:- I Didnt ran the long command you said for player. but, I Think RTSP exchannges should starts. Is it right?

@albfan
Copy link
Owner Author

albfan commented Feb 22, 2023

@OliveiraICTS by now the only option is to use the PR where there's a vala implementation. But I think it only will work on x11 server.

@OliveiraICTS
Copy link

Thanks!!!

@Tsjippy
Copy link

Tsjippy commented Feb 25, 2023

So if I read this correctly I cannot use this to connect my RPI4 to a wireless display. Correct?

@luochen1990
Copy link

I got the following error after found peers and try to connect:

[miraclectl] # connect 50:e0:85:76:5f:f8@3
[miraclectl] # list
LINK INTERFACE                FRIENDLY-NAME                  MANAGED
3 wlp4s0                   <unknown>                      yes

LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED
3 52:e0:85:76:5f:f7@3      lc-lap-x1                      no
3 50:e0:85:76:5f:f8@3      lc-lap-x1                      no

2 peers and 1 links listed.
[miraclectl] # list
LINK INTERFACE                FRIENDLY-NAME                  MANAGED
3 wlp4s0                   <unknown>                      yes

LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED
3 52:e0:85:76:5f:f7@3      lc-lap-x1                      no
3 50:e0:85:76:5f:f8@3      lc-lap-x1                      no

2 peers and 1 links listed.
[FAIL] Peer: 50:e0:85:76:5f:f8@3 Reason: group owner negotiation failed
[REMOVE] Peer: 50:e0:85:76:5f:f8@3

@albfan
Copy link
Owner Author

albfan commented Jun 23, 2023

Our miracle-dhcp fails being GO and serving IPs. We need to force that or fix the miracle-dhcp implementation

@OliveiraICTS
Copy link

Albfran - I´m available to help you to fix it problem. Just let me know Okay?

@albfan
Copy link
Owner Author

albfan commented Jun 28, 2023

I thanks a test for miracle-dhcp should be enough.

It is able to negotiate ips when is not GO but fails to do it when it is.

I try to find any basic implementation to compare, but didn't find It.

Force no GO is the easy fix (there's config on WiFi Direct for that)

Find a dhcp implementation with test to verify miracle-dhcp is the hard/right way

@OliveiraICTS
Copy link

I´ll test and report it for you

@ThaDaVos
Copy link

Any progress on the above? Or any better place to follow the progression?

@OliveiraICTS
Copy link

I also got the same fail [FAIL] Peer: xx:xx:xx:xx:xx:xx@3 Reason: group owner negotiation failed

@OliveiraICTS
Copy link

In My experience, normally the WFD Sink is set to be group owner, but, in some cases the WFD Source can be. The Group Owner act as DHCP Server sending an Ip Address to other side to connect on port RTSP(7236) used for control. rsrsrsr

@ThaDaVos
Copy link

@OliveiraICTS did my message accidentally wake you up? 😂

@ThaDaVos
Copy link

I am still looking for a way to cast from Ubuntu and found this:
https://gitlab.com/ubports/development/core/aethercast

Maybe something to look into?

@albfan
Copy link
Owner Author

albfan commented Sep 3, 2023

aethercast relays on networkmanager to create the wifi direct connection. Same as #114 covers. Until d-bus is implemented fix miracle-dhcp is needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.