MAVFTP¶
MAVFTP supports common FTP operations including uploading, downloading, removing and creating files on the autopilot file system
The official mavlink.io documentation is here and contains the detailed sequence of messages that should be passed between the GCS/companion computer and autopilot
Common uses for using MAVFTP include:
Fast download of parameters, onboard logs, mission command files and rally points and terrain data
Reference Implementation¶
pymavlink includes a known-working MAVFTP client, mavftp.py (with its opcode definitions in mavftp_op.py), usable both as a Python library and as a standalone command-line tool. It is a good reference for testing a new GCS/companion computer implementation against, or for scripting bulk MAVFTP transfers directly.
Warning
Implementing only the request/reply sequence described in the MAVLink specification above will work, but will be slow. pymavlink’s implementation gets much better throughput by pipelining requests rather than waiting for each reply before sending the next request: reads use OP_BurstReadFile to stream multiple chunks per request rather than one chunk per OP_ReadFile/reply round-trip, and writes keep a backlog of several in-flight, unacknowledged chunks (a small sliding window, similar in spirit to TCP) instead of sending one OP_WriteFile and waiting for its ack before sending the next. A GCS/companion computer implementation aiming for good performance should do the same rather than implementing a strict one-request-then-wait-for-reply loop.