How To Send Mavlink Commands To SITL


I am trying to figure out how I can send mavlink commands to my SITL environment.  I have SITL running on my linux mint VM and I have my own python code generated from which decoded the mavlink messages from SITL.

My SITL experiment is just a generic copter in a loop going to 5 different geo points.  I have a separate script that sends out LAND commands or SETMODE commands which does work on my real drone.  I am just trying to get my SITL environment to receive the commands.  I assume this can be done?

If I run netstat I see

tcp        0      0  *               LISTEN      8644/arducopter-qua

tcp        0      0  *               LISTEN      8644/arducopter-qua

tcp        0      0  *               LISTEN      8644/arducopter-qua

tcp        0      0         ESTABLISHED 8644/arducopter-qua

udp        0      0  *                           8644/arducopter-qua

udp        0      0          ESTABLISHED 8644/arducopter-qua

I am hoping I can just send the commands to one of those ports and I have tried UDP port 5501 and TCP port 5760 and none of them seem to work?

Am I doing something wrong, can this be done, I am hoping someone may have some advice for me as all I want to do is send real hand crafted mavlink commands to my SITL environment and it respond?

Thanks in advance,


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

Join diydrones

Email me when people reply –


  • Hello,

    Could you get this working?

    I am trying to do something similar with PX4 SITL.

    Please let me know if it worked for you.

This reply was deleted.


Liam left a comment on Agricultural UAVs
I'm Liam from T-MOTOR. I would like to reach out to see if there is any possibility for us to work together.
We are a propulsion system manufacturer who offers motors, propellers and ESCs for all kinds of drone applications which vary from secur…"
Jun 30
Richard Cox left a comment on Australia
"Anyone in the DIYDRONES Australian subgroup based in Alice Springs, NT?
I am experimenting with Ardupilot (standard Arduplane), Pixhawk 4 FC in a 4-ch
RC "AXN Floater Jet" foamy plane..."
Jun 29
Omar Sykes left a comment on Australia
"Hi everyone, I am looking for someone who is good at drone building, repair and software in Adelaide. Please give me a call on 0477 319 219."
Jun 29