Connect PX4 via telemetry and MAVSDK-Python

How I can use the MAVSDK-Python to connect to the drone using Holybro telemetry 915MHz ?

1 Like

I tried the following codes but nothing of them worked

drone = System()
await drone.connect(system_address="udp://:14540")

drone = System()
await drone.connect(system_address="serial:///dev/ttyACM0")

drone = System()
await drone.connect(system_address="serial:///dev/ttyACM0:9900")

drone = System("localhost", 9900)
await drone.connect()

which OS do you working on?

I use Linux Ubuntu 18.04.5 …

I could solve the problem as the following:

Before of all, make sure that you do not run QGC.

At first I found the USB path by typing ls /dev/tty* on the terminal, and I got “/dev/ttyUSB0”

After that run MAVSDK-Server from the terminal as the following:

cd MAVSDK/build/default/src/mavsdk_server/src/
./mavsdk_server -p 50051 serial:///dev/ttyUSB0:921600

But be careful to change the telemetry USB path as you got it.

Finally, use this commands at your python code to connect with telemetry, and also be careful to change the telemetry USB path as you got it:

drone = System()
    await drone.connect(system_address="serial:///dev/ttyUSB0:57600")
1 Like