Creality

KAMP-K2 — adaptive bed mesh and line purging that work on the Creality K2

A fork of upstream KAMP with the K2-specific glue Creality's firmware needs to make adaptive meshing actually work. Free, GPL v3, one-line install.

Published 2026-05-05

Most K2 owners have noticed that whatever the print is — a 30 mm calibration cube, a tiny benchy, a bracket the size of a fingernail — the printer probes a full 7×7 grid across the entire bed before it starts. That's roughly 108 seconds of probing every print, regardless of whether the part fits in a 3 cm corner. Forty-nine measured points to print four square centimetres of plastic.

After a few months of digging into why, and a couple of false starts, we've released KAMP-K2 — a fork of kyleisah/Klipper-Adaptive-Meshing-Purging that brings KAMP's adaptive meshing and adaptive line purging to the Creality K2 family. It's free, GPL-licensed, and installs with a single command on Windows, Mac or Linux.

Why upstream KAMP doesn't just work on the K2

Two things in Creality's K2 firmware fight against any KAMP install you try:

1. prtouch_v3_wrapper.so hijacks the BED_MESH_CALIBRATE command. Creality ship a compiled binary that replaces Klipper's adaptive-mesh handler with a non-adaptive version. It ignores MESH_MIN, MESH_MAX and PROBE_COUNT arguments, and on some firmware revisions it crashes with IndexError when those parameters are passed. 2. master-server fires G29 and BED_MESH_CALIBRATE_START_PRINT independently. The C++ master-server daemon runs its own pre-print sequence and triggers a stock full-bed mesh before any slicer start-gcode runs. Even with a perfectly configured Orca profile, the K2 was probing the whole bed every time.

KAMP-K2 solves both:

  • extras/restore_bed_mesh.py — a small Klipper extras module that re-registers Klipper's upstream cmd_BED_MESH_CALIBRATE handler and wraps it with a guard. Bare calls (from master-server) become no-ops; calls with MESH_MIN/MESH_MAX bounds (from KAMP) run adaptively as intended.
  • Macro hijacksG29 and BED_MESH_CALIBRATE_START_PRINT are replaced with no-op macros that emit a fake [G29_TIME]Execution time: 0.0 so master-server's response parser is happy.
  • START_PRINT patches — KAMP's adaptive mesh and LINE_PURGE are inserted at the right point in the K2's CFS-aware print-prep flow.

Upstream KAMP's own configuration files (Adaptive_Meshing.cfg, Line_Purge.cfg, KAMP_Settings.cfg) are included unchanged. KAMP-K2 only adds the K2-specific glue — it never modifies KAMP's own behaviour, so existing KAMP knowledge transfers straight across.

What you actually get

For a 30 mm calibration cube, the K2 used to probe a 49-point full-bed mesh. With KAMP-K2 installed, the same cube triggers a 16-point mesh covering only the print area — about a third of the time, with roughly 3.7× higher mesh density right under your part. Big prints still get a full mesh; small parts in a corner get a corner mesh. The slicer figures out the bounding box, KAMP turns it into adaptive parameters, and Klipper's upstream code does the rest.

You also get adaptive line purging — the prime line follows the perimeter of your print rather than always running across the front of the bed. Less wasted filament, less first-layer adhesion variance.

Install (one line)

On Windows, in PowerShell (not cmd.exe):

```powershell iwr -useb https://raw.githubusercontent.com/grant0013/KAMP-K2/main/bootstrap.ps1 | iex ```

On macOS or Linux:

```sh curl -fsSL https://raw.githubusercontent.com/grant0013/KAMP-K2/main/install.sh | bash ```

The installer prompts for your printer's IP, SSHs in (using the Creality stock root password by default), backs up your printer.cfg, drops the extras module and macro overrides into place, and restarts Klippy. The whole thing takes about a minute. To revert later, re-run with --revert.

If you'd rather do it manually, the README has a full step-by-step plus a separate docs/INSTALL_K2.md explaining what each step changes.

Compatibility

| Printer | Board | KAMP-K2 needed? | |---|---|---| | K2 / K2 Combo / K2 Pro | CR0CN200400C10 (F021) | Yes — only adaptive option | | K2 Plus | CR0CN240319C13 (F008) | Optional — Creality's own toggle is unreliable | | K1 / K1C / K1 Max | CR4CU220812S* | Should work — untested, please file an issue if you try | | Non-Creality Klipper printer | — | Use upstream KAMP directly |

Confirmed working on a stock K2 Combo with firmware V1.1.4.1.

Slicer setup (OrcaSlicer)

Replace your printer's start-gcode with:

``` START_PRINT EXTRUDER_TEMP=[nozzle_temperature_initial_layer] BED_TEMP=[bed_temperature_initial_layer_single] T[initial_no_support_extruder] LINE_PURGE M204 S2000 M83 ```

The order matters — T<n> triggers the CFS to actually load filament, and LINE_PURGE must run after that or there's no filament in the nozzle to purge with. Make sure Label objects is enabled in your output settings; that's what writes the EXCLUDE_OBJECT_DEFINE lines KAMP reads.

Bambu Studio uses the same syntax. PrusaSlicer / SuperSlicer should also work but are untested. The repo includes a slicer_gcode.py helper that prints a ready-to-paste block for whichever slicer you use.

Verifying it worked

In your gcode console after slicing a small test print, you should see:

``` // Algorithm: bicubic. // Default probe count: 11,11. // Adapted probe count: 4,4. // Default mesh bounds: (5, 5), (255, 255). // Adapted mesh bounds: (106.0, 39.0), (154.0, 221.0). // KAMP adjustments successful. Happy KAMPing! ```

The probe should walk only the area covering your printed objects, not the full bed.

Companion project

K2-Screws-Tilt — same author, same install UX, brings Klipper's SCREWS_TILT_CALCULATE helper to the K2 family. Use it once during initial setup to get the bed manually levelled, then KAMP-K2 handles the per-print mesh from there.

Issues and contributions welcome

Code is GPL v3. If something doesn't work on your variant — the K1 and K2 Plus paths in particular are untested — file an issue on the GitHub repo. Confirmation reports either way are valued just as much as bug reports.