MAVSDK-Python icon indicating copy to clipboard operation
MAVSDK-Python copied to clipboard

`mavsdk_server` does not connect over serial until QGC is started

Open xindax2000 opened this issue 2 years ago • 9 comments

I want to join the Pixhawk with MAVsdk. I use the following command: ./mavsdk_server -p 50051 serial:///dev/ttyACM1:57600 => does NOT start... just waiting If I open and close QGroundControl, than It works!!! If I don't open QGroundControl, then it won't start.

What schould I do? How do I start it?

xindax2000 avatar Sep 18 '22 19:09 xindax2000

You have to disable any kind of autoconnect on the serial ports in QGroundControl first.

The best method to find the culprit in cases like this is to use lsof:

sudo apt install lsof
sudo lsof /dev/ttyACM0

dayjaby avatar Sep 18 '22 19:09 dayjaby

I want to join the Pixhawk with MAVsdk.

PX4 or Ardupilot? I'm assuming PX4.

If I open and close QGroundControl, than It works!!!

I do believe that over serial, PX4 needs to receive MAVLink messages before it starts sending them. I think this is fairly new, though. I guess mavsdk_server should automatically send heartbeats when connecting over serial. Not sure... @julianoes do you have an opinion here?

JonasVautherin avatar Sep 18 '22 20:09 JonasVautherin

Yes, PX4 how can i cause heartbeat?

xindax2000 avatar Sep 18 '22 20:09 xindax2000

I think you would want to set always_send_heartbeats, using set_configuration maybe somewhere around here?

JonasVautherin avatar Sep 18 '22 20:09 JonasVautherin

I don't fully understand this

xindax2000 avatar Sep 18 '22 20:09 xindax2000

@JonasVautherin should we make a bugfix release for this?

julianoes avatar Sep 18 '22 21:09 julianoes

I guess it would be nice to test it first. Also we should do it only for serial://, shouldn't we?

JonasVautherin avatar Sep 18 '22 21:09 JonasVautherin

Yes, PLS!

xindax2000 avatar Sep 18 '22 21:09 xindax2000

@JonasVautherin, yes but it's not straightforward I'm afraid.

julianoes avatar Sep 18 '22 21:09 julianoes

Did you manage to solve it?

xindax2000 avatar Oct 16 '22 16:10 xindax2000

This should be fixed in https://github.com/mavlink/MAVSDK-Python/releases/tag/1.4.4.

julianoes avatar Feb 10 '23 18:02 julianoes