Cheatsheet — Packet Format
Side-by-side reference for MAVLink 1 and MAVLink 2 frame layout. Print this or keep it open while debugging with Wireshark.
text
╔══════════════════════════════════════════════════════════════╗ ║ MAVLink 1 Frame ║ ╠══════════════════════════════════════════════════════════════╣ ║ Byte 0 │ STX = 0xFE ║ ║ Byte 1 │ Payload length (0–255) ║ ║ Byte 2 │ Packet sequence (0–255) ║ ║ Byte 3 │ System ID (1–255) ║ ║ Byte 4 │ Component ID (1–255) ║ ║ Byte 5 │ Message ID (0–255) ║ ║ Byte 6..N │ Payload ║ ║ N+1..N+2 │ Checksum (CRC-16/MCRF4XX) ║ ╠══════════════════════════════════════════════════════════════╣ ║ Min packet: 8 bytes │ Max packet: 263 bytes ║ ╚══════════════════════════════════════════════════════════════╝
text
╔══════════════════════════════════════════════════════════════╗ ║ MAVLink 2 Frame ║ ╠══════════════════════════════════════════════════════════════╣ ║ Byte 0 │ STX = 0xFD ║ ║ Byte 1 │ Payload length (0–255) ║ ║ Byte 2 │ Incompatibility flags ║ ║ Byte 3 │ Compatibility flags ║ ║ Byte 4 │ Packet sequence (0–255) ║ ║ Byte 5 │ System ID (1–255) ║ ║ Byte 6 │ Component ID (1–255) ║ ║ Byte 7–9 │ Message ID (24-bit, little-endian) ║ ║ Byte 10..N│ Payload (trailing zeros truncated) ║ ║ N+1..N+2 │ Checksum (CRC-16/MCRF4XX) ║ ║ N+3..N+15 │ Signature (optional, 13 bytes) ║ ╠══════════════════════════════════════════════════════════════╣ ║ Min packet: 12 bytes │ Max packet: 280 bytes (with sig) ║ ╚══════════════════════════════════════════════════════════════╝
Quick detection
First byte tells you the version: 0xFE → MAVLink 1. 0xFD → MAVLink 2. If byte 2 has bit 0 set (incompat_flags & 0x01), the packet is signed — expect 13 extra bytes after the checksum.