From 1c47d240f868038740973588d9390bd0f2d80055 Mon Sep 17 00:00:00 2001 From: DGames95 <83220725+DGames95@users.noreply.github.com> Date: Fri, 19 Jun 2026 15:55:19 +0200 Subject: [PATCH] Update heartbeat handling documentation mavlink_connection.wait_heatbeat() method does not error on timeout, it returns None mirroring recv_match() --- en/mavgen_python/index.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/en/mavgen_python/index.md b/en/mavgen_python/index.md index 22f2cd4a2..94e32490a 100644 --- a/en/mavgen_python/index.md +++ b/en/mavgen_python/index.md @@ -158,8 +158,11 @@ the_connection = mavutil.mavlink_connection('udpin:localhost:14540') # Wait for the first heartbeat # This sets the system and component ID of remote system for the link -the_connection.wait_heartbeat() -print("Heartbeat from system (system %u component %u)" % (the_connection.target_system, the_connection.target_component)) +hb = the_connection.wait_heartbeat() +if hb is not None: + print("Heartbeat from system (system %u component %u)" % (the_connection.target_system, the_connection.target_component)) +else: + print("No heartbeat received") # Once connected, use 'the_connection' to get and send messages ```