Error trying to run SITL in cygwin on windows 10

Hi,
I followed the documentation directions to install cygwin, mavproxy on a windows 10 desktop.
In a Cygwin terminal, when I try to un the instruction to launch SITIL+MavProxy : “…/Tools/autotest/sim_vehicle.py --map --console”, it returns the following error:

Hugues@DESKTOP-E4MV4JE /home/ardupilot
$ ./Tools/autotest/sim_vehicle.py --map --console
Traceback (most recent call last):
File “./Tools/autotest/sim_vehicle.py”, line 31, in
from pysim import util
File “/home/ardupilot/Tools/autotest/pysim/util.py”, line 16, in
import pexpect
ModuleNotFoundError: No module named ‘pexpect’

It is a fresh new install of SITIL/MavProxy , so I do not know what’s wrong. Are the instructions in the wiki outdated maybe ?

thanks for any help

probably cygwin that broke something again.
try install pexpect as mentionned in the error log.

I would advise to use WSL on windows10, it is much better than cygwin and we will stop cygwin support in near future

2 Likes

I uninstalled Mavproxy and cygwin. I’m going to try the other method via WSL and see if it works any better

Well that was short lived too. The WSL instructions do not work a the step to download ubuntu from Microsoft store. See picture

I installed SITIL a couple of years ago and I do not remember it to be so difficult and more than anything not working.
Why isn’t there a prebuild windows binary that you can just download and execute to install SITIL with all required dependencies on Windows ?

You can use Mission Planner to run a basic instance of SITL with the latest stable or dev versions.

If you want to do anything more complex than Mission Planner offers, you must install a build environment.

EDIT: I should caveat that the MP instance will allow MAVProxy to connect on port 5761, so you can do quite a bit with it.

As for WSL, once you’ve enabled the WSL component per the instructions, reboot and type wsl --install at a command prompt.

Thanks for trying to solve my issue here.

Ok, I’m trying the Ubuntu installation via command line instead of going though Microsoft store.
The correct command is the following apparently : wsl --install -d Ubuntu

Can this command be added in the Ardupilot/SITIL/Installation instructions for Windows ? and remove the installation instruction advising to go through the Microsoft store

I’ll continue to post here my SITIL/Mavproxy installation progress…to be continued

So before launching the Ubuntu installation in WSL (in a windows cmd window: wsl --install -d Ubuntu),
you need the following pre-requisites (they should be added in the Ardupilot wiki explaining how to install SITIL/MavProxy in Windows 10):

1-In the BIOS of your computer, you must first activate virtualization technology. It is usually found in your BIOS “advanced CPU” menu.

2-Then you reboot the machine and you must now activate the virtualization feature in Windows 10. To do this, the simplest is to right-click on the windows powershell icon/menu to start it with “run as administrator” rights. This will open a powershell with elevated admin rights.
Then copy this command to enabel virtualization in windows 10:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Then reboot your machine.

3-Open a cmd window

4-Launch the installation of Ubuntu , by choosing one of the two following commands, depending if you want a WSL1 or WSL2 underlaying linux virtualization. WSL2 is faster than WSL1.

wsl --set-version Ubuntu 1
wsl --set-version Ubuntu 2

5-Install Ubuntu in WSL:

wsl --install -d Ubuntu

1 Like

You also have in windows 10 to install a LInux package upgrade whic is required for virtualization. Download the MSI installer here :

https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

Very useful information. You could edit it yourself and send a pull request: https://github.com/ArduPilot/ardupilot_wiki/blob/master/dev/source/docs/building-setup-windows10.rst

I have edited the page in github and submitted the change.

1 Like

Now I try to run FlightGear in the Ubuntu WSL (after installing it as described on page Setting up SITL on Linux — Dev documentation), with the command :
/ardupilot/Tools/autotest/ : fg_plane_view.sh (Plane) and fg_quad_view.sh (Copter).

FlightGear splash screen is displayed for a while and then I get a segmentation fault. The last lines of the log during FlightGear startup are these lines:
1.43 [INFO]:view Splash screen progress creating-subsystems
1.44 [INFO]:general Creating Subsystems
1.44 [INFO]:general ======== ==========
1.44 [INFO]:input Reading materials from /usr/share/games/flightgear/Materials/regions/materials.xml
1.83 [WARN]:general adding subsystem to group with name ‘terrainsampler’, but name() returns ‘TerrainSampler’
1.83 [WARN]:general adding subsystem to group with name ‘environment’, but name() returns ‘FGEnvironmentMgr’
1.83 [INFO]:systems Reading systems from Path “/usr/share/games/flightgear/Aircraft/Generic/generic-systems.xml”
1.83 [WARN]:general adding subsystem to group with name ‘systems’, but name() returns ‘FGSystemMgr’
1.83 [WARN]:general adding subsystem to group with name ‘instrumentation’, but name() returns ‘FGInstrumentMgr’
1.83 [INFO]:cockpit Initializing HUD Instrument
1.83 [WARN]:general adding subsystem to group with name ‘cockpit-displays’, but name() returns ‘CockpitDisplayManager’
1.83 [WARN]:general adding subsystem to group with name ‘xml-autopilot’, but name() returns ‘FGXMLAutopilotGroup’
1.83 [WARN]:general adding subsystem to group with name ‘xml-proprules’, but name() returns ‘FGXMLAutopilotGroup’
1.83 [WARN]:general adding subsystem to group with name ‘input’, but name() returns ‘FGInput’
1.83 [WARN]:general adding subsystem to group with name ‘events’, but name() returns ‘EventMgr’
1.83 [INFO]:sound Reading sound sound from Path “/usr/share/games/flightgear/Aircraft/Generic/generic-sound.xml”
1.83 [INFO]:general Creating subsystems took:404
1.83 [INFO]:view Splash screen progress binding-subsystems
2.12 [ALRT]:nasal Volcanic activity off.
4.42 [ALRT]:nasal setWeight() - not supported for external
Segmentation fault

Any idea if FlightGear works on Ubuntu in WSL ? Or does it only work on a native Ubuntu machine ?

Running MavProxy+SITIL, I get once in a while this error in the command window:
HugSITIL:STABILIZE>
(mavproxy.py:1678): dbind-WARNING **: 15:51:52.721: Couldn’t connect to accessibility bus: Failed to connect to socket /tmp/dbus-87EUTEIiat: Connection refused

Any idea what that this error mean in MAvProxy/Sitil?

I have added a solution to