[General Topics] AlainCh2:
Wow, interesting!

Would I've been in my glorious years my brain would have helped a, lot.

Now I'll try to do my best.

Differences in our network management:

Cell side

>All my cell's IP are static by router

>All my cell have USB Debugging enabled

>All my cell have Wireless enabled :: Unless the phone disable it

LAN side

>My LAN is always on > All home is covered but 2mt of south balcony

>I lose Wireless When I leave Home :: When I go on South Balcony

__________________________________

My full script is quite simple and contain REM'd the debug instructions

::@echo on
@echo off
powershell -window hidden -command ""

:: Poco F3 - PF3s - M2012K11AG
:: --serial a7ff2388
:: --serial 10.0.1.103:38277 37751 39685 37293

cd /d "D:\D_\ScrCpy - ScreenCopy\"
:Top

::Start "trying a go on USB - WIRED"
scrcpy.exe --window-x 1500 --window-y 45 -s a7ff2388

:: Check if the wire is connected
:: if the exit code is >= 1, no phone on wire

if errorlevel 1 TimeOut /t 4 /nobreak
::Goto Top

::Go wireless instead
:Wireless
ADB connect 10.0.1.103:37293
scrcpy.exe --window-x 1500 --window-y 45 -s 10.0.1.103:37293
::::: I Must use as -SERIAL the IP and not the ADB serial "a7ff2388" >no reason given
::Exit
::Pause
::Back on Wire

Goto Top

Let's see what I've got so far:

#Port number

the number change every time :: IP Reconnect :: Wifi Reconnect :: no other reason

From you I get that ...

We can in some way divine the port number

With netstat / ipconfig using the fixed cell Ip

But so far it seems No cells are connected to the LAN

103 = PocoF3

109 = P9 Lite

110 = HonorW10

105 = N5T

065 = T365

for sure I'm doing something wrong using this command: "netstat -ano -p tcp"

View attachment 5675307

I checked as well "netstat -ano -q"

For sure PF3s is now connected on USB to the PC, but also sure it should appear on LAN as well

The router see all of them

View attachment 5675299

When I come back home, it seems that the cell have not reset the Wireless debugging

View attachment 5675321

but that's not true !!!

View attachment 5675323

When I enable it, it will assign a new port...

... will it announce on the network as "port OPEN xyyyzxx"

... or it will be used just LISTENING to check the connect request??

BTW : I never used the pairing method you use.

While I know that you can look at all the TCP connections related to your IP

I have a big doubt that W10 would see the full Lan IP_Ports from its own interface.

...

..... digging down on that.

.... Mumble ... mumble .. mumble...

YEEEESSSSSS!!!

My brain became sluggish but it still work - in a way

Netstat and IPConfig works only from inside to any outward connection/adapter,

and they cannot go looking out.

You have to use a different command "PORTQRY" to be downloaded from Microsoft itself:

"To view the TCP/UDP open port state of a remote host, type “portqry.exe –n [hostname/IP]” where [hostname/IP] is replaced with the hostname or IP address of the remote host. You can also specify to scan for a particular port using the “-e [port_number]” parameter, a particular range of ports using the “-r [start_range:end_range]” parameter, or a group of ports in a particular order using the “-o [port1, port2, port3]” parameter."

View attachment 5675367

Last thing to do:

Learn how to use "portqry.exe"

🙃

____________________________________________

Here we go from my observations:

Assuming the random port being in the range 30k-44k, I need to check who's listening.

I get the identification string response > using the known port I checked in Android's PF3s settings.

But the process takes several minutes up to half an hour...

NP this is the first screenshot... just in case you read it before I'm back online.

#@#!!!!!

ok, it took 12 minutes to check 138 ports !!!

I tested that on a shorter range_

View attachment 5675439

Seems I cannot delimit correctly the FINDSTR "xxxxxxxxxx"

It's a good night for me !!!

<2022-08-02 01:23:41>this post took 3hours 11minutes 33seconds - using a very large amount of my BRAIN<

:-D