NiVO / BY TECHNOGISGermany · Indonesia
Drone technology

Read Short MAVLink 2 Payloads Without Inventing Missing Telemetry

A capture-review workflow for distinguishing MAVLink 2 trailing-zero truncation, message definitions and unavailable field values from incomplete packet recording.

Read Short MAVLink 2 Payloads Without Inventing Missing Telemetry

Separate packet completeness from payload length

A telemetry reviewer compares two records for the same MAVLink 2 message type and notices different payload lengths. One export contains fewer bytes, and an issue report immediately calls the difference lost sensor data. That conclusion is premature. MAVLink 2 permits a compact wire representation in which trailing zero payload bytes are omitted. The transmitted frame can be complete even though its payload is shorter than the message definition’s maximum layout. For a NiVO mapping workflow, a careful retrospective review should identify what the capture and decoder actually establish before diagnosing a radio, sensor or aircraft fault.

This guide is an offline interpretation tutorial. It uses invented payload bytes to explain one serialization rule and never sends commands, changes an aircraft or demonstrates a NiVO telemetry installation. The toy bytes are not a complete MAVLink frame: they have no message identity, checksum or signature. Keep that distinction visible when discussing the example with colleagues. A short valid payload, an incomplete captured frame, an unknown message definition and a field whose value means unavailable are four different findings. Each needs its own evidence and follow-up.

Freeze the capture and identify the decoder

Preserve the original recording and note its capture point, transport, time coverage and export method. A file recorded after a router is evidence about that location, not automatically a complete copy of everything produced onboard. Work on a copy and retain the original file hash. Record the decoder library, protocol version, dialect definition and relevant revision before comparing exported columns. An analyst using a different message definition can obtain different visible fields from the same bytes. Reproducible interpretation requires both the capture and the definition used to read it.

Start with a maintained MAVLink decoder that checks frame boundaries and checksums. Keep parser rejection records instead of discarding them from the review. The protocol’s payload length field describes transmitted payload bytes, while the expected complete frame also includes framing and checksum information and may include signing information. Comparing file length with a maximum payload size does not establish a capture defect. Likewise, recognizing the start marker in a hex viewer is not enough to qualify a packet. Follow the decoder’s framing result and preserve the associated raw byte offset for any investigated record.

NiVO VTOL V2 with a white fixed wing and four vertical-lift rotors
NiVO VTOL V2 with a white fixed wing and four vertical-lift rotors.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.

Reproduce the trailing-zero rule with toy bytes

Consider a six-byte illustrative payload that is already in its declared wire order: 34 12 00 00 00 00 in hexadecimal. Its compact representation is 34 12. If the agreed toy layout contains three little-endian unsigned sixteen-bit fields, restoring the known layout with zero bytes gives values 4660, zero and zero. The missing wire tail is not evidence of three missing measurements. Change the fifth byte to 01 and the compact representation becomes 34 12 00 00 01: internal zeros remain, while only the final zero byte is removed. An entirely zero nonempty payload retains its first byte.

The small Python exercise below demonstrates this byte-tail rule only. Run it without any device or network connection. It does not validate a frame, calculate a MAVLink checksum, discover a dialect or interpret real sensor units. Its examples are intentionally simple so a reviewer can distinguish removed tail bytes from zeros in the middle. For an actual capture, let the generated or maintained decoder apply the real message definition rather than padding every record to an arbitrary size selected from a screenshot.

# Toy payload exercise only: no transport or MAVLink frame.
def trim_zero_tail(payload):
    if not payload:
        raise ValueError("Use a nonempty toy payload")
    end = len(payload)
    while end > 1 and payload[end - 1] == 0:
        end -= 1
    return payload[:end]

examples = ["34 12 00 00 00 00",
            "34 12 00 00 01 00",
            "00 00 00 00 00 00"]
for text in examples:
    original = bytes.fromhex(text)
    compact = trim_zero_tail(original)
    restored = compact.ljust(len(original), b"\x00")
    assert restored == original
    print(compact.hex(" "))
# Expected: 34 12 | 34 12 00 00 01 | 00

Use the message definition to assign meaning

A message’s XML field listing is not a safe manual byte-offset table. Base payload fields are reordered for transmission according to their storage sizes, while extension fields follow their declared extension order. Record which portion of the definition an investigated field belongs to and use the appropriate generated accessors. Avoid treating the display order in a spreadsheet as the wire order. This matters when two reviewers appear to disagree about the value at an offset: they may be applying different layouts to identical bytes rather than observing different behavior from the vehicle.

A decoded zero also does not automatically mean a measured quantity was zero. Read the exact message field definition, including units and invalid-value conventions. The common BATTERY_STATUS definition, for example, uses zero in time_remaining to indicate that a remaining-time estimate is not provided. That is not an instruction to interpret the battery as having zero seconds left. Other fields use different unavailable values. Preserve those distinctions in an export, preferably with an explicit interpretation or validity column, rather than replacing every unfamiliar sentinel with a blank cell and losing its documented meaning.

Challenge the explanation with controlled comparisons

Select several complete accepted frames for the same message identity, sender and decoder definition. Compare their transmitted payload lengths with their decoded values and retain the raw frame references. Include examples with different trailing content when available. If shorter payloads restore to the expected zero tail under the same definition, document that bounded observation. Do not expand it into a claim that the radio never loses messages. Frame-level acceptance, message arrival history and the meaning of individual fields answer related but separate questions.

Then inspect rejected or incomplete records separately. A recording that ends before the advertised frame is complete cannot be repaired merely by appending zeros to make a decoder happy. A checksum failure also requires investigation rather than an automatic assumption that ordinary payload truncation caused it. Keep original records intact when testing another decoder revision. Compare the results on copies and retain both interpretations. For extension fields, document the supported definition explicitly; a checksum result alone is not a complete account of extension-schema compatibility. Escalate unresolved differences with the smallest reproducible capture and the exact definitions used.

Write a conclusion that preserves uncertainty

Summarize the review in three parts: which frames were accepted, which schema and decoder produced the field values, and what the relevant validity conventions mean. State how many records were examined and which intervals or senders were outside scope. A useful finding might say that the inspected short payloads were valid compact encodings whose restored tail values were zero under a specific definition. It should not claim that every short record is valid, that a missing estimate was measured, or that the whole command and telemetry installation has been qualified.

Deliver the original capture identity, decoder and dialect revision, representative frame offsets, interpretation notes and unresolved exceptions to the responsible support or engineering reviewer. Keep operational decisions with the approved flight and maintenance process. The benefit of this workflow is a precise handoff: normal serialization behavior is not mislabeled as missing sensor evidence, while genuine framing defects and unsupported interpretations remain visible. That clarity saves later reviewers from repeating a byte-level investigation and gives them enough context to distinguish a software export issue from a fault that deserves further technical examination.

Technical references

  1. MAVLink packet serialization: truncation, field order and checksum ↗
  2. MAVLink 2: compact payloads and message extensions ↗
  3. MAVLink XML schema: extension fields and invalid-value metadata ↗
  4. MAVLink common BATTERY_STATUS field definitions ↗
← All articles

Related articles

All articles ↗
LET’S TAKE FLIGHT

Your next mission
starts with a conversation.

Talk to our team