Reading Pixhawk's pins

Right. I don’t believe the pin value is provided by MAVLink. If you’ve got the leak failsafe set to “warn only” (the default) then your system should be notified of leaks by the STATUSTEXT message, e.g.

from pymavlink import mavutil

# connect to the vehicle from the surface computer
vehicle = mavutil.mavlink_connection('udpin:0.0.0.0:14550')
# wait for connection to be established/confirmed
vehicle.wait_heartbeat()

while "program running":
    message = vehicle.recv_match(blocking=True)
    if message.name == 'STATUSTEXT' and message.text == 'Leak Detected':
        print("LEAK!!")
    ... # otherwise, do other things
1 Like