Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
108.8k stars 10.47k forks source link

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060) #3694

Open scrcpytime opened 1 year ago

scrcpytime commented 1 year ago

Environment

Describe the bug I have connected wirelessly before with this device and PC... probably like 1 year ago. Today I tried again and I could not connect it wireless no matter what I do. I tried to go back to version 1.20, didn't work, that's why I went to 1.25. I read all the posts on github and none gave solutions to my problem. I can connect by usb cable fine. Just when I go do the usually adb tcpip 5555, and then adb connect with the ip address, it gives the 10600 issue. I tried uninstalling the device drivers in device manager and let it download again. I tried revoking the permissions on the device in the usb debugging section in the developers option. I tried changing the usb transfer options to no avail. I tried pinging the device from the PC, but it fails and say host unreachable, maybe that the problem? I tried restarting the device and the PC. I tried toggling the wifi on/off on the device. I tried switching usb cables.

So yea, any advice to get this to work would be awesome... cheers!

rom1v commented 1 year ago

I don't really use Windows, but I have the same problem on my Windows 10 virtual machine (it worked some timed ago, and I changed nothing). If you find a solution (other than using another OS), please let me know :wink:

scrcpytime commented 1 year ago

just weird, as you said aswell, it worked awhile ago. Windows updates or security I guess? I disabled the firewall just to be sure to no avail too...

scrcpytime commented 1 year ago

I also tried to connect my phone to no avail, but usb worked as usual. so that ruled out my device

eeriemyxi commented 1 year ago

Yesterday I also faced this issue on my Android 11, it can mostly happen because of either wrong IP address or the OS is trying to make it significantly harder to connect. Click here for some steps which could help with the second problem. Sometimes the solution is also to simply change the USB connection mode.

For me personally, it was because I was using the wrong IP address, I was trying to connect using 192.168.1.10 IP which is the default local IP address that is used mostly by many devices; but mine didn't. Try going to the about section of your settings, open the "status" information from there (it can vary from OS to OS depending on the UI), then you should see the IP address used locally by your phone. I am not an expert on using right the terminologies in this area so it may not actually be the local IP address but it may (as it did for me) work for your use case.

If the IP address from there also does not work, install some terminal emulator, execute "ifconfig" and try all the IP addresses from there (chances for 127.0.0.1 are quite less though). Another IP address that works for me is 192.168.38.7; I got this one from there.

Lastly, simply try using a different port. Perhaps something is doing something with the 5555 port.

scrcpytime commented 1 year ago

Thanks for the reply @eeriemyxi

Wells, I think its either windows 10 or my router, which has changed since I move places. honestly at this moment its a 50/50 on whos fault it lies. The progress and testing I have made so far. So I thought it was my desktop, so I tried with my laptop. The funny thing is it works and connects fine with my Poco F3, wirelessly I must add. but then I went to try connect my mi pad 5 pro and make that go wireless, it won't...

Then I digged around google and youtube and on this site... I cant ping my devices or my laptop. Which some say its the router has disabled such feature. I cannot change my settings since the ISP provider has soft blocked changes on my router... But then I don't know how my F3 made a wireless connection on the laptop, but not my desktop. Lol

Happy hunting ladies and gents!

scrcpytime commented 1 year ago

I might add that I also changed the inbound rules to allow pinging in the firewall, so to not need to disable the firewall as a whole, but that still doesn't work....

scrcpytime commented 1 year ago

maybe its the wireless debugging in android??? just giving ideas to the devs

rom1v commented 1 year ago

Wells, I think its either windows 10 or my router

Try on Linux (take a Ubuntu live cd for example). If it works, it was Windows 10, otherwise it might be your router.

eeriemyxi commented 1 year ago

I have installed the latest updates of Windows 10 but it still works on my machine. You might also want to try Windows 10 Safe Mode while you download the ISO for some well known Linux distribution with Live CD mode available.

But before all this, turn on WIFI hotspot on your unsuccessful phone, connect your PC to it and see if it works. I personally use portable hotspot feature to access the Internet so I have no problems doing this. I will also add that I have Wireless Debugging in developer options off. If it works via your MI's hotspot, you may connect the router on you MI then turn on hotspot to access internet of your router on your PC while mirroring wirelessly (I can do that on my phone, which is using Color OS + Android 11).

eeriemyxi commented 1 year ago

I will also add that this really isn't an issue with SCRCPY but ADB itself; there's nothing to hunt for in this codebase. This to really be an issue with ADB of course stipulates that both your devices are functioning properly and you are not missing out something obvious somewhere. This is a very hard-to-debug "bug".

ApolloGods commented 1 year ago

i`ve installed Win 11 & Android 13 /API 33 - Win11 every fine (wrote a script.bat to bind and open scrcpy) **.bat Android App scrcpy also fine ;-) but in Termux (installed termux sdl & x11-repo) it starting process but ends up in

~ $ scrcpy -s 192.168.1.100:5555 scrcpy 1.25 https://github.com/Genymobile/scrcpy DEBUG: ADB device found: DEBUG: --> (tcpip) 192.168.1.100:5555 device SM_G986B DEBUG: (tcpip) emulator-5554 device SM_G986B DEBUG: Device serial: 192.168.1.100:5555 DEBUG: Using server: /data/data/com.termux/files/usr/share/scrcpy/scrcpy-server /data/data/com.termux/files/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 49.3 MB/s (42151 bytes in 0.001s) [server] INFO: Device: samsung SM-G986B (Android 13) DEBUG: Server connected DEBUG: Starting controller thread DEBUG: Starting receiver thread [server] DEBUG: Using encoder: 'OMX.Exynos.AVC.Encoder' INFO: Renderer: opengl INFO: OpenGL version: 4.5 (Compatibility Profile) Mesa 22.3.3 INFO: Trilinear filtering enabled DEBUG: Using icon: /data/data/com.termux/files/usr/share/icons/hicolor/256x256/apps/scrcpy.png INFO: Initial texture: 1080x2400 DEBUG: Starting demuxer thread

and no screen - had i do to add options like ffplay?

in App Bugjaeger scrcpy goes to Camview (very useful) - also record is possible

i didn´t get it running by myself in manual mode - maybe to do it with tasker

thx for help

**.bat @Echo Off cd C:/PATH/to/platform-tools/(Android Studio or platform-tools only for itself / Android -> https://github.com/rendiix/termux-adb-fastboot echo startup adb-server adb kill-server adb start-server adb devices adb connect HOST:PORT (192.168.1.1:5555) timeout 5 scrcpy -s HOST:PORT

scrcpytime commented 1 year ago

But before all this, turn on WIFI hotspot on your unsuccessful phone, connect your PC to it and see if it works. I personally use portable hotspot feature to access the Internet so I have no problems doing this.

so you mean turn on the wifi hotspot on my PC and connect my phone? I dont have that on my desktop since its ethernet connected... but my laptop does... but I really want to connect on my desktop....

so basing on @ApolloGods ... it works on all windows... so maybe we can agree it is adb...

eeriemyxi commented 1 year ago

But before all this, turn on WIFI hotspot on your unsuccessful phone, connect your PC to it and see if it works. I personally use portable hotspot feature to access the Internet so I have no problems doing this.

so you mean turn on the wifi hotspot on my PC and connect my phone? I dont have that on my desktop since its ethernet connected... but my laptop does... but I really want to connect on my desktop....

so basing on @ApolloGods ... it works on all windows... so maybe we can agree it is adb...

Before resolving an issue, you first need to know what really is causing the issue; suspects are too many, it could be your router, it could be your configurations of your Windows OS, it could be your Mi (they're known for doing questionable things to optimize their OS), it could be drivers, the list just keeps going on.

You might "want" to use your desktop for it, but we are not providing repairing services for your "desktop" here, so to increase the probabilities that it probably has to do something with either the router or the desktop, turn on hotspot on your Mi, downlaod the latest release on your laptop, connect it to your Mi's wifi hotspot, do "ifconfig" on the Mi using Termux, try all the IP addresses after starting the TCP server, if it still does not work, there are more chances that it has something to do with either Windows or the Mi.

eeriemyxi commented 1 year ago

i`ve installed Win 11 & Android 13 /API 33 - Win11 every fine (wrote a script.bat to bind and open scrcpy) **.bat Android App scrcpy also fine ;-) but in Termux (installed termux sdl & x11-repo) it starting process but ends up in

~ $ scrcpy -s 192.168.1.100:5555 scrcpy 1.25 https://github.com/Genymobile/scrcpy DEBUG: ADB device found: DEBUG: --> (tcpip) 192.168.1.100:5555 device SM_G986B DEBUG: (tcpip) emulator-5554 device SM_G986B DEBUG: Device serial: 192.168.1.100:5555 DEBUG: Using server: /data/data/com.termux/files/usr/share/scrcpy/scrcpy-server /data/data/com.termux/files/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 49.3 MB/s (42151 bytes in 0.001s) [server] INFO: Device: samsung SM-G986B (Android 13) DEBUG: Server connected DEBUG: Starting controller thread DEBUG: Starting receiver thread [server] DEBUG: Using encoder: 'OMX.Exynos.AVC.Encoder' INFO: Renderer: opengl INFO: OpenGL version: 4.5 (Compatibility Profile) Mesa 22.3.3 INFO: Trilinear filtering enabled DEBUG: Using icon: /data/data/com.termux/files/usr/share/icons/hicolor/256x256/apps/scrcpy.png INFO: Initial texture: 1080x2400 DEBUG: Starting demuxer thread

and no screen - had i do to add options like ffplay?

in App Bugjaeger scrcpy goes to Camview (very useful) - also record is possible

i didn´t get it running by myself in manual mode - maybe to do it with tasker

thx for help

**.bat @Echo Off cd C:/PATH/to/platformtools/ echo startup adb-server adb kill-server adb start-server adb devices adb connect HOST:PORT (192.168.1.1:5555) timeout 5 scrcpy -s HOST:PORT

Please create a separate issue for this, doesn't really seem like an issue with SCRCPY but try your luck. I think you're trying to transgress the boundaries of limitations of Termux but I don't really know how capable Termux as just a terminal emulator is.

ApolloGods commented 1 year ago

thx for answering - i´ll try to open an issue think your right with termux ..

scrcpytime commented 1 year ago

But before all this, turn on WIFI hotspot on your unsuccessful phone, connect your PC to it and see if it works. I personally use portable hotspot feature to access the Internet so I have no problems doing this.

so you mean turn on the wifi hotspot on my PC and connect my phone? I dont have that on my desktop since its ethernet connected... but my laptop does... but I really want to connect on my desktop.... so basing on @ApolloGods ... it works on all windows... so maybe we can agree it is adb...

Before resolving an issue, you first need to know what really is causing the issue; suspects are too many, it could be your router, it could be your configurations of your Windows OS, it could be your Mi (they're known for doing questionable things to optimize their OS), it could be drivers, the list just keeps going on.

You might "want" to use your desktop for it, but we are not providing repairing services for your "desktop" here, so to increase the probabilities that it probably has to do something with either the router or the desktop, turn on hotspot on your Mi, downlaod the latest release on your laptop, connect it to your Mi's wifi hotspot, do "ifconfig" on the Mi using Termux, try all the IP addresses after starting the TCP server, if it still does not work, there are more chances that it has something to do with either Windows or the Mi.

As said before, my phone works on my laptop, connects by usb and wireless to scrcpy... but I cant reproduce this to my desktop at this very moment. So that maybe rules out the router. And I dont need to open the hotspot for my phone either. I dont even need to type adb tcpip 5555, I just go straight to adb connect.

I will try my tablet with the hotspot method tomorrow. Cheers for helping!

ApolloGods commented 1 year ago

so that i see right your laptop fine (OS same as Desktop? Win10) you wrote device found and connected scrcpy installed same location? (so auth is ok too)

think router is out because ok connection to laptop (both conn. wireless to router?)

seems to be something with win - think you're cable connected on Desktop.. (try wireless stick? ..only for test..) try cable connected (hotspot) method what happend last?

scrcpytime commented 1 year ago

@ApolloGods yea man, just weird. yea, scrcpy on the desktop on both comps... My phone works fine only on laptop, my tablet wont connect wirelessly on both but usb can. so its the ethernet you think? yea, dont have a wireless stick around. Maybe I will try on a 3rd comp to test (also ethernet connected)

scrcpytime commented 1 year ago

just tested on 3rd comp, usb works and wireless doesn't. so I think its the router and/or ethernet. sad fact is I cannot get into super admin into my ISP provided router to try change the firewall settings there...

eeriemyxi commented 1 year ago

just tested on 3rd comp, usb works and wireless doesn't. so I think its the router, its blocking ping to the device. sad fact is I cannot get into super admin into my ISP provided router...

If it cannnot connect wirelessly on three devices, there's a pretty good chance that the Mi device itself is malfunctioning, it shouldn't be the router as it did its job when you were trying using your Poco. Are you sure you did the steps I linked to connect to those hard-to-get/shy devices?

If you did, here's my last try,

If even that doesn't work, stay away from Mi mobile devices henceforth.

scrcpytime commented 1 year ago

my phone works wirelessly only on laptop... lol thats all

my tablet worked 1 year ago on laptop and desktop, but this week I tried again for fun, it didnt work, hence I want to find a solution.

eeriemyxi commented 1 year ago

my phone works wirelessly only on laptop... lol thats all

my tablet worked 1 year ago on laptop and desktop, but this week I tried again for fun, it didnt work, hence I want to find a solution.

It is not impossible to have both your desktop and that mobile malfunctioning. We already gave you steps to validate whether your desktop is malfunctioning before, but you seem to have ignored them, for fun.

I am signing off this issue, I have no other step to suggest.

And ever since the start of this thread, you are each time blaming your ethernet, even when I gave you the steps to do it without using your router. So for the sake of a cozy life, get a better connection.

scrcpytime commented 1 year ago

cheers for you input.

And the hotspot method didnt work. the IPs found didnt work. I tried different port number, didnt work. thanks anyways.

For linux method, don't have the skills to do that, completely lost for that OS.

and I will try to get a better connection, not everyone is as fortunate as you sir

eeriemyxi commented 1 year ago

For linux method, don't have the skills to do that, completely lost for that OS.

Do it only if you want to otherwise ignore this message.

Tarunhalder4 commented 1 year ago

fast check your mobile and PC in same Wifi network or not. for establish Cannection need same wifi network your mobile and you PC.

aitech1234 commented 1 month ago

solution ::: its because the ip address has changed in your android ,