SITL Windows/MAVProxy Port 5760 ALREADY IN USE

I am a newbee and not a linux user.  I followed the "Setting up SITL on Windows" using MAVProxy, completing builds for arducopter, arduplane and jsbsim.  When I execute: "sim_vehicle.sh -j4 --map" to run arducopter, the CYGWIN window reports:

"Window access not found, logging to /tmp/ardupilot.log"

The tmp/ardupilot.txt log file contains (there is no *.log):

running /home/xxxx/ardupilot/arducopter/arducopter.elf -S -I0 --home -35.363261,149.165230,584,353 --model --speedup=1
Starting sketch 'ArduCopter'
Starting SITL input
bind port 5760 for 0
bind failed on port 5760 - Address already in use
cmd exited

There is no interaction between MAVProxy and the Console or Map windows, even after executing the following commands in MAVProxy:

param load ..\Tools\autotest\copter_params.parm
mode guided
arm throttle
takeoff 40

Could someone provide guidance on getting the simulator working?

Thanks,

Rich

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hi Jack, I haven't Mission Planner.

    Download it?

    • Mission Planner is the Ground Station software that you can use to set up missions and view telemetry data in real time. You can download it here:

      http://ardupilot.com/downloads/?did=82

  • Hi Richard,

    I'm not a Linux user either, and I'm stuck in the same place as you. I think the "Window access not found" and address already in use is 2 separate problems. I am still looking for the "Window access not found" solution, but I solved my 'Address already in use' problem in this way: (Linux experts, please chip in if I have it totally wrong)...

    In my case I ran the simulator then closed the MAVProxy window. On my second attempt I got the 'Address already in use' message when I ran sim_vehile.sh. This was because there were still some processes running from the previous attempt.

    You can run the 'top' command. This will show you a list of running processes. I can't remember what the process name was, but it was related to the simulator or arducopter and was obvious.

    Ctr-c out of top and use 'kill {pid}'. (Whatever the pid number is for the prcess you want to kill).

    After that I could run the simulator again. However, I'm still stuck on the 'Window access not found' problem and I still don't get any communication with the other simulator windows. If it would help, this is the screens I get:

    SITL.png

    • Hi Jack, I haven't Mission Planner.

      Download it?

    • The process I had to kill to get around the 'Address already in use' issue is ArduCopter.elf.

      I also managed to get the simulator working on MavProxy using:

      sim_vehicle.sh -v ArduCopter --console --map

      • Hi Jack,

        Does this mean you have solved the "window access not found" error and have managed to get SITL working now. 

        I'm even less familiar with linux than you, would you be able to give me a step by step walk-through in how to work around the error.

        Thanks

        Martin. 

        • Hi Martin,

          I actually still get the ;Window access not found' message, but it doesn't seem to be a problem as I can now see the simulator talking to the console and see the quadcopter on the map. I still run into problems when trying to do a take off, but at least I am 1 step further and I can send commands to the simulator via MavLink.

          What I have done is basically followed the steps on:

          http://dev.ardupilot.com/wiki/simulation-2/sitl-simulator-software-...

          This includes:

          installing Cygwin,

          setting up the path in bashrc

          download ardupilot

          I ran into problems when I tried to do the next step under 'Running SITL and MAVProxy'.

          Using sim_vehicle.sh -j4 --map worked for me the first time, but I just couldn't get it to run again.

          I first got the 'port already in use' error. This was because there was already an instance of the simulator running. I fixed this as described above by running top to see the running processes and then use 'kill (pid)' to kill the ArduCopter.elf process. You need to find the PID for ArduCopter in top and use that number in the kill command.

          I then managed to start the simulator successfully by using:

          sim_vehicle.sh -v ArduCopter --console --map

          This did a new build. Once the MavLink console and map started up it took about a minute to initialize. After initialization I had this in the different windows:

          The Cygwin window:  still showed the window access not found message.

          Mavproxy command line: MAV> STABILIZE> Received 518 parameters Saved 518 parameers to mav.parm

          MAV Console: Sho real time status now and flickers as it constantly gets updated. It shows more menu options than previously. The main windows shows some initialization steps statuses and MAVLink communication related to heartbeat, fence, flight battery, GPS, etc.

          The map self centred on the quadcopter west of the Monaro Highway.

          On my first attempt for some reason the quadcopter kept spinning around, but closing mavproxy and launching it again now shows the quad stable on the ground waiting for commands.

          Hope it helps.

          • 非常感谢,终于编译通过了。(Thank you very much, and finally compiled through.can You explain why  use  -v ArduCopter operation mey run?)

          • Jack,

            I'm trying to set up Arduplane and like you sim_vehicle.sh -j4 --map worked first time for me too, but after that I got the window access not found erorr, but I didn't notice the port already in use error.

            I'll try again in the morning, if you could explain a little more about the 'top' command and how I use it to kill the arduplane.elf process. Are these commands that I would use in the Cygwin terminal.

            Thanks.

            • 3702884256?profile=originalMartin,

              Yes, you would use the Cygwin terminal. The top command shows the processes running on the Cygwin Linux 'virtual machine'. In this case, arducopter.elf is still running. If I try to run sim-Vehicle again, it will try to run arducopter.elf again resulting in the port error. If the arducopter.elf process is not running already, you will not get the 'address already in use' error and you can skip this step.

              The PID in top shows the process id. This is a unique identifier that Linux use to identify the process. In this case, arducopter.elf's PID is 8496. This is the PID I would use in the kill command.

              kill 8496 to terminate the existing arducopter.elf process.

              If I run top again it will not show up and I can safely run sim_vehicle again.

This reply was deleted.

Activity