Open larryteal opened 1 year ago
If you run mavsdk_server
manually, you need to set the address of the drone there. Something like this:
./mavsdk_server udp://192.168.1.12:14557
Where 192.168.1.12
is the IP of the drone and 14557
the port on which the drone is listening for MAVLink.
If you run the embedded mavsdk_server
, you have to do it in the await drone.connect(...)
call, as documented here:
drone = System()
await drone.connect(system_address="udp://192.168.1.12:14557")
Finally, note that the "usual" way with PX4 is that the drone broadcasts heartbeats (on 14550/udp) and the ground station picks it up, rather than what you are trying to do here (which is fine as well).
Thank you, I can receive messages and send commands normally, but when I use the QGC ground station to connect to the flight controller, the buzzer of the flight controller will sound to indicate that the ground station is connected (there will be a difference sound when the connection is disconnected), but when I use mavsdk-python to connect to the flight control, the flight control will not make any sound. Then I searched some information and did some tests and confirmed that the ground station should send heartbeat packet to the flight control. I want to make a ground station with the same function as QGC based on mavsdk-python. I am new to the ground station. I can't confirm the purpose of the heartbeat packet sent by the ground station to the flight controller, but QGC does this. Unfortunately, I did not find an API for sending heartbeat packets in the documentation
So if MAVSDK detects the drone, it will automatically send back HEARTBEATS. The typical way is to have MAVSDK listen on 14550 or (by default) 14540 for heartbeats coming from the drone.
Now depending on your setup, it could be that the drone can send messages to MAVSDK, but messages coming back from MAVSDK do not reach the drone for some reason.
An easy way is to try MAVSDK with SITL first. For instance, run this (it will run SITL), and run one of the MAVSDK python examples.
I want to make a ground station with the same function as QGC based on mavsdk-python
Yes that should be feasible, MAVSDK is there for that :blush: :+1:
MAVSDK automatically sends heartbeats not working for me, Other than that, I wanted to control the relay, but I couldn't find the API,I found MavlinkPassthrough in the documentation and it seems that only it meets my needs
If MAVSDK cannot send heartbeats to your drone, MAVSDK won't be able to send anything at all. Be it with mavlink-passthrough or not.
You need to understand why in your network topology messages can go from the drone to the MAVSDK (they do, right?) but not from MAVSDK to the drone.
I'm trying to make a ground station and need to send heartbeat packets to the flight controller, but I can't find the API?