MAVLink TIMESYNC Replies: Match the Request Before Reviewing a Clock Offset
Inspect TIMESYNC v2 roles, echoed timestamps and reply destinations in an offline drone-log review before treating a timing exchange as usable evidence.

Identify the timing exchange in the capture
A telemetry table can contain TIMESYNC requests and replies from several components, with timestamps that look plausible when viewed in isolation. Before using any reported clock offset in a NiVO technical review, identify which exchange produced it. A reply associated with the wrong requester can create a misleading timing comparison even when its numeric fields are readable. This tutorial examines a bounded offline TIMESYNC v2 profile. It does not connect to an aircraft, send a synchronization request or establish that a particular NiVO controller implements the protocol. Preserve the accepted capture and the decoder context before grouping timing records.
Record the source system and component identities, recording point, session boundaries and any link merging performed by the export application. A receiving timestamp from a recorder is not automatically the requester timestamp required for a round-trip calculation. Determine what each field and capture column represents before subtracting values. Keep the original message records alongside any summary. If the export has lost the request relationship or local receive-clock context, obtain the underlying evidence instead of pairing nearby rows merely because they contain similar numbers or appear consecutively in a spreadsheet. The first task is to establish the scope of the exchange.
Read request roles, echoes and v2 destinations
The current MAVLink protocol guide describes a TIMESYNC request with tc1 equal to zero and the requester timestamp in ts1. A reply carries the requester timestamp back unchanged in ts1 and supplies the responding component timestamp in tc1. The v2 flow also uses the reply target system and component to identify its intended requester. Preserve those roles when decoding a table. The named fields are not interchangeable clock readings, and an apparent zero in tc1 has a protocol role rather than proving that a component clock was measured at its origin.
The guide distinguishes responses addressed to the broadcast destination as legacy behavior and warns about reliable association when multiple synchronizing components exist. The narrow example below therefore accepts only a reply addressed to the supplied nonzero requester identity. A rejection outside that profile is not a universal verdict that every older message is malformed. Keep the actual protocol version and implementation evidence with the finding. Sender identity, session context and message decoding still need separate review; matching an echoed number and destination alone cannot prove the complete exchange history or validate the source of every record in a combined capture.

Product context only; this photograph does not depict the constructed examples in this article.
Trace a constructed matching and round-trip calculation
Consider an invented request timestamp of one billion nanoseconds, a reply that echoes that value and a requester receive timestamp of one billion ten million nanoseconds. Their local-clock difference is ten million nanoseconds. The remote timestamp in the example is retained separately; it is not subtracted directly to manufacture a round-trip duration. This arithmetic describes a constructed exchange, not a NiVO latency measurement or an accepted clock-offset estimate. It assumes that the send and receive values belong to the same continuous requester clock and that the surrounding record association has already been established.
The Python function checks a selected nonnegative integer timestamp profile, the request and response roles, the echoed value and the supplied requester destination. It then reports the local round-trip interval and preserves the remote timestamp. It does not parse a MAVLink capture, identify sender headers, filter a sequence or calculate a final clock correction. A receive time earlier than the request causes the narrow check to stop rather than silently repairing a reset or mixed-clock condition. Use the actual implementation documentation and recording evidence before extending this method to a real timeline or assigning meaning to a calculated offset.
def inspect_timesync_reply(request, reply, local_receive_ns, local_id):
if len(local_id) != 2 or any(type(i) is not int or not 1 <= i <= 255 for i in local_id):
raise ValueError("expected a nonzero requester system/component pair")
send_ns = request["ts1"]
remote_ns = reply["tc1"]
if request["tc1"] != 0 or remote_ns == 0:
raise ValueError("request/response roles do not match")
if any(type(t) is not int or not 0 <= t < 2**63 for t in (send_ns, remote_ns, local_receive_ns)):
raise ValueError("outside this nonnegative timestamp profile")
if reply["ts1"] != send_ns:
raise ValueError("reply does not echo this request")
if (reply.get("target_system", 0), reply.get("target_component", 0)) != tuple(local_id):
raise ValueError("reply is not addressed to this requester")
if local_receive_ns < send_ns:
raise ValueError("receive time precedes request on the selected clock")
return {"roundTripNs": local_receive_ns - send_ns,
"requestTimestampNs": send_ns, "remoteTimestampNs": remote_ns}
# Constructed decoded fields only; no connection or clock change.
request = {"tc1": 0, "ts1": 1_000_000_000}
reply = {"tc1": 1_105_000_000, "ts1": 1_000_000_000,
"target_system": 1, "target_component": 190}
print(inspect_timesync_reply(request, reply, 1_010_000_000, (1, 190)))Keep sample quality separate from the protocol match
The MAVLink guide describes repeated exchanges and filtering or averaging because channel and processing delays affect offset estimation. A single matched reply is therefore a sample to assess rather than a completed synchronization result. Preserve the actual sequence, implementation settings and diagnostics when reviewing a real system. Do not label the constructed round-trip number as an offset uncertainty or a bound on camera exposure timing. Those are different questions requiring additional evidence about clocks, timestamp placement and the recording or triggering arrangement. The small function deliberately does not supply that missing evidence or infer it from one plausible reply.
Check for session resets, discontinuities, missing requests and changes in the recording path before aggregating samples. If the local receive time comes from another machine or clock, identify the required relationship explicitly rather than using the column because it has a convenient unit label. Keep nanoseconds, microseconds and application display units distinguishable throughout the calculation. A consistent unit conversion cannot repair an incorrect clock association. Retain samples rejected by the review method with their reasons so another analyst can understand the selected population instead of seeing only a smooth final line whose exclusions and implementation assumptions are undocumented.
Relate timing findings to the intended drone-data task
A component-clock exchange does not by itself establish when a camera exposed an image or when a receiver observation was recorded. Define the event whose time matters and trace its timestamp source through the actual installation and software workflow. If a project requires image-event synchronization, obtain the relevant trigger, feedback and recording evidence rather than treating TIMESYNC support as a product accuracy specification. Keep the protocol finding limited to what the capture and implementation records demonstrate. The product photograph is context only and does not show the constructed exchange or identify a controller feature installed on a particular aircraft.
When a suspected timing issue requires further investigation, retain the accepted capture and share the identified request/reply sample, component context and observed discrepancy through the project review process. Do not replay archived commands or change clock settings as part of this offline inspection. A candidate processing interpretation should retain its source relationships and limitations so it can be reproduced without modifying the recorded evidence. If the required clock relationship cannot be established, describe that gap directly. A plausible numerical offset or a successful field match is not sufficient reason to claim that a survey timeline has been synchronized to the intended event.
Deliver a reproducible exchange-level finding
A useful handoff identifies the capture revision, decoder, protocol profile, component identities, echoed request relationship and source of the local receive timestamp. Include the actual sample-selection rules, implementation context and unresolved warnings. Another analyst should be able to reproduce the association and distinguish the local round trip from a remote clock reading or final filtered offset. The constructed values and memory-only recipe checks remain teaching evidence, not a real timing measurement. Keep any later operational or analytical acceptance finding separate and support it with the records required for that task.
For NiVO workflow discussions, this turns an ambiguous clock-offset column into a traceable question about the exchange that produced it. It complements sender-identity and camera-timing reviews while addressing a distinct protocol-association issue. Preserve request, reply, component and clock context together through the handoff. The recipient receives a clear account of what was actually inspected, which calculation was performed and what additional timing evidence remains necessary before the records can support the intended data association. That is a more useful outcome than treating every readable TIMESYNC reply as an independent guarantee of synchronized acquisition.



