scrcpy ERROR: Server connection failed
by shams from LinuxQuestions.org on (#6CZD3)
I installed the scrcpy in arch linux to cast my poco mobile with my laptop, i enabled the wireless debugging and connected the mobile with laptop with adb wirelessly:
Code:# adb devices -l
List of devices attached
192.168.10.3:37839 device product:vayu_global model:M2102J20SG device:vayu transport_id:1Now when i run the scrcpy this is the error:
Code:# scrcpy -V verbose -s 192.168.10.3:37839
scrcpy 2.1 <https://github.com/Genymobile/scrcpy>
DEBUG: ADB device found:
DEBUG: --> (tcpip) 192.168.10.3:37839 device M2102J20SG
DEBUG: Device serial: 192.168.10.3:37839
DEBUG: Using server: /usr/share/scrcpy/scrcpy-server
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 168.0 MB/s (56955 bytes in 0.000s)
[server] INFO: Device: [Xiaomi] POCO M2102J20SG (Android 13)
[server] DEBUG: Using video encoder: 'OMX.qcom.video.encoder.avc'
[server] DEBUG: Using audio encoder: 'c2.android.opus.encoder'
[server] DEBUG: Controller stopped
[server] DEBUG: Device message sender stopped
[server] DEBUG: Audio encoder stopped
[server] DEBUG: Screen streaming stopped
DEBUG: Interrupting socket
DEBUG: Server disconnected
DEBUG: Server terminated
ERROR: Server connection failedI use iptables as my firewall and i open the ports in iptables for my need, i run this command to open the port 37839:
Code:# iptables -I INPUT -p tcp -m tcp --dport 37839 -j ACCEPTThe result of the above command is:
Code:# iptables -vnL | grep 37839
1 44 ACCEPT 6 -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:37839but i cannot telnet the this port:
Code:# telnet localhost 37839
Trying 127.0.0.1...
Connection failed: Connection refused
Trying ::...
telnet: Unable to connect to remote host: Connection refusedAlso nmap shows the port closed:
Code:# nmap localhost -p 37839
Starting Nmap 7.94 ( https://nmap.org ) at 2023-07-14 16:33 PKT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000067s latency).
Other addresses for localhost (not scanned): ::
PORT STATE SERVICE
37839/tcp closed unknown
Nmap done: 1 IP address (1 host up) scanned in 0.10 secondsPlease help , where is the problem it is with the iptables to open the port 37839 or other things and why iptables cannot open the port 37839 with above command?
Code:# adb devices -l
List of devices attached
192.168.10.3:37839 device product:vayu_global model:M2102J20SG device:vayu transport_id:1Now when i run the scrcpy this is the error:
Code:# scrcpy -V verbose -s 192.168.10.3:37839
scrcpy 2.1 <https://github.com/Genymobile/scrcpy>
DEBUG: ADB device found:
DEBUG: --> (tcpip) 192.168.10.3:37839 device M2102J20SG
DEBUG: Device serial: 192.168.10.3:37839
DEBUG: Using server: /usr/share/scrcpy/scrcpy-server
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 168.0 MB/s (56955 bytes in 0.000s)
[server] INFO: Device: [Xiaomi] POCO M2102J20SG (Android 13)
[server] DEBUG: Using video encoder: 'OMX.qcom.video.encoder.avc'
[server] DEBUG: Using audio encoder: 'c2.android.opus.encoder'
[server] DEBUG: Controller stopped
[server] DEBUG: Device message sender stopped
[server] DEBUG: Audio encoder stopped
[server] DEBUG: Screen streaming stopped
DEBUG: Interrupting socket
DEBUG: Server disconnected
DEBUG: Server terminated
ERROR: Server connection failedI use iptables as my firewall and i open the ports in iptables for my need, i run this command to open the port 37839:
Code:# iptables -I INPUT -p tcp -m tcp --dport 37839 -j ACCEPTThe result of the above command is:
Code:# iptables -vnL | grep 37839
1 44 ACCEPT 6 -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:37839but i cannot telnet the this port:
Code:# telnet localhost 37839
Trying 127.0.0.1...
Connection failed: Connection refused
Trying ::...
telnet: Unable to connect to remote host: Connection refusedAlso nmap shows the port closed:
Code:# nmap localhost -p 37839
Starting Nmap 7.94 ( https://nmap.org ) at 2023-07-14 16:33 PKT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000067s latency).
Other addresses for localhost (not scanned): ::
PORT STATE SERVICE
37839/tcp closed unknown
Nmap done: 1 IP address (1 host up) scanned in 0.10 secondsPlease help , where is the problem it is with the iptables to open the port 37839 or other things and why iptables cannot open the port 37839 with above command?