Problem to connect to WSL SITL using Android device (SOLVED)

As I just set up a new PC (win 11) I decided to try using the recommended WSL method for SITL rather than the cygwin solution that I have running fine on my old PC.

Setup went fine. And I can connect using Mission Planner on the same PC by UDP and by TCP (port 5762 and 5763). All well. But as I develop another app I rather try connecting using a real Android device. So far without any luck. I also tried to connect using UDP and TCP with Mission Planner for Android. Also no luck there.

Does anyone have some advice for how to successfully connect using wifi and TCP from a real device to WSL SITL? I have also opened inbound rules for all networks in firewall for TCP ports 5762 and 5763 and UDP for 14550. Did not make any difference.

If I cannot solve this I will revert to the cygwin solution I think.

Finally found the solution (and that’s great as the cygwin solution is not that easy to set up).

What I needed was to add an UDP output by directing it to the IP address of my Android device. By starting my Rover simulation like this (device IP here 192.168.68.54, then connect from app on device using UDP port 14550):

~/ardupilot/Rover$ …/Tools/autotest/sim_vehicle.py --out=udpout:192.168.68.54:14550 --console --map

To have it run on the Android Studio emulator then use the 10.0.0.2 address. And to have some flexibility to run emulator and real device side-by-side use a separate port like:
–out=udpout:10.0.2.2:13550