Unknown commands and double bed meshing

Basic Information:

Printer Model: Ender 3 V2
MCU / Printerboard: Creality 4.2.2
klippy.log

Fill out above information and in all cases attach your klippy.log file. Pasting your printer.cfg is not needed
Be sure to check our Knowledge Base and in particular this and this post

Describe your issue:

So I had to do a fresh install of Klipper. I copied over my printer config that I was working on beforehand. I tried to run a test print and got the following in the console:

2:55 PM

bed_mesh: generated points
Index | Tool Adjusted | Probe

2:54 PM

Generating new points…

2:54 PM

Points: x: 5, y: 5

2:54 PM

Algorithm: lagrange

2:54 PM

Object bounds, clamped to the bed_mesh: (15.0, 15.0), (225.0, 225.0)

2:54 PM

0 object points, clamping to bed mesh [(15.0, 15.0) (225.0, 225.0)]

2:54 PM

Unknown command:“BED_MESH_CALIBRATE_BASE”

2:54 PM

Unknown command:“GCODE:”

2:54 PM

Unknown command:“VARIABLE_ENABLE_REFERENCE_INDEX:”

2:54 PM

Unknown command:“VARIABLE_PROBE_COUNT_SCALE_FACTOR: 1.0”

2:54 PM

Unknown command:“VARIABLE_MIN_PROBE_COUNT: 3”

2:54 PM

Unknown command:“VARIABLE_PROBE_SAMPLES: 2”

2:54 PM

Unknown command:“VARIABLE_MESH_AREA_OFFSET: 5.0”

2:54 PM

Unknown command:“VARIABLE_PARAMETER_AREA_END: 0,0”

2:54 PM

Unknown command:“VARIABLE_PARAMETER_AREA_START: 0,0”

2:54 PM

Unknown command:“RENAME_EXISTING:”

2:54 PM

Unknown command:“GCODE_MACRO”

Then it did the bed mesh. Then it did the bed mesh a second time after printing the prime lines, shut the bed heater off and started printing without doing prime lines. I looked over the config file and can’t see any reason why it did the bed mesh twice. Am I missing something? Thanks.
klippy.log (814.2 KB)

It seems there is something wrong withe PRINT_START macro:

[gcode_macro PRINT_START]
gcode = 
	{% set BED_TEMP = params.BED_TEMP|float %}
	{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|float %}
	
	M140 S{BED_TEMP}
	[gcode_macro BED_MESH_CALIBRATE]
	rename_existing: BED_MESH_CALIBRATE_BASE
	variable_parameter_AREA_START : 0,0
	variable_parameter_AREA_END : 0,0
	variable_mesh_area_offset : 5.0
	variable_probe_samples : 2
	variable_min_probe_count : 3
	variable_probe_count_scale_factor : 1.0
	variable_enable_reference_index : False
...
	{% if enable_reference_index %}
	{% set referenceIndex = (meshPointX * meshPointY / 2 - 1 )|round(0)|int %}
	BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int} algorithm={algorithm} relative_reference_index={referenceIndex}
	{% else %}
	BED_MESH_CALIBRATE_BASE mesh_min={area_min_x},{area_min_y} mesh_max={area_max_x},{area_max_y} probe_count={meshPointX},{meshPointY} samples={probe_samples|int} algorithm={algorithm}
	{% endif %}
	{% else %}
	BED_MESH_CALIBRATE_BASE
	{% endif %}
	{% else %}
	BED_MESH_CALIBRATE_BASE
	{% endif %}
...

Something obviously happened during that process.

I have no idea what lol. Print just finished but it didn’t execute any movements in the end print code:

[gcode_macro END_PRINT]
gcode:
    # Turn off bed, extruder, and fan
    M140 S0
    M104 S0
    M106 S0
    # Move nozzle away from print while retracting
    G91
    G1 X5 Y225 E-3 F300
    # Raise nozzle by 10mm
    G1 Z10 F3000
    G90
    # Disable steppers
    M84

And I got this in the console:

4:11 PM Move out of range: 157.039 333.229 8.913 [3080.863]
4:11 PM Move out of range: 157.039 333.229 8.913 [3080.863]

You set to relative positioning with G91 (G-code - RepRap) and add 225 to the actual position.

This macro should look this way:

[gcode_macro END_PRINT]
gcode:
    # Turn off bed, extruder, and fan
    M140 S0
    M104 S0
    M106 S0
    # Raise nozzle by 10mm
    G91
    G1 Z10 F3000
    G90
    # Move nozzle away from print while retracting
    G1 X5 Y225 E-3 F300
    # Disable steppers
    M84

First move up the print head 10 mm to avoid collision and move it out of the way.

1 Like

Ok that fixed the end. Still don’t know what’s wrong with the start that’s causing all the unknown errors. Also when I try to calibrate a new mesh manually in Klipper I get

Unknown command:"_BED_MESH_CALIBRATE"

Don’t know what I did but bed mesh calibrate is working…