tool_probe: update for latest Klipper probe API - #174
Open
orion23rigel wants to merge 2 commits into
Open
Conversation
orion23rigel
force-pushed
the
tool-probe-latest-klipper-api
branch
from
June 7, 2026 13:50
180da5b to
0bded50
Compare
Vylyne
pushed a commit
to Vylyne/klipper-toolchanger-easy
that referenced
this pull request
Jun 15, 2026
Recent Klipper versions (post May 2026) significantly refactored the probe module internals: - ProbeEndstopWrapper now requires (config, probe_offsets, param_helper) instead of just (config) - ProbeSessionHelper was renamed to SampleAveragingHelper - HomingViaProbeHelper was simplified to (config, position_endstop, query_endstop_cb) — it no longer accepts mcu_probe/offsets/param_helper - ProbeEndstopWrapper no longer exposes home_start/home_wait/ multi_probe_begin/multi_probe_end — probing now goes through start_probe_session()/run_probe()/pull_probed_results() This updates tool_probe.py and tool_probe_endstop.py to use the current Klipper probe API: - Pass ProbeOffsetsHelper and ProbeParameterHelper to ProbeEndstopWrapper - Use Klipper's SampleAveragingHelper instead of the custom ProbeSessionHelper (preserves multi-sample averaging and tolerance) - Delegate probe params to ProbeParameterHelper - Use standard HomingViaProbeHelper to register probe:z_virtual_endstop - Remove obsolete EndstopRouter MCU-endstop proxy bindings that current ProbeEndstopWrapper no longer exposes - Remove ToolProbeOffsetsHelper (no longer needed) Without this fix, Klipper fails at startup with: __init__() takes from 3 to 4 positional arguments but 2 were given Adapted from viesturz/klipper-toolchanger PR viesturz#174. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Looking forward to official merge! Running a dirty copy atm with the fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the tool probe integration for recent Klipper probe API changes.
Recent Klipper versions changed the internal probe virtual-endstop and probe-session APIs. With current Klipper, klipper-toolchanger can fail during startup with:
This updates the tool probe code to use the current probe API:
ProbeOffsetsHelperandProbeParameterHelpertoProbeEndstopWrapperProbeSessionHelperwithSampleAveragingHelperHomingViaProbeHelperto registerprobe:z_virtual_endstopProbeEndstopWrapperno longer exposesCurrent Klipper uses
get_position_endstoponly to identify virtual-probe homing; the active probe session supplies the actual per-tool probe offset. Therefore the standard helper can use a static marker value while probe results remain dynamically routed through the active tool probe.Testing
Validated on a toolchanger printer running current Klipper. Standalone Z homing and print-start probing correctly respect the active tool probe offset after removing an unrelated legacy config-level coordinate override.
Also validated against upstream Klipper
2fb3d54e2and ran: