Announcement

Collapse
No announcement yet.

Scrcpy

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Scrcpy

    I wanted to ask in the scrcpy thread, but it's closed :-/
    So... how did you guys get scrcpy to work?
    No matter what I do, I end up with unable to connect to 192.168.0.42:5555: Connection refused

    I followed the instructions on dozens of web pages on the subject, and it won't go away.
    I can ping 192.168.0.42 (the phone - if the screen is unlocked). Adb refuses to connect. I did get a notification on the phone to allow the connection on one of the first tries, confirmed, set it as trusted host, which is probably why I don't get it anymore. I tried sudo. I can't do it.

    How did GG manage it, I wonder :-)

    #2
    The instructions from https://github.com/Genymobile/scrcpy/#connection worked for me

    did you enable adb via tcpip?
    Enable adb over TCP/IP on your device: adb tcpip 5555.
    then
    Connect to your device: adb connect DEVICE_IP:5555 (replace DEVICE_IP).
    then run scrcpy?

    Comment


      #3
      I did just that. And I can ping it.
      Connection refused :-/

      Comment


        #4
        Code:
        08:50 not@all:~$ sudo adb tcpip 5555
        error: no devices/emulators found
        08:50 not@all:~$ adb connect 192.168.0.42:5555
        unable to connect to 192.168.0.42:5555: Connection refused
        08:50 not@all:~$ ping 192.168.0.42
        PING 192.168.0.42 (192.168.0.42) 56(84) bytes of data.
        64 bytes from 192.168.0.42: icmp_seq=1 ttl=64 time=193 ms
        08:50 not@all:~$ sudo adb connect 192.168.0.42:5555
        unable to connect to 192.168.0.42:5555: Connection refused

        Comment


          #5
          you don't need to run adb with sudo. It is probably not effecting this, though I am not 100% sure.

          Also , does scrcpy work over USB just fine?


          Code:
          08:50 not@all:~$ sudo adb tcpip 5555
          error: no devices/emulators found
          This command tells the phone to enable ADB commands over the network (wifi)

          Your phone is connected via USB for this part, correct?
          Not sure if this needs to be done each time or not. ---checking......this needs to be done just the once, with the phone connected via USB

          The full page, if followed from the very beginning, you would have your phone connected via USB. When you get to the wifi section, it does not mention this, until it tells you to disconnect the cable after running adb tcpip 5555

          This caught me out when I installed and set up scrcpy up for this thread, I blame my old backup glasses.



          if you get similar "not found" messages over USB, run adb devices to see if your phone is detected.


          Pinging and actually connecting are two different things, "Connection refused" is accurate, it won't let scrcpy in (without enabling ADB over tcp). Ping does not need to be let in, just responded to.

          Comment


            #6
            Did you turn on port forwarding for kdeconnect from ports 1714 to 1764?
            "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
            – John F. Kennedy, February 26, 1962.

            Comment


              #7
              Yes, I did that the first time. I even got an authorisation prompt on the phone.
              Now - the phone says USB debugging on - "no devices/emulators found".
              The sudo part, some pages suggested it. The ping part, also.

              I tried adb kill-server. No luck.

              Code:
              05:48 not@all:~$
              05:49 not@all:~$ adb tcpip 5555
              * daemon not running; starting now at tcp:5037
              * daemon started successfully
              error: no devices/emulators found
              Let's try rebooting the phone... debugging still on...
              Same. I wonder though. I tell it adb tcpip 5555. It tells me starting now at tcp:5037 Click image for larger version

Name:	arrabbiato1.gif
Views:	12
Size:	525 Bytes
ID:	645209

              @GG, not sure what kdeconnect has to do with this...

              Comment


                #8
                Are you using the phone as a hotspot for this? I wonder if this is interfering? I wonder if the hotspot is using a different address, or subent, or something.

                Does scrcpy work via USB?


                I quite literally followed the info on the github page, and it Just Worked, but I am using a router to connect the two.


                Ok, trying tio use it while using hotspot does not work, even changing to the ip used by that. My phone is not using the same IP used when hotspot is off.
                adb won't connect to the hotspot IP, it times out for me.

                I dunno.

                Comment


                  #9
                  No, the hotspot is on another phone (Ubuntu touch).
                  It doesn't work via USB, no :-/
                  Code:
                  05:03 not@all:~$ scrcpy
                  INFO: scrcpy 1.12.1 <https://github.com/Genymobile/scrcpy>
                  adb: error: failed to get feature set: no devices/emulators found
                  ERROR: "adb push" returned with value 1

                  Comment


                    #10
                    Odd. I just used scrcpy over wifi (and USB ) on all three of my phones, even my oldest one, 2015 LG G4. That one had a separate option in the developer settings for enabling adb over the network. It seems to be reset after a reboot. Maybe your has a similar option?


                    Click image for larger version

Name:	Screenshot_20210918_142913.jpg
Views:	1
Size:	31.1 KB
ID:	645210

                    But if scrcpy ain't working over USB to begin with, I am not sure what to do. ADB needs to see the phone, so that may be where to start looking.

                    Comment


                      #11
                      I had removed scrcpy, adb and associated software because with usb debugging on my bank software said it won't connect as long as I have usb debugging on, and I do all my banking by my android. I never found anything useful to do with scrcpy that I couldn't do with KDEconnect, which I use mostly to transfer files from my phone to my pc and to occasionaly respond to msgs through my PC to my phone.
                      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                      – John F. Kennedy, February 26, 1962.

                      Comment


                        #12
                        I just toggle USB debugging off/on as needed for the same reason. I use ADB on occasion, such as when I refresh the phone and have to de-bloat all the junkand extra bits that are not removable in the normal manner.
                        Heck on top of that, my old phone is rooted/unlocked and running a custom ROM so it has a more current OS version. I have to jump through a hoop or two so I can use my banking app on that phone.

                        Plus I can cast my screen to my TV over wifi, or via an HDMI adapter. Though I can't share the actual screen, as I get a desktop-like environment when I do this. For screen recording, scrcpy is useful
                        Last edited by claydoh; Sep 18, 2021, 02:03 PM.

                        Comment


                          #13
                          I've tried just turning usb debuggong off but my bank app won't run even with that setting. I have to power cycle the phone after I turn off usb debugging before my bank app will run again. I can still cast from my android to my roku TV without problems.
                          The phone I had prior to this GS10 was an Xiaomi Red Note 7 that was unlocked. I LOVED that phone. I could stop tracking easily.
                          "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                          – John F. Kennedy, February 26, 1962.

                          Comment


                            #14
                            I got it working over USB. I had to set it to PTP instead of the default MTP.
                            It still won't work over network.
                            I don't have that option. In fact, I don't have any options for USB debugging. If I tap it, it just toggles on/off.
                            I still find it funny that
                            Code:
                            adb tcpip [B]5555[/B]
                            * daemon not running; starting now at tcp:[B]5037[/B]
                            It starts on 5037 whatever port I give it.

                            Comment


                              #15
                              Well yes, on your computer it is using 5037.

                              The command used to enable tcp on your phone told that device to use 5555.

                              Sent from my LM-V600 using Tapatalk

                              Comment

                              Working...
                              X