NiVO / BY TECHNOGISGermany · Indonesia
Flight data review

MAVLink HEARTBEAT Source Identity: A Drone Log Audit Tutorial

Audit system and component identities in a local MAVLink telemetry log before joining survey records, using HEARTBEAT declarations and a read-only source summary.

MAVLink HEARTBEAT Source Identity: A Drone Log Audit Tutorial

Identify the capture before interpreting its senders

A received telemetry log can include messages from an aircraft, a ground station and other components sharing the communication arrangement. Combining every position or attitude record into one survey timeline without identifying its sender can therefore create a misleading analysis. For a NiVO technical review, begin with the capture location, file format and session boundaries. This tutorial summarizes HEARTBEAT sources in a local timestamped MAVLink telemetry file. It does not connect to an aircraft, select a live control target or establish which components are installed on any particular NiVO configuration.

Preserve the original capture and identify the working copy by filename, revision and digest. Record which application created it, when recording started and stopped, and whether several sessions or links were combined. A received telemetry file is different from an onboard DataFlash log or a packet capture requiring another decoder. Do not infer the format solely from an extension. Confirm that the selected reader supports the actual recording convention and dialect. If these details are unresolved, document that limitation before interpreting a source summary as a complete account of the aircraft or its payload activity.

Keep source addresses separate from declared roles

MAVLink packet headers contain the sending system ID and component ID. The first distinguishes systems on the network; the second distinguishes components within a system. Retain the pair together when grouping records. A component ID by itself can appear in more than one system, so discarding the system ID can merge separate senders. These are message source fields, not a target address copied from a command payload. Use the decoder interface for header information rather than guessing the source from a convenient field in the message body or from the order in which records appear.

The heartbeat protocol identifies component roles through the HEARTBEAT type and autopilot fields. Its documentation recommends recognizing an autopilot declaration by an autopilot value other than MAV_AUTOPILOT_INVALID and explicitly warns against inferring component type from the component ID alone. Preserve both declarations in the review, including unexpected combinations. A familiar component number is not sufficient evidence that the sender is the flight controller. Equally, an advertised role remains a declaration in the capture; matching that source to a physical aircraft, installed device and configuration requires the accompanying project and integration records.

NiVO VTOL V7 with a white fuselage, lift rotors, and yellow wing tips
NiVO VTOL V7 with a white fuselage, lift rotors, and yellow wing tips.Source: NiVO / TechnoGIS catalogue materials supplied by the site owner · Catalogue photo
Product context only; this photograph does not depict the constructed examples in this article.

Summarize a local file without sending messages

The following Python recipe uses the Pymavlink logfile reader with writing disabled and counts heartbeat records by source pair and declared role. It requires an existing regular file with a tlog suffix, selects the common dialect and invokes receive methods only. The Pymavlink implementation opens this reader in binary read mode when writing is disabled. Its generated message interface exposes get_srcSystem and get_srcComponent for header source values. Replace the illustrative filename with the identified working copy in a compatible analysis environment; the article does not report an executed decoder run or actual source counts.

This is an initial source inventory, not a complete recording validator. The example also reports decoder BAD_DATA items separately instead of presenting every parsed object as a usable heartbeat. That item count is not a number of lost packets, missing bytes or failed radio transmissions. Decoder behavior depends on the file convention, dialect and installed library. Review parsing problems against those inputs before using the summary. The code does not transmit a heartbeat, request additional data, change message rates or modify the recording. Keep the software version and output with the source identity if you run the recipe.

# Offline timestamped MAVLink log only; illustrative local name.
from collections import Counter
from pathlib import Path
from pymavlink import mavutil

path = Path("accepted-flight.tlog").resolve(strict=True)
if not path.is_file() or path.suffix.lower() != ".tlog":
    raise ValueError("Select the identified local telemetry file")
mavutil.set_dialect("common")
log = mavutil.mavlogfile(str(path), write=False)
counts = Counter()
bad_items = 0
try:
    while True:
        message = log.recv_match(blocking=False)
        if message is None:
            break  # End of this local file, not a live-link timeout.
        kind = message.get_type()
        if kind == "BAD_DATA":
            bad_items += 1
        elif kind == "HEARTBEAT":
            key = (message.get_srcSystem(),
                   message.get_srcComponent(),
                   int(message.type), int(message.autopilot))
            counts[key] += 1
finally:
    log.close()
print("system, component, type, autopilot -> recorded heartbeats")
for key, count in sorted(counts.items()):
    print(key, count)
print("Decoder BAD_DATA items:", bad_items)

Review changes and collisions before selecting a stream

For each source pair, compare the recorded type and autopilot combinations with the expected integration record. A single pair associated with different declarations deserves investigation. Possible explanations include combined sessions, an exporter transformation, a changed configuration or an addressing conflict; the count table alone cannot choose among them. Locate representative original messages and review their place in the recording. The example deliberately includes declared roles in its grouping key so that differing combinations remain visible rather than being overwritten by the last heartbeat encountered. Preserve unexpected entries until their meaning is established.

Do not turn the first autopilot-looking row into an automatic choice for every later analysis. A file may include several vehicle systems, and the intended survey aircraft must be selected using documented session identity. Once that relationship is established, retain the selected system and component criteria with the downstream query. A camera or another component may legitimately supply records needed for a separate part of the workflow. The correct response is to preserve and explain those relationships, not to remove every sender that is not the flight controller and thereby discard useful evidence without review.

Separate heartbeat presence from continuity and readiness

A heartbeat record supports a statement about a declaration observed at the recording point. It does not establish that every expected sensor message arrived, that a payload was recording or that an aircraft was ready for a mission. The MAVLink heartbeat guide states that broadcast rates and disconnect criteria depend on the channel rather than defining one universal timeout. An offline review should therefore use the actual recording arrangement and intended question. Avoid converting a heartbeat count into elapsed flight time by assuming an undocumented fixed frequency, particularly when the log may have gaps or repeated reception paths.

If the task concerns a suspected interruption, construct a separate timing review using the capture timestamps and their documented relationship to the relevant onboard events. Preserve session boundaries and investigate duplicate or missing intervals before calculating a rate or loss statistic. The source summary above neither deduplicates messages nor measures radio performance. A smooth heartbeat sequence can coexist with missing image events, and a recording gap can arise after the sender has already produced its data. Identify the observation point and affected message stream so the eventual finding describes the evidence actually available rather than an assumed failure mechanism.

Carry source identity into the survey analysis record

Before joining positions, attitude, camera events or other telemetry, record the selected source pair, declared role, session interval and decoder environment. Trace several chosen messages back to the accepted capture and confirm that the downstream extraction preserves their source information. Where different components contribute different observations, state that mapping explicitly. Time reference, event meaning and coordinate-frame interpretation still require their own checks. Correct source grouping is a prerequisite for a defensible join; it does not by itself synchronize clocks, establish camera mounting geometry or validate the numerical content of another message type.

A useful NiVO review handoff contains the original capture identity, source-summary output, explanation of selected and unresolved senders, parsing findings and the limitations of the observation point. Keep unexpected declarations and the reason for any exclusion available to the next analyst. This makes a later question concrete: which system, component, session and message supplied the value being interpreted? It also keeps protocol addresses distinct from the physical equipment record. The result is a reproducible preparation step for survey-log analysis, without claiming a new flight test, hardware diagnosis, product compatibility or achieved mapping accuracy.

Technical references

  1. MAVLink heartbeat protocol — component identity and channel behavior ↗
  2. MAVLink packet serialization — source header fields ↗
  3. MAVLink Pymavlink guide — receiving and validating message objects ↗
  4. Pymavlink implementation — read-only logfile reader and receive methods ↗
  5. Pymavlink generator — message source-header accessors ↗
← All articles

Related articles

All articles ↗
LET’S TAKE FLIGHT

Your next mission
starts with a conversation.

Talk to our team