Mavsdk in parallel with Qgroundcontrol

I’m using mavsdk in python env , and can listen to mavlink msgs and update parameters to a pixhawk cube attached by a usb cable.
But , I cant use the QgroundControl and mavsdk in parallel ! as they both use the same USB port and block each other. I need them both attached at the same time threw the same usb port.
Did anyone encounter this problem? Is there a way in python , to solve this problem?


solved it by using mavlink-router to forward the serial mavlink mssgs to different UDP ports.
then QGC connects to one of the UDP ports and MAVSDK to the other.

Hi, I know this was a long time ago, is there a code example you can share where this was done? This may be something that I will be needing in the near future.

You can also do this using MAVSDK without mavlink-router:

For that, you need to add both connections to the Mavsdk instance, and set forwarding on for both of them.

Unfortunately, I don’t have an example ready just now, and I can’t find it in the docs, but it should be clear from the API:

@JulianOes , I am facing similar issue while using Qgroundcontrol and mavsdk simultaneously using python. Can you please share some example of launching Qgroundcontrol and mavsdk python in parallel using forwarding option that will help a lot. The example given above is for C++ and looking for some option in python. I have been setting connection with drone using telemetry however either of Qgroundconrol or mavsdk is connecting and not both.

Connection forwarding is not available in Python at this point.

You would have to use mavlink-router for the routing or write a small standalone C++ app based on MAVSDK C++ that creates the connection and does the forwarding and then just does nothing, so spins in a while sleep loop.

@JulianOes , many thanks for your valuable suggestion.

If your MAVSDK must link Pixhawk via USB(ttyACM0). So, you can chang the Mavlink port of QGC to uart port.