QGC 5.1.5: ArduPlane 4.7.x log downloads ~6× slower than direct MAVFTP

Love the SW, thanks for the work you do. My assistant drafted this report about a large log I just downloaded.

found what appears to be an unnecessary fallback from MAVFTP to the legacy MAVLink log-download protocol.

Test environment

  • QGroundControl 5.1.5

  • ArduPlane 4.7.2

  • SpeedyBee F405 Wing

  • macOS Sequoia 15.8

  • Direct USB connection

Measurements

Using QGC’s onboard log downloader, I was seeing approximately 50 kB/s.

I then downloaded logs from the same flight controller using PyMAVLink’s MAVFTP client:

Log size Transfer time Speed
2,293,760 bytes 7.62 s 294.1 kByte/s
13,258,752 bytes 43.63 s 296.7 kByte/s

The results are very consistent, showing roughly 6× greater throughput than the QGC downloads.

The larger transfer was performed using:

python -m pymavlink.mavftp \
  --device /dev/cu.usbmodem212101 \
  get /APM/LOGS/00000020.BIN \
  log_20_speedtest.bin

Possible cause

Looking at QGC 5.1.5’s OnboardLogController.cc, the following code in _ftpFinishListing() appears relevant:

if (_vehicle &&
    _vehicle->ftpManager()->listDirectoryWithTimeUnsupported()) {
    _ftpFallbackToMessages();
    return;
}

ArduPilot only added ListDirectoryWithTime support in 4.8, so ArduPlane 4.7.2 does not support that operation.

My understanding is that QGC initially attempts MAVFTP, but if the firmware cannot supply directory timestamps, it abandons FTP log transfers entirely and reverts to the slower LOG_REQUEST_DATA protocol.

This seems unnecessarily restrictive when the firmware supports normal MAVFTP file listings and downloads.

Source:

ArduPilot MAVFTP documentation:

Suggested improvement

Would it be possible to retain MAVFTP downloads on older ArduPilot firmware even when directory modification timestamps are unavailable?

For example, display unknown dates where necessary, rather than reverting the entire download process to the legacy protocol.

I appreciate that the existing fallback may be necessary for certain PX4 firmware versions, so any change should preserve that compatibility.

I haven’t yet captured QGC debug output confirming this particular fallback path, but the direct MAVFTP measurements demonstrate that the controller itself is capable of substantially higher throughput.

Is this expected behaviour, and would a change to retain MAVFTP for older ArduPilot versions be acceptable?

Hi boi,

Thanks for the detailed report and reproducible throughput measurements. This looks like a worthwhile issue to investigate.

I checked the referenced QGroundControl source, and your observation about the fallback path is correct.

In _ftpFinishListing(), an unsupported ListDirectoryWithTime operation causes the controller to call _ftpFallbackToMessages(). That function also disables FTP for the current controller session and switches to the MAVLink message-based log transport.

This means that a limitation in directory timestamp support can affect the transport selected for the actual file download, even when ordinary MAVFTP file operations work.

Your measurements suggest a significant performance opportunity, although the QGC diagnostic log is still needed to confirm that this particular fallback caused the observed slowdown.

I would recommend separating two concerns:

  1. Directory metadata capability: Whether modification timestamps are available.

  2. File transfer capability: Whether ordinary MAVFTP listing and file download operations succeed.

Ideally, missing timestamps should not automatically disable a functional FTP download path.

We would also need to preserve the compatibility behavior introduced for older PX4 firmware and check how the log listing UI handles entries with unknown dates.

Could you capture the QGC logging output during a log-list refresh and download? In particular, it would be useful to confirm whether the controller reports the FTP-to-message fallback.

A focused regression test covering an FTP-capable server without ListDirectoryWithTime support would also help establish the expected behavior.

I think this is a good candidate for a small upstream fix once the fallback path is confirmed.

Best regards,
Yiğitcan Öztürk
PAMILANGA LIMITE

Hi Yiğitcan,

I’ve now captured the QGC 5.1.5 diagnostic output, and it confirms the suspected FTP-to-message fallback.

The relevant sequence is:

34.280 refresh: using ftp transport
34.280 ftp: listing root "@MAV_LOG"
34.280 listDirectory using "List Directory With Time" - support unknown, probing
34.304 Nak "List Directory With Time"
34.305 kCmdListDirectoryWithTime unsupported, falling back to kCmdListDirectory
34.325 ftp: root listing of "@MAV_LOG" failed, falling back to /APM/LOGS
35.305 ftp: raw entries for "/APM/LOGS" ...
35.319 ftp: listing complete, found 39 logs
35.319 ftp: transport failed, falling back to message based log download

The important point is that ordinary MAVFTP directory listing succeeded and returned 39 log files, including their sizes. Nevertheless, QGC immediately switched to message-based downloads because modification timestamps were unavailable.

This confirms the fallback path you identified.

My previous measurements on the same controller were:

  • QGC legacy download: approximately 50 kB/s

  • Direct PyMAVLink MAVFTP: 294–297 kB/s

It looks like preserving FTP transfer capability independently of directory timestamp support would resolve this issue for ArduPlane 4.7.x.

I have the diagnostic log available if useful.

Thanks for looking into this.

Kind Regards,

Don

Hi Don,

Excellent diagnostic work. Thank you for capturing the detailed output.

This confirms the suspected fallback behavior.

The particularly important observation is that the standard MAVFTP directory listing succeeds and returns all 39 log files, including their sizes, but QGC subsequently abandons FTP transport because modification timestamps are unavailable.

That suggests the current fallback decision is coupling two capabilities that should ideally be handled independently:

  1. Directory metadata support, including modification timestamps.

  2. MAVFTP file transfer support.

The absence of timestamp support should not, by itself, prevent MAVFTP downloads when standard directory listing and file reads are supported.

Your measurements also demonstrate the practical impact:

  • QGC message-based download: approximately 50 kB/s.

  • Direct PyMAVLink MAVFTP: 294–297 kB/s.

  • Observed performance difference: approximately 5.9×.

Proposed fix

I would investigate adjusting the transport selection logic so that:

  • List Directory With Time remains the preferred operation.

  • Unsupported timestamp listing falls back to standard directory listing.

  • Successful standard listing preserves MAVFTP as the selected download transport.

  • Missing timestamps are represented as unavailable rather than treated as a transport failure.

  • Message-based download remains available when FTP listing or file transfer genuinely fails.

We should also verify whether the log download UI or internal data model currently requires valid timestamps before accepting FTP-listed entries.

Suggested regression tests

  1. ArduPlane 4.7.x with standard MAVFTP directory listing but no timestamp support.

  2. PX4 with timestamp-capable directory listing.

  3. MAVFTP listing failure requiring message-based fallback.

  4. MAVFTP file-read failure after successful directory listing.

  5. Correct log names, sizes, download completion, and file integrity.

If you can share the complete diagnostic log, that would be helpful for verifying the exact decision point before preparing a targeted patch.

I think we now have sufficient evidence to investigate this as a focused QGroundControl compatibility issue rather than a general MAVFTP performance problem.

Thanks again for the careful testing.

Best regards,
Yiğitcan Öztürk
PAMILANGA LIMITED

Hi Yiğitcan,

Thanks for the detailed assessment. Here’s the complete QGC diagnostic log for your review.

I’m also happy to test a patched QGroundControl build on macOS against my SpeedyBee F405 Wing running ArduPlane 4.7.2. I can repeat the same download tests to verify the transport selection, transfer speed, and file integrity.

Thanks again for looking into this.

Cheers,

Don

Hi Don,

Thanks for providing the diagnostic log. I’ve now inspected it, and we have a much clearer picture of the problem.

The log confirms that QGroundControl initially selects MAVFTP:

34.280 refresh: using ftp transport

The FTP manager then reports:

kCmdListDirectoryWithTime unsupported, falling back to kCmdListDirectory

QGC subsequently attempts /APM/LOGS and successfully discovers 39 log files.

However, immediately after completing the listing, it reports:

35.319 ftp: transport failed, falling back to message based log download

This is the key finding.

MAVFTP directory access is working, but QGC abandons the FTP log-download path after discovering the files.

The subsequent message-based download requests are also consistent with your performance measurements. For log ID 21, I found 57 block requests, with an average interval of approximately 3.4 seconds between requests.

This corresponds to roughly 54 kB/s, close to the approximately 50 kB/s you reported.

The evidence strongly suggests that the FTP directory timestamp compatibility handling is involved in the fallback.

I would recommend separating timestamp metadata support from actual FTP file-transfer capability, so that successful standard directory listing does not unnecessarily disable MAVFTP downloads.

The next step is to validate a narrowly scoped source change, while preserving compatibility with older firmware.

Your offer to test a patched macOS build against ArduPlane 4.7.2 would be extremely valuable.

The acceptance criteria should be:

  1. QGC successfully lists /APM/LOGS.

  2. The selected download transport remains MAVFTP.

  3. Transfer throughput improves relative to the current QGC build.

  4. Downloaded files match the reference files byte-for-byte.

  5. Existing fallback behavior remains available when FTP transfer genuinely fails.

Thanks again. Your diagnostic log provides a reproducible starting point for investigating this issue.

Best regards,
Yiğitcan Öztürk
PAMILANGA LIMITED

Hi Yiğitcan,

Thanks for the additional analysis. The 54 kB/s figure from the diagnostic log is particularly useful, as it closely matches my experience.

I’m happy to validate a patched macOS build against ArduPlane 4.7.2, including transfer speed, log listing, and byte-for-byte file comparison against the PyMAVLink downloads.

Are you planning to prepare a patch or PR, or would you prefer this to be opened as a GitHub issue first?

I can provide further test results as needed.

Thanks again for investigating this.

Hi Don,

Thanks for offering to validate the fix on your hardware. That would be extremely helpful.

I’ve already prepared an initial patch in my QGroundControl fork, along with a regression test covering ArduPilot’s fallback from timestamped FTP directory listings to standard MAVFTP listings.

The patch preserves the existing compatibility behavior for older PX4 firmware while allowing ArduPilot to continue using MAVFTP when directory timestamps are unavailable.

I’m planning to submit a PR rather than open a separate issue first.

The implementation is committed, but build and regression validation are still pending. Once those checks are complete, I’ll share the patch and coordinate a macOS build for your ArduPlane 4.7.2 testing.

Your proposed validation of transfer speed, log listing, and byte-for-byte comparison against PyMAVLink is exactly what we need.

Thanks again for your support.

Best regards,
Yiğitcan Öztürk
PAMILANGA LIMITED