Skip to content

Add editor MAVFTP transfers and filtering; fix console shutdown - #1766

Merged
tridge merged 5 commits into
ArduPilot:masterfrom
tridge:pr-more-ftp
Oct 3, 2026
Merged

tridge merged 5 commits into
ArduPilot:masterfrom
tridge:pr-more-ftp

Conversation

@tridge

@tridge tridge commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Add enabled-by-default MAVFTP tickboxes to the mission and parameter editors. Read WPs and Write WPs use FTP when checked; Fetch all in the parameter editor also follows its checkbox. Parameter Write always uses PARAM_SET for edited values, without verification reads or a full refetch. FTP writes of changed parameters are deferred to a future PR.

Both editors show MAVFTP transfer status and completion results. Transfers start on the MAVProxy main loop, results from a previously selected vehicle are discarded, and mission downloads preserve edits made during the transfer. FTP uploads wait for the close acknowledgement before reporting success. CLI mission FTP uploads still require a filename.

Add a Non Default parameter filter using defaults reported by the selected vehicle. It combines with text search and refreshes as parameter values or defaults change. When defaults are unavailable, the editor explains how to fetch them.

Also fix console shutdown: after the close timeout, terminate and reap an unresponsive GUI child, escalating to kill if it ignores SIGTERM. Previously the child could keep Python waiting indefinitely after Ctrl-C.

Mission editor startup now passes only GUI queues and configuration to the child process, avoiding serialization of closed MAVProxy handles with Python 3.14 forkserver or spawn.

Validation:

  • Mission startup, transfers, and geometry: 91 tests and 5 subtests passed. The startup regression reproduces the original closed-handle error before the fix on spawn and forkserver, and passes after it on spawn, forkserver, and fork.
  • A real wx mission editor opened with an empty mission and closed cleanly using Python 3.14 forkserver.
  • Editor and FTP suites: 77 tests and 11 subtests passed.
  • Real wx checks confirmed Write uses PARAM_SET with either checkbox state and Fetch all follows the MAVFTP choice.
  • Also checked mission checkbox layout, transfer success/failure feedback, preservation of edits during mission downloads, and Non Default filtering in real wx editors.
  • Earlier shutdown validation covered a normal console and an unresponsive console child that ignores SIGTERM.
  • No live vehicle testing.

tridge added 2 commits October 2, 2026 14:34
Default both editors to MAVFTP for reads and writes, uploading only changed parameters and reporting transfer results in the UI. Keep pending edits on failure and mark missions synced only after successful transfers.

Pass vehicle defaults into the parameter editor so the Non Default filter stays current as parameters and defaults change.
The console previously returned after a two-second close timeout, leaving Python to wait indefinitely for a surviving GUI child. Terminate and, if necessary, kill and reap that child so Ctrl-C can finish shutdown even when it ignores SIGTERM.

Close the parent pipes and ignore late writes after cleanup. Cover both cooperative and unresponsive children, including a real MAVProxy SIGINT shutdown.
@tridge tridge added the AIReview label Oct 2, 2026
@AP-Review

AP-Review commented Oct 2, 2026 •

Copy link
Copy Markdown

Deprecated — see below for the updated review.

Previous review (2026-10-02)

Automated review note — AI-generated (Claude), validated against the live diff. Please sanity-check before acting.
Verdict: REQUEST CHANGES

Reviewed at head d96add8cae.
Full report: https://firmware.ardupilot.org/Tools/APReview/DevCallReviews/PRReviews/ardupilot/mavproxy/1766/1.html#prMAVProxy-1766

Thanks, the console shutdown fix and the editor MAVFTP support look good. The shutdown regression tests fail on the base and pass here, and the stricter mission download validation is a nice improvement.

One thing needs changing before merge. wp_ftp_upload now uploads the current loader when args is empty, but it is also the handler for wp ftpload, fence ftpload and rally ftpload. If the filename is forgotten, it no longer fails with an IndexError. It sends whatever is in the loader, possibly a zero-item file with options=0, and ArduPilot's finish_upload_mission() then clears the vehicle mission (fence and rally lists are replaced the same way). https://github.com/ArduPilot/MAVProxy/pull/1766/files#diff-67743c54e074d62f6942f6f146caf0b98e284d9b9c31d1115d94aee65a62e660R1122. Please keep the filename mandatory on the CLI path, for example with a usage error when args is empty and no callback is given, or give the editor its own entry point.

Smaller items, none blocking:

tridge added 2 commits October 2, 2026 19:49
Wait for the FTP close acknowledgement and verify only uploaded parameter names with targeted MAVLink reads, so rejected writes remain pending without refetching all parameters. Submit editor FTP operations on the main loop and discard stale vehicle results while preserving mission edits made during downloads. Require a filename for CLI mission uploads to prevent accidental uploads of cached or empty missions.
Limit the parameter editor MAVFTP checkbox to Fetch all and restore Write to PARAM_SET. Remove the new parameter FTP upload API and verification reads so changing a few parameters requires no extra fetch; FTP writes of changed parameters are deferred to a future PR.
Assigning mpstate before starting a bound child target caused spawn and forkserver to serialize live MAVProxy state, including closed connections. Use a static GUI entry point with explicit queues and configuration, and initialize the stop flag before starting worker threads. Cover empty-mission startup with closed parent handles on spawn, forkserver and fork.
@tridge
tridge merged commit a7ac12d into ArduPilot:master Oct 3, 2026
3 checks passed
@AP-Review

Copy link
Copy Markdown

Automated review note — AI-generated (Claude), validated against the live diff. Please sanity-check before acting.
Verdict: COMMENT

Reviewed at head 50b68069cc.
Full report: https://firmware.ardupilot.org/Tools/APReview/DevCallReviews/PRReviews/ardupilot/mavproxy/1766/2.html#prMAVProxy-1766

Thanks for the update. This follow-up covers commit 50b6806; the PR has since moved to 996623a, which I haven't reviewed. The earlier blocker is fixed: a bare wp/fence/rally ftpload now prints a usage message, and the editor uses its own ftp_upload. Five of the six smaller items are resolved too, and the socket-free PR tests pass at 50b6806.

Remaining suggestions, none blocking:

SITL, real hardware and a displayed GUI were not exercised.

Head moved during review: observed 996623a598ed6ba7324c74be1162358cd535f10b. This review covers only 50b68069cc58b87357621655027a6beefce90373; followup eligible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants