albfan / miraclecast

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

My phone can't find the sink #453

Closed HuntCode closed 1 year ago

HuntCode commented 1 year ago

Hello,

1)I use Ubuntu 20.04 and rtl8192eu(TP-Link TL-WN821N) usb dongle

2)test-viewer.sh and test-hardware-capabilities.sh are passed

3)I want to use my huawei mate 20 casting to linux os

4)my steps :

$ systemctl stop NetworkManager.service
$ systemctl stop wpa_supplicant.service

this step make me can not use WiFi (internet),I don't understand why should I stop the two services

$ sudo miracle-wifid &
$ sudo miracle-sinkctl
[ADD]  Link: 3
[miraclectl] # run 3

those steps seem no problem,I think my phone should find this sink(Ubuntu 20.04),but no sink can be found

now running on link 3
[ADD] Peer: f2:6e:0b:d7:73:96@3
[ADD] Peer: f2:6e:0b:d7:76:96@3
[ADD] Peer: ae:92:32:a4:f2:be@3
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                  MANAGED   
     3 wlx7cb59bbb7bf6          <unknown>                      yes       

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 
     3 f2:6e:0b:d7:73:96@3      Rachel wx                      no        
     3 f2:6e:0b:d7:76:96@3      Rachel wx                      no        
     3 ae:92:32:a4:f2:be@3      HUAWEI Mate 20                 no        

 3 peers and 1 links listed.

logs.zip this is my log files Thanks for your help

HuntCode commented 1 year ago

when miracle-wifid and miracle-sinkctl are running in two terminals,I run sudo miracle-wifictl in the third terminal,then connect ae:92:32:a4:f2:be@3,my mate 20 can show miracle device,but when i click this device,mate 20 shows connection failed

albfan commented 1 year ago

The config for normal wifi is not compatible woth wifi-direct. There's a issue for this #75 but still not completed.

From your logs, looks you never start to share the screen from your phone. You need to find something like screensharing and select the sink (should be "miracle" if you don't change anything)

HuntCode commented 1 year ago

The config for normal wifi is not compatible woth wifi-direct. There's a issue for this #75 but still not completed.

From your logs, looks you never start to share the screen from your phone. You need to find something like screensharing and select the sink (should be "miracle" if you don't change anything)

xxx I use the Wireless Projection on my phone,when I open it,the miracle-sinkctl will show "add peer" like

[ADD] Link: 3
[miraclectl] # run 3
now running on link 3
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                  MANAGED   
     3 wlx7cb59bbb7bf6          <unknown>                      yes       

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 

 0 peers and 1 links listed.
[ADD] Peer: ae:92:32:a4:f2:be@3
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                  MANAGED   
     3 wlx7cb59bbb7bf6          <unknown>                      yes       

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 
     3 ae:92:32:a4:f2:be@3      HUAWEI Mate 20                 no        

 1 peers and 1 links listed.

I think My Mate 20 will show the sink(named miracle) ,but it‘’s always searching 2

HuntCode commented 1 year ago

logs(1).zip this is my new log

albfan commented 1 year ago

logs are the same again. Nothing starts the group negotiation.

It should be just phone finding your laptop available like (I guess you have a huawei mate 20):

https://youtu.be/U-lhrPnsoIk?t=76 (min 1:16)

Captura desde 2022-10-20 08-00-43

Basically you need your phone send a:

TRACE: wpa: raw message: <3>P2P-INVITATION-RECEIVED sa= go_dev_addr= bssid=

But I'm unsure about details on huawei, why it do not detect miraclecast. I just can say I have a huawei p10 time ago and it works perfectly.

if you can collect logs from phone (probably you would need root)

Just try several times, people report somehow finally phone decide to work. Closing from our side (there's no clue for us on why phone do not detect miraclecast)

HuntCode commented 1 year ago

logs are the same again. Nothing starts the group negotiation.

It should be just phone finding your laptop available like (I guess you have a huawei mate 20):

https://youtu.be/U-lhrPnsoIk?t=76 (min 1:16)

Basically you need your phone send a:

TRACE: wpa: raw message: <3>P2P-INVITATION-RECEIVED sa= go_dev_addr= bssid=

But I'm unsure about details on huawei, why it do not detect miraclecast. I just can say I have a huawei p10 time ago and it works perfectly.

if you can collect logs from phone (probably you would need root)

Just try several times, people report somehow finally phone decide to work. Closing from our side (there's no clue for us on why phone do not detect miraclecast)

Thanks for your suggestions

I think the wifi dongle is ok, because I can mirror my phone(mate 20) to miracast of Win10

I don't know why mate 20 can not find the miracle-sinkctl, but in the terminal of miracle-wifid, I run "connect ae:92:32:a4:f2:be@3", then mate 20 show a dialog to accept the connection or not, if I accept, the searching dialog will show a device "Miracle", I run "list", the CONNECTED state is still “no”,like

LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 
     3 ae:92:32:a4:f2:be@3      HUAWEI Mate 20                 no

If I click this "Miracle",I hope it can mirror to Ubuntu20.04,unfortunately it's failed, so I'm confused

I will try to use some other brand phones, maybe it works

albfan commented 1 year ago

you mean miracle-wifictl? that is still not working see #4

As you said, if your phone do not find a target to share the screen you are not starting the sharing so that's why nothing happens

HuntCode commented 1 year ago

you mean miracle-wifictl? that is still not working see #4

Yes,in the terminal of miracle-wifictl, I run "connect ae:92:32:a4:f2:be@3", it should be a wrong usage

Is miracle-wifictl only used as a source?

If I want to mirror my phone to Ubuntu,I should only run miracle-wifid and miracle-sinkctl?

Unfortunately,I try two other phones,Mi 8 and OPPO K1, both can not find sink too

I don't know if the wifi dongle, rtl8192eu(TP-Link TL-WN821N) has some compatible problem, while it works on Windows10

albfan commented 1 year ago

miracle-wifid is a daemon, then miracle-sinkctl is a controller to use your laptop as sink (see other screen device) and miracle-wifictl is a controller to share your laptop screen in another device. Only the Connect part is implemented for miracle-wifictl

If you can capture the windows10 comunications (with wireshark) we can see what is different on those implementations ( what is the miracast server on Windows 10 replying to your phone so It found the sink and launch a connection)

VeiLiang commented 7 months ago

The config for normal wifi is not compatible woth wifi-direct. There's a issue for this #75 but still not completed. From your logs, looks you never start to share the screen from your phone. You need to find something like screensharing and select the sink (should be "miracle" if you don't change anything)

xxx I use the Wireless Projection on my phone,when I open it,the miracle-sinkctl will show "add peer" like

[ADD] Link: 3
[miraclectl] # run 3
now running on link 3
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                  MANAGED   
     3 wlx7cb59bbb7bf6          <unknown>                      yes       

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 

 0 peers and 1 links listed.
[ADD] Peer: ae:92:32:a4:f2:be@3
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                  MANAGED   
     3 wlx7cb59bbb7bf6          <unknown>                      yes       

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 
     3 ae:92:32:a4:f2:be@3      HUAWEI Mate 20                 no        

 1 peers and 1 links listed.

I think My Mate 20 will show the sink(named miracle) ,but it‘’s always searching 2

I got the same phenomenon as you at Xiaomi 10,miraclecast was install at allwinner f133 with openwrt. Also i try miraclecast in Raspberry Pi 3B+,it work fine!

VeiLiang commented 7 months ago

The difference between the two phenomena is that when running Miracle cast on F133, the phone does not find "Miracle" when casting the screen, at the smae time, "P2P-DEVICE-FOUND 3a:80:b6:32:25:c6 p2p_dev_addr=3a:80:b6:32:25:c6 pri_dev_type=10-0050F204-5 name='Mi 10' config_methods=0x188 dev_capab=0x25 group_capab=0x0 new=1" is displayed on F133 console. When running Miracle cast on Raspberry Pi 3B+, the phone found "Miracle" when casting the screen. If I don't click thre devices "Miracle",it was nothing show in Raspberry Pi 3B+ console. After I click "Miracle" , it started showing Add Peer balabala...

albfan commented 7 months ago

I think this is your phone needing something else to accept miraclecast as sink.

I think if you have configs that work you need to compare what is different in each of them:

Huawei Mate 20 + raspberry pi works? Collect logs for support (see FAQ on Wiki) Huawei Mate 20 + allwinner f133 do not work?. Collect logs for support too

Something on journalctl or miracle-wifid logs should show the problem