=============== Log rollover at Sat Apr 13 00:19:32 2024 =============== Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-155-g4cfa266e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 00:19:53 2024 (1712967593.8 38.9) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0 restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' webhooks client 281473846702768: New connection webhooks client 281473846702768: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3487): Fri Apr 12 21:24:19 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h743xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x200000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set # CONFIG_MACH_STM32H723 is not set CONFIG_MACH_STM32H743=y # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_USB_PB14_PB15 is not set # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8201): Fri Apr 12 22:35:08 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi2b=PI2,PI3,PI1 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h743xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1789236): Fri Apr 12 22:35:26 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-155-g4cfa266e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 00:31:21 2024 (1712968281.4 20.7) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0 restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' webhooks client 281472797481472: New connection webhooks client 281472797481472: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-155-g4cfa266e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 00:31:41 2024 (1712968301.0 41.4) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0 restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' webhooks client 281473742489200: New connection webhooks client 281473742489200: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0: [Errno 2] No such file or directory: '/devices/platform/soc/5200000.usb/usb2/2-1/2-1.1/2-1.1:1.0/0003:04D9:8030.0001/input/input0' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3487): Fri Apr 12 21:24:19 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h743xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x200000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set # CONFIG_MACH_STM32H723 is not set CONFIG_MACH_STM32H743=y # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_USB_PB14_PB15 is not set # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8201): Fri Apr 12 22:35:08 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi2b=PI2,PI3,PI1 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h743xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1789236): Fri Apr 12 22:35:26 2024 Unable to issue reset command on MCU 'mcu' webhooks client 281473742489200: Disconnected Restarting printer Start printer at Sat Apr 13 00:41:46 2024 (1712968906.8 520.1) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-BIQU_BTT-HDMI7_SN0000000003-if00 restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') webhooks client 281473742837264: New connection webhooks client 281473742837264: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3487): Fri Apr 12 21:24:19 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h743xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x200000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set # CONFIG_MACH_STM32H723 is not set CONFIG_MACH_STM32H743=y # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_USB_PB14_PB15 is not set # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8201): Fri Apr 12 22:35:08 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi2b=PI2,PI3,PI1 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h743xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1789236): Fri Apr 12 22:35:26 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-155-g4cfa266e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 00:31:22 2024 (1712968282.3 22.0) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-BIQU_BTT-HDMI7_SN0000000003-if00 restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') webhooks client 281472838586224: New connection webhooks client 281472838586224: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3487): Fri Apr 12 21:24:19 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h743xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x200000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set # CONFIG_MACH_STM32H723 is not set CONFIG_MACH_STM32H743=y # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_USB_PB14_PB15 is not set # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8201): Fri Apr 12 22:35:08 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi2b=PI2,PI3,PI1 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h743xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1789236): Fri Apr 12 22:35:26 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-155-g4cfa266e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 00:31:32 2024 (1712968292.6 31.8) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-BIQU_BTT-HDMI7_SN0000000003-if00 restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') webhooks client 281473842987696: New connection webhooks client 281473842987696: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3446): Sat Apr 13 00:49:37 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h723xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x40000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set CONFIG_MACH_STM32H723=y # CONFIG_MACH_STM32H743 is not set # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8201): Fri Apr 12 22:35:08 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi2b=PI2,PI3,PI1 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h743xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1789236): Fri Apr 12 22:35:26 2024 Unable to issue reset command on MCU 'mcu' webhooks client 281473842987696: Disconnected Restarting printer Start printer at Sat Apr 13 01:02:00 2024 (1712970120.2 858.2) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-BIQU_BTT-HDMI7_SN0000000003-if00 restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') webhooks client 281473843117888: New connection webhooks client 281473843117888: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-155-g4cfa266e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 00:31:21 2024 (1712968281.9 21.9) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-BIQU_BTT-HDMI7_SN0000000003-if00 restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') webhooks client 281473369725056: New connection mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') webhooks client 281473369725056: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3446): Sat Apr 13 00:49:37 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h723xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x40000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set CONFIG_MACH_STM32H723=y # CONFIG_MACH_STM32H743 is not set # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8145): Sat Apr 13 00:50:44 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1678828): Sat Apr 13 00:51:03 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-155-g4cfa266e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 00:31:32 2024 (1712968292.1 32.9) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-BIQU_BTT-HDMI7_SN0000000003-if00 restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') webhooks client 281473272981008: New connection webhooks client 281473272981008: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3446): Sat Apr 13 00:49:37 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h723xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x40000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set CONFIG_MACH_STM32H723=y # CONFIG_MACH_STM32H743 is not set # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8145): Sat Apr 13 00:50:44 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1678828): Sat Apr 13 00:51:03 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-155-g4cfa266e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 00:31:21 2024 (1712968282.0 22.0) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-BIQU_BTT-HDMI7_SN0000000003-if00 restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') webhooks client 281473040850800: New connection mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') webhooks client 281473040850800: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3446): Sat Apr 13 00:49:37 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h723xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x40000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set CONFIG_MACH_STM32H723=y # CONFIG_MACH_STM32H743 is not set # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8145): Sat Apr 13 00:50:44 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1678828): Sat Apr 13 00:51:03 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-155-g4cfa266e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 00:31:29 2024 (1712968289.5 29.8) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-BIQU_BTT-HDMI7_SN0000000003-if00 restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') webhooks client 281472884142768: New connection webhooks client 281472884142768: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3446): Sat Apr 13 00:49:37 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h723xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x40000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set CONFIG_MACH_STM32H723=y # CONFIG_MACH_STM32H743 is not set # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8145): Sat Apr 13 00:50:44 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1678828): Sat Apr 13 00:51:03 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-155-g4cfa266e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 00:31:22 2024 (1712968282.3 22.4) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-BIQU_BTT-HDMI7_SN0000000003-if00 restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') webhooks client 281473699833984: New connection webhooks client 281473699833984: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') mcu 'mcu': Unable to open serial port: Could not configure port: (22, 'Invalid argument') Unable to issue reset command on MCU 'mcu' webhooks client 281473699833984: Disconnected Restarting printer Start printer at Sat Apr 13 00:32:13 2024 (1712968333.8 74.0) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473775306448: New connection webhooks client 281473775306448: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-155-g4cfa266e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 09:18:09 2024 (1712999889.5 42.8) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473406010032: New connection webhooks client 281473406010032: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3446): Sat Apr 13 00:49:37 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h723xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x40000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set CONFIG_MACH_STM32H723=y # CONFIG_MACH_STM32H743 is not set # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8145): Sat Apr 13 00:50:44 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1678828): Sat Apr 13 00:51:03 2024 Unable to issue reset command on MCU 'mcu' webhooks client 281473406010032: Disconnected Restarting printer Start printer at Sat Apr 13 09:25:50 2024 (1713000350.5 446.8) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473406124672: New connection webhooks client 281473406124672: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3446): Sat Apr 13 00:49:37 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h723xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x40000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set CONFIG_MACH_STM32H723=y # CONFIG_MACH_STM32H743 is not set # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8145): Sat Apr 13 00:50:44 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1678828): Sat Apr 13 00:51:03 2024 Unable to issue reset command on MCU 'mcu' webhooks client 281473406124672: Disconnected Restarting printer Start printer at Sat Apr 13 09:27:45 2024 (1713000465.8 562.2) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473413729392: New connection webhooks client 281473413729392: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3446): Sat Apr 13 00:49:37 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h723xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x40000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set CONFIG_MACH_STM32H723=y # CONFIG_MACH_STM32H743 is not set # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8145): Sat Apr 13 00:50:44 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1678828): Sat Apr 13 00:51:03 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-155-g4cfa266e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 09:40:17 2024 (1713001217.4 22.0) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473503812096: New connection webhooks client 281473503812096: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3446): Sat Apr 13 00:49:37 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h723xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x40000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set CONFIG_MACH_STM32H723=y # CONFIG_MACH_STM32H743 is not set # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8145): Sat Apr 13 00:50:44 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1678828): Sat Apr 13 00:51:03 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-155-g4cfa266e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 09:40:36 2024 (1713001236.5 42.1) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473219755456: New connection webhooks client 281473219755456: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3446): Sat Apr 13 00:49:37 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h723xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x40000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set CONFIG_MACH_STM32H723=y # CONFIG_MACH_STM32H743 is not set # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8145): Sat Apr 13 00:50:44 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1678828): Sat Apr 13 00:51:03 2024 Unable to issue reset command on MCU 'mcu' webhooks client 281473219755456: Disconnected Restarting printer Start printer at Sat Apr 13 09:48:36 2024 (1713001716.7 357.6) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473220108096: New connection webhooks client 281473220108096: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3446): Sat Apr 13 00:49:37 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h723xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x40000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set CONFIG_MACH_STM32H723=y # CONFIG_MACH_STM32H743 is not set # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8145): Sat Apr 13 00:50:44 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1678828): Sat Apr 13 00:51:03 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-155-g4cfa266e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 09:40:17 2024 (1713001217.4 22.4) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473593256064: New connection mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473593256064: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3446): Sat Apr 13 00:49:37 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h723xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x40000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set CONFIG_MACH_STM32H723=y # CONFIG_MACH_STM32H743 is not set # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8145): Sat Apr 13 00:50:44 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1678828): Sat Apr 13 00:51:03 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-158-g36f9b26e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 10:23:47 2024 (1713003827.5 1602.1) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473575382704: New connection webhooks client 281473575382704: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-158-g36f9b26e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 10:17:15 2024 (1713003435.6 22.5) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473484324720: New connection mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473484324720: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3446): Sat Apr 13 00:49:37 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h723xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x40000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set CONFIG_MACH_STM32H723=y # CONFIG_MACH_STM32H743 is not set # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8145): Sat Apr 13 00:50:44 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1678828): Sat Apr 13 00:51:03 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-158-g36f9b26e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 10:17:33 2024 (1713003453.6 40.7) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281472874962368: New connection webhooks client 281472874962368: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3446): Sat Apr 13 00:49:37 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h723xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x40000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set CONFIG_MACH_STM32H723=y # CONFIG_MACH_STM32H743 is not set # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8145): Sat Apr 13 00:50:44 2024 Last MCU build version: v0.12.0-155-g4cfa266e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1678828): Sat Apr 13 00:51:03 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-158-g36f9b26e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 10:17:14 2024 (1713003434.7 21.1) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473408073392: New connection webhooks client 281473408073392: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3446): Sat Apr 13 10:52:49 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h723xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x40000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8000000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set CONFIG_MACH_STM32H723=y # CONFIG_MACH_STM32H743 is not set # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 # CONFIG_STM32_FLASH_START_20000 is not set CONFIG_STM32_FLASH_START_0000=y # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8145): Sat Apr 13 10:53:55 2024 Last MCU build version: v0.12.0-158-g36f9b26e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1676336): Sat Apr 13 10:54:14 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-158-g36f9b26e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 11:12:18 2024 (1713006738.6 779.0) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281472971244208: New connection webhooks client 281472971244208: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-158-g36f9b26e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 11:13:52 2024 (1713006832.2 20.1) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473654292336: New connection mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473654292336: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(914): Sat Apr 13 11:11:15 2024 ========= Last MCU build config ========= # CONFIG_LOW_LEVEL_OPTIONS is not set # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set # CONFIG_MACH_STM32 is not set # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set CONFIG_MACH_LINUX=y # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="linux" CONFIG_CLOCK_FREQ=50000000 CONFIG_LINUX_SELECT=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER="12345" CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(9526): Sat Apr 13 11:11:49 2024 Last MCU build version: v0.12.0-158-g36f9b26e Last MCU build tools: gcc: (Debian 10.2.1-6) 10.2.1 20210110 binutils: (GNU Binutils for Debian) 2.35.2 Last MCU build config: ADC_MAX=4095 CLOCK_FREQ=50000000 MCU=linux PCA9685_MAX=4096 PWM_MAX=32768 STATS_SUMSQ_BASE=256 Build file /home/biqu/klipper/klippy/../out/klipper.elf(881824): Sat Apr 13 11:12:02 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-158-g36f9b26e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 11:17:32 2024 (1713007052.3 36.6) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281472823606720: New connection webhooks client 281472823606720: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(914): Sat Apr 13 11:11:15 2024 ========= Last MCU build config ========= # CONFIG_LOW_LEVEL_OPTIONS is not set # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set # CONFIG_MACH_STM32 is not set # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set CONFIG_MACH_LINUX=y # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="linux" CONFIG_CLOCK_FREQ=50000000 CONFIG_LINUX_SELECT=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER="12345" CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(9526): Sat Apr 13 11:11:49 2024 Last MCU build version: v0.12.0-158-g36f9b26e Last MCU build tools: gcc: (Debian 10.2.1-6) 10.2.1 20210110 binutils: (GNU Binutils for Debian) 2.35.2 Last MCU build config: ADC_MAX=4095 CLOCK_FREQ=50000000 MCU=linux PCA9685_MAX=4096 PWM_MAX=32768 STATS_SUMSQ_BASE=256 Build file /home/biqu/klipper/klippy/../out/klipper.elf(881824): Sat Apr 13 11:12:02 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-158-g36f9b26e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 11:17:14 2024 (1713007034.7 18.7) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473045020528: New connection webhooks client 281473045020528: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(914): Sat Apr 13 11:11:15 2024 ========= Last MCU build config ========= # CONFIG_LOW_LEVEL_OPTIONS is not set # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set # CONFIG_MACH_STM32 is not set # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set CONFIG_MACH_LINUX=y # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="linux" CONFIG_CLOCK_FREQ=50000000 CONFIG_LINUX_SELECT=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER="12345" CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(9526): Sat Apr 13 11:11:49 2024 Last MCU build version: v0.12.0-158-g36f9b26e Last MCU build tools: gcc: (Debian 10.2.1-6) 10.2.1 20210110 binutils: (GNU Binutils for Debian) 2.35.2 Last MCU build config: ADC_MAX=4095 CLOCK_FREQ=50000000 MCU=linux PCA9685_MAX=4096 PWM_MAX=32768 STATS_SUMSQ_BASE=256 Build file /home/biqu/klipper/klippy/../out/klipper.elf(881824): Sat Apr 13 11:12:02 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-158-g36f9b26e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 11:17:25 2024 (1713007045.3 30.4) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281472996245168: New connection webhooks client 281472996245168: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(914): Sat Apr 13 11:11:15 2024 ========= Last MCU build config ========= # CONFIG_LOW_LEVEL_OPTIONS is not set # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set # CONFIG_MACH_STM32 is not set # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set CONFIG_MACH_LINUX=y # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="linux" CONFIG_CLOCK_FREQ=50000000 CONFIG_LINUX_SELECT=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER="12345" CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(9526): Sat Apr 13 11:11:49 2024 Last MCU build version: v0.12.0-158-g36f9b26e Last MCU build tools: gcc: (Debian 10.2.1-6) 10.2.1 20210110 binutils: (GNU Binutils for Debian) 2.35.2 Last MCU build config: ADC_MAX=4095 CLOCK_FREQ=50000000 MCU=linux PCA9685_MAX=4096 PWM_MAX=32768 STATS_SUMSQ_BASE=256 Build file /home/biqu/klipper/klippy/../out/klipper.elf(881824): Sat Apr 13 11:12:02 2024 Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-158-g36f9b26e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 11:17:14 2024 (1713007034.9 19.5) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473716440944: New connection webhooks client 281473716440944: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(914): Sat Apr 13 11:11:15 2024 ========= Last MCU build config ========= # CONFIG_LOW_LEVEL_OPTIONS is not set # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set # CONFIG_MACH_STM32 is not set # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set CONFIG_MACH_LINUX=y # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="linux" CONFIG_CLOCK_FREQ=50000000 CONFIG_LINUX_SELECT=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER="12345" CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(9526): Sat Apr 13 11:11:49 2024 Last MCU build version: v0.12.0-158-g36f9b26e Last MCU build tools: gcc: (Debian 10.2.1-6) 10.2.1 20210110 binutils: (GNU Binutils for Debian) 2.35.2 Last MCU build config: ADC_MAX=4095 CLOCK_FREQ=50000000 MCU=linux PCA9685_MAX=4096 PWM_MAX=32768 STATS_SUMSQ_BASE=256 Build file /home/biqu/klipper/klippy/../out/klipper.elf(881824): Sat Apr 13 11:12:02 2024 webhooks client 281473716440944: Disconnected Restarting printer Start printer at Sat Apr 13 11:32:55 2024 (1713007975.2 233.5) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473717444768: New connection webhooks client 281473717444768: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} Starting Klippy... Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock'] Git version: 'v0.12.0-158-g36f9b26e-dirty' Untracked files: klippy/extras/gcode_shell_command.py Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]' Start printer at Sat Apr 13 11:33:32 2024 (1713008012.9 38.9) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473544885872: New connection webhooks client 281473544885872: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(914): Sat Apr 13 11:11:15 2024 ========= Last MCU build config ========= # CONFIG_LOW_LEVEL_OPTIONS is not set # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set # CONFIG_MACH_STM32 is not set # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set CONFIG_MACH_LINUX=y # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="linux" CONFIG_CLOCK_FREQ=50000000 CONFIG_LINUX_SELECT=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER="12345" CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(9526): Sat Apr 13 11:11:49 2024 Last MCU build version: v0.12.0-158-g36f9b26e Last MCU build tools: gcc: (Debian 10.2.1-6) 10.2.1 20210110 binutils: (GNU Binutils for Debian) 2.35.2 Last MCU build config: ADC_MAX=4095 CLOCK_FREQ=50000000 MCU=linux PCA9685_MAX=4096 PWM_MAX=32768 STATS_SUMSQ_BASE=256 Build file /home/biqu/klipper/klippy/../out/klipper.elf(881824): Sat Apr 13 11:12:02 2024 Attempting MCU 'mcu' reset Unhandled exception during post run Traceback (most recent call last): File "/home/biqu/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 265, in open self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK) PermissionError: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 234, in run self.send_event("klippy:firmware_restart") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 953, in _firmware_restart self._restart_arduino() File "/home/biqu/klipper/klippy/mcu.py", line 913, in _restart_arduino serialhdl.arduino_reset(self._serialport, self._reactor) File "/home/biqu/klipper/klippy/serialhdl.py", line 379, in arduino_reset ser = serial.Serial(serialport, 2400, timeout=0, exclusive=True) File "/home/biqu/klippy-env/lib/python3.9/site-packages/serial/serialutil.py", line 240, in __init__ self.open() File "/home/biqu/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 268, in open raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg)) serial.serialutil.SerialException: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' Restarting printer Start printer at Sat Apr 13 11:37:12 2024 (1713008232.1 247.7) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if restart_method = command [temperature_sensor Lerdge_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473544887312: New connection webhooks client 281473544887312: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(914): Sat Apr 13 11:11:15 2024 ========= Last MCU build config ========= # CONFIG_LOW_LEVEL_OPTIONS is not set # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set # CONFIG_MACH_STM32 is not set # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set CONFIG_MACH_LINUX=y # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="linux" CONFIG_CLOCK_FREQ=50000000 CONFIG_LINUX_SELECT=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER="12345" CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(9526): Sat Apr 13 11:11:49 2024 Last MCU build version: v0.12.0-158-g36f9b26e Last MCU build tools: gcc: (Debian 10.2.1-6) 10.2.1 20210110 binutils: (GNU Binutils for Debian) 2.35.2 Last MCU build config: ADC_MAX=4095 CLOCK_FREQ=50000000 MCU=linux PCA9685_MAX=4096 PWM_MAX=32768 STATS_SUMSQ_BASE=256 Build file /home/biqu/klipper/klippy/../out/klipper.elf(881824): Sat Apr 13 11:12:02 2024 Unable to issue reset command on MCU 'mcu' webhooks client 281473544887312: Disconnected Restarting printer Start printer at Sat Apr 13 11:43:12 2024 (1713008592.3 607.9) ===== Config file ===== [exclude_object] [pause_resume] [display_status] [respond] [printer] kinematics = cartesian max_velocity = 300 max_accel = 3000 max_z_velocity = 5 max_z_accel = 100 [mcu] serial = /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if restart_method = command [temperature_sensor BTT_MCU] sensor_type = temperature_mcu [temperature_sensor Host] sensor_type = temperature_host [virtual_sdcard] path = ~/printer_data/gcodes on_error_gcode = CANCEL_PRINT [input_shaper] shaper_freq_x = 29.4 shaper_type_x = mzv shaper_freq_y = 40.2 shaper_type_y = 2hump_ei [firmware_retraction] retract_length = 2 retract_speed = 35 unretract_extra_length = 0 unretract_speed = 35 [gcode_arcs] resolution = 0.1 [stepper_x] step_pin = PD4 dir_pin = !PD3 enable_pin = !PD6 microsteps = 64 rotation_distance = 40 endstop_pin = tmc2209_stepper_x:virtual_endstop position_endstop = 0 position_min = 0 position_max = 238 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_x] uart_pin = PD5 run_current = 0.6 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC1 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_y] step_pin = PA15 dir_pin = PA8 enable_pin = !PD1 microsteps = 64 rotation_distance = 39.95 endstop_pin = tmc2209_stepper_y:virtual_endstop position_endstop = 0 position_min = 0 position_max = 200 homing_speed = 25 homing_retract_dist = 0 [tmc2209 stepper_y] uart_pin = PD0 run_current = 0.600 hold_current = 0.400 sense_resistor = 0.110 diag_pin = ^PC3 driver_sgthrs = 50 stealthchop_threshold = 0 [stepper_z] step_pin = PE2 dir_pin = PE3 enable_pin = !PE0 microsteps = 64 rotation_distance = 8 endstop_pin = probe:z_virtual_endstop position_max = 190 position_min = -6.0 homing_speed = 15 second_homing_speed = 5 [tmc2209 stepper_z] uart_pin = PE1 run_current = 0.600 hold_current = 0.400 stealthchop_threshold = 0 [extruder] step_pin = PD15 dir_pin = PD14 enable_pin = !PC7 microsteps = 16 rotation_distance = 41.3171961 nozzle_diameter = 0.400 filament_diameter = 1.750 max_extrude_only_distance = 200.00 max_extrude_cross_section = 5 pressure_advance = 0.08 pressure_advance_smooth_time = 0.2 heater_pin = PB3 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA2 pullup_resistor = 3000 min_temp = 0 max_temp = 260 min_extrude_temp = 0 control = pid pid_kp = 42.608 pid_ki = 6.044 pid_kd = 75.097 [heater_bed] heater_pin = PD7 sensor_type = EPCOS 100K B57560G104F sensor_pin = PA1 pullup_resistor = 3000 min_temp = 0 max_temp = 100 control = pid pid_kp = 42.294 pid_ki = 0.306 pid_kd = 1460.733 [bed_screws] screw1 = 89,100 screw2 = 30,30 screw3 = 208,30 screw4 = 208,160 screw5 = 30,160 [screws_tilt_adjust] screw1 = 89,100 screw1_name = Centre screw2 = 0,31.5 screw2_name = Avant Gauche screw3 = 162,31.5 screw3_name = Avant Droite screw4 = 162,168.5 screw4_name = Arriere Droite screw5 = 0,168.5 screw5_name = Arriere Gauche horizontal_move_z = 10 speed = 70 screw_thread = CW-M3 [bltouch] sensor_pin = ^PC13 control_pin = PE5 set_output_mode = 5V x_offset = 38 y_offset = 6.5 samples = 2 probe_with_touch_mode = true speed = 5 z_offset = 1.699 [safe_z_home] home_xy_position = 89,100 speed = 50 z_hop = 10 z_hop_speed = 5 [bed_mesh] speed = 150 horizontal_move_z = 10 mesh_min = 38,10 mesh_max = 200,190 fade_start = 0.6 fade_end = 10.0 probe_count = 7,7 algorithm = bicubic [fan] pin = PB1 [heater_fan Hotend0_Fan] pin = PB7 heater = extruder heater_temp = 45.0 [controller_fan Board_Cooling_Fan] pin = PB6 idle_timeout = 0 [filament_switch_sensor switch_sensor] switch_pin = ^PA0 pause_on_runout = True event_delay = 3.0 pause_delay = 0.5 runout_gcode = G1 E10 F2000 G1 E-100 F2000 M117 Filament switch runout insert_gcode = M117 Filament switch inserted [filament_motion_sensor encoder_sensor] switch_pin = ^PC2 detection_length = 2.88 extruder = extruder pause_on_runout = True runout_gcode = M117 Filament encoder runout insert_gcode = M117 Filament encoder inserted [gcode_macro _KNOMI_STATUS] variable_homing = False variable_led_on = False variable_led_off = False variable_probing = False variable_heating_nozzle = False variable_heating_bed = False gcode = [gcode_macro M109] rename_existing = M109.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=True M109.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_nozzle VALUE=False [gcode_macro M190] rename_existing = M190.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=True M190.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=heating_bed VALUE=False [gcode_macro G28] rename_existing = G28.1 gcode = SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=True G28.1 {rawparams} SET_GCODE_VARIABLE MACRO=_KNOMI_STATUS VARIABLE=homing VALUE=False [gcode_macro BED_MESH_CALIBRATE] rename_existing = _BED_MESH_CALIBRATE gcode = {% if params.FORCE_NEW_MESH != null %} { action_respond_info("Force New Mesh: %s" % (params.FORCE_NEW_MESH)) } {% endif %} {% if printer["bed_mesh"].profile_name == '' %} { action_respond_info("No existing bed mesh found.") } {% set last_area_end_x=-1 %} {% endif %} {% if printer.toolhead.homed_axes != "xyz" %} G28 {% endif %} {% set klicky_available = printer['gcode_macro _Probe_Variables'] != null %} {% set euclid_available = printer['gcode_macro EuclidProbe'] != null %}; Requires v5 macros https://github.com/nionio6915/Euclid_Probe/blob/main/Firmware_Examples/Klipper/00-euclid_exampleV5.cfg {% if params.PRINT_MIN %} { action_respond_info("print_min: %s" % params.PRINT_MIN) } { action_respond_info("print_max: %s" % params.PRINT_MAX) } {% set blTouchConfig = printer['configfile'].config["bltouch"] %} {% if blTouchConfig %} {% set OffsetX = blTouchConfig.x_offset|default(0)|float %} {% set OffsetY = blTouchConfig.y_offset|default(0)|float %} {% endif %} {% set probeConfig = printer['configfile'].config["probe"] %} {% if probeConfig %} {% set OffsetX = probeConfig.x_offset|default(0)|float %} {% set OffsetY = probeConfig.y_offset|default(0)|float %} {% endif %} {% set print_min_x = params.PRINT_MIN.split(",")[0]|float %} {% set print_min_y = params.PRINT_MIN.split(",")[1]|float %} {% set print_max_x = params.PRINT_MAX.split(",")[0]|float %} {% set print_max_y = params.PRINT_MAX.split(",")[1]|float %} {% if last_area_start_x > 0 %} { action_respond_info("last_bed_mesh: %s,%s %s,%s" % (last_area_start_x, last_area_start_y, last_area_end_x, last_area_end_y)) } {% endif %} {% if (params.FORCE_NEW_MESH != null) or (print_min_x < last_area_start_x) or (print_max_x > last_area_end_x) or (print_min_y < last_area_start_y) or (print_max_y > last_area_end_y) %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} DEPLOY_PROBE {% endif %} {% if (print_min_x < print_max_x) and (print_min_y < print_max_y) %} {% set bedMeshConfig = printer['configfile'].config["bed_mesh"] %} {% set minimum_probe_count = 3 %} {% if bedMeshConfig.algorithm == "bicubic" %} {% set minimum_probe_count = 5 %} {% endif %} {% set probe_count = bedMeshConfig.probe_count.split(",") %} {% set probe_count_x = probe_count[0]|int %} {% if probe_count.__len__() > 1 %} {% set probe_count_y = probe_count[1]|int %} {% else %} {% set probe_count_y = probe_count_x|int %} {% endif %} {% set relative_reference_index = bedMeshConfig.relative_reference_index %} {% set mesh_min_x = bedMeshConfig.mesh_min.split(",")[0]|float %} {% set mesh_min_y = bedMeshConfig.mesh_min.split(",")[1]|float %} {% set mesh_max_x = bedMeshConfig.mesh_max.split(",")[0]|float %} {% set mesh_max_y = bedMeshConfig.mesh_max.split(",")[1]|float %} {% if print_max_x - print_min_x < (mesh_max_x - mesh_min_x) * 0.50 %} {% set probe_count_x = minimum_probe_count %} {% endif %} {% if print_max_y - print_min_y < (mesh_max_y - mesh_min_y) * 0.50 %} {% set probe_count_y = minimum_probe_count %} {% endif %} {% if print_min_x - buffer >= mesh_min_x %} {% set mesh_min_x = print_min_x - buffer %} {% endif %} {% if print_min_y - buffer >= mesh_min_y %} {% set mesh_min_y = print_min_y - buffer %} {% endif %} {% if print_max_x + buffer <= mesh_max_x %} {% set mesh_max_x = print_max_x + buffer %} {% endif %} {% if print_max_y + buffer <= mesh_max_y %} {% set mesh_max_y = print_max_y + buffer %} {% endif %} { action_respond_info("mesh_min: %s,%s" % (mesh_min_x, mesh_min_y)) } { action_respond_info("mesh_max: %s,%s" % (mesh_max_x, mesh_max_y)) } { action_respond_info("probe_count: %s,%s" % (probe_count_x,probe_count_y)) } SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_x VALUE={print_min_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_start_y VALUE={print_min_y} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_x VALUE={print_max_x} SET_GCODE_VARIABLE MACRO=BED_MESH_CALIBRATE VARIABLE=last_area_end_y VALUE={print_max_y} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} {% if relative_reference_index == 0 or relative_reference_index == null %} _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} {% else %} {% set relative_reference_index = ((probe_count_x * probe_count_y - 1) / 2)|int %} { action_respond_info("relative_reference_index: %s" % relative_reference_index) } _BED_MESH_CALIBRATE mesh_min={mesh_min_x},{mesh_min_y} mesh_max={mesh_max_x},{mesh_max_y} probe_count={probe_count_x},{probe_count_y} relative_reference_index={relative_reference_index} {% endif %} {% else %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% endif %} {% if klicky_available %} Dock_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% else %} { action_respond_info("No need to recreate Bed Mesh since it's same as current mesh or smaller") } {% endif %} {% else %} {% if klicky_available %} _CheckProbe action=query Attach_Probe {% elif euclid_available %} STOW_PROBE {% endif %} {% if printer["gcode_macro status_meshing"] != null %} status_meshing {% endif %} _BED_MESH_CALIBRATE {% if klicky_available %} Dock_Probe {% endif %} {% if euclid_available %} STOW_PROBE {% endif %} {% endif %} {% if printer["gcode_macro status_ready"] != null %} status_ready {% endif %} variable_buffer = 20 variable_last_area_start_x = -1 variable_last_area_start_y = -1 variable_last_area_end_x = -1 variable_last_area_end_y = -1 [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = TURN_OFF_HEATERS CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %} {% set y_park = printer.toolhead.axis_minimum.y|float + 5.0 %} {% set max_z = printer.toolhead.axis_maximum.z|float %} {% set act_z = printer.toolhead.position.z|float %} {% if act_z < (max_z - 10.0) %} {% set z_safe = 10.0 %} {% else %} {% set z_safe = max_z - act_z %} {% endif %} PAUSE_BASE G91 {% if printer.extruder.can_extrude|lower == 'true' %} G1 E-{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} {% if "xyz" in printer.toolhead.homed_axes %} G1 Z{z_safe} F900 G90 G1 X{x_park} Y{y_park} F6000 {% else %} {action_respond_info("Printer not homed")} {% endif %} variable_extrude = 1.0 [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = {'restore': False, 'temp': 0} variable_restore_idle_timeout = 0 variable_idle_state = False gcode = {% set E = printer["gcode_macro PAUSE"].extrude|float %} {% if 'VELOCITY' in params|upper %} {% set get_params = ('VELOCITY=' + params.VELOCITY) %} {%else %} {% set get_params = "" %} {% endif %} {% if printer.extruder.can_extrude|lower == 'true' %} G91 G1 E{E} F2100 {% else %} {action_respond_info("Extruder not hot enough")} {% endif %} RESUME_BASE {get_params} [gcode_macro SET_PAUSE_NEXT_LAYER] description = Enable a pause if the next layer is reached gcode = {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %} {% set ENABLE = params.ENABLE|default(1)|int != 0 %} {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}" [gcode_macro SET_PAUSE_AT_LAYER] description = Enable/disable a pause if a given layer number is reached gcode = {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %} {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined else params.LAYER is defined %} {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %} {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %} SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}" [gcode_macro SET_PRINT_STATS_INFO] rename_existing = SET_PRINT_STATS_INFO_BASE description = Overwrite, to get pause_next_layer and pause_at_layer feature variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" } variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" } gcode = {% if pause_next_layer.enable %} RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}' {pause_next_layer.call} SET_PAUSE_NEXT_LAYER ENABLE=0 {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %} RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}' {pause_at_layer.call} SET_PAUSE_AT_LAYER ENABLE=0 {% endif %} SET_PRINT_STATS_INFO_BASE {rawparams} [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL] description = Helper: park toolhead used in PAUSE and CANCEL_PRINT gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %} {% set custom_park_x = client.custom_park_x|default(0.0) %} {% set custom_park_y = client.custom_park_y|default(0.0) %} {% set park_dz = client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = client.speed_hop|default(15) * 60 %} {% set sp_move = client.speed_move|default(velocity) * 60 %} {% set origin = printer.gcode_move.homing_origin %} {% set act = printer.gcode_move.gcode_position %} {% set max = printer.toolhead.axis_maximum %} {% set cone = printer.toolhead.cone_start_z|default(max.z) %} {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch'] else False %} {% set z_min = params.Z_MIN|default(0)|float %} {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %} {% set x_park = params.X if params.X is defined else custom_park_x if use_custom else 0.0 if round_bed else (max.x - 5.0) %} {% set y_park = params.Y if params.Y is defined else custom_park_y if use_custom else (max.y - 5.0) if round_bed and z_park < cone else 0.0 if round_bed else (max.y - 5.0) %} _CLIENT_RETRACT {% if "xyz" in printer.toolhead.homed_axes %} G90 G1 Z{z_park} F{sp_hop} G1 X{x_park} Y{y_park} F{sp_move} {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %} {% else %} RESPOND TYPE=echo MSG='Printer not homed' {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %} {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.toolhead.extruder != '' %} {% if printer[printer.toolhead.extruder].can_extrude %} {% if use_fw_retract %} {% if length < 0 %} G10 {% else %} G11 {% endif %} {% else %} M83 G1 E{length} F{(speed|float|abs) * 60} {% if absolute_extrude %} M82 {% endif %} {% endif %} {% else %} RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}' {% endif %} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %} {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %} {% set speed = params.SPEED|default(client.speed_retract)|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [gcode_macro update_git] gcode = {% set message = params.MESSAGE|default() %} {% if message %} RUN_SHELL_COMMAND CMD=update_git_script_message PARAMS="'{params.MESSAGE}'" {% else %} RUN_SHELL_COMMAND CMD=update_git_script {% endif %} [gcode_shell_command update_git_script] command = bash -c "bash $HOME/klipper-backup/script.sh" timeout = 90.0 verbose = True [gcode_shell_command update_git_script_message] command = bash -c "bash $HOME/klipper-backup/script.sh $0" timeout = 90.0 verbose = True [gcode_macro LOAD_FILAMENT] variable_load_distance = 50 variable_purge_distance = 25 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=load_state G91 G92 E0 G1 E{load_distance} F{max_velocity} G1 E{purge_distance} F{speed} RESTORE_GCODE_STATE NAME=load_state [gcode_macro UNLOAD_FILAMENT] variable_unload_distance = 100 variable_purge_distance = 20 gcode = {% set speed = params.SPEED|default(10) %} {% set max_velocity = printer.configfile.settings['extruder'].max_extrude_only_velocity * 60 %} SAVE_GCODE_STATE NAME=unload_state G91 G92 E0 G1 E{purge_distance} F{speed} G1 E-{unload_distance} F{max_velocity} RESTORE_GCODE_STATE NAME=unload_state [gcode_macro T0] gcode = M104 S230 [gcode_macro LINE_PURGE] description = A purge macro that adapts to be near your actual printed objects gcode = {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %} {% if printer.firmware_retraction is defined %} {% set RETRACT = G10 | string %} {% set UNRETRACT = G11 | string %} {% else %} {% set RETRACT = 'G1 E-.5 F2100' | string %} {% set UNRETRACT = 'G1 E.5 F2100' | string %} {% endif %} {% set verbose_enable = printer["gcode_macro _KAMP_Settings"].verbose_enable | abs %} {% set purge_height = printer["gcode_macro _KAMP_Settings"].purge_height | float %} {% set tip_distance = printer["gcode_macro _KAMP_Settings"].tip_distance | float %} {% set purge_margin = printer["gcode_macro _KAMP_Settings"].purge_margin | float %} {% set purge_amount = printer["gcode_macro _KAMP_Settings"].purge_amount | float %} {% set flow_rate = printer["gcode_macro _KAMP_Settings"].flow_rate | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set purge_x_min = (all_points | map(attribute=0) | min | default(0)) %} {% set purge_x_max = (all_points | map(attribute=0) | max | default(0)) %} {% set purge_y_min = (all_points | map(attribute=1) | min | default(0)) %} {% set purge_y_max = (all_points | map(attribute=1) | max | default(0)) %} {% set purge_x_center = ([((purge_x_max + purge_x_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_y_center = ([((purge_y_max + purge_y_min) / 2) - (purge_amount / 2), 0] | max) %} {% set purge_x_origin = ([purge_x_min - purge_margin, 0] | max) %} {% set purge_y_origin = ([purge_y_min - purge_margin, 0] | max) %} {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %} {% if cross_section < 5 %} {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge, please set it to 5 or greater. Purge skipped.")} {% else %} {% if verbose_enable == True %} {action_respond_info("Moving filament tip {}mms".format( (tip_distance), )) } {% endif %} {% if printer.firmware_retraction is defined %} {action_respond_info("KAMP purge is using firmware retraction.")} {% else %} {action_respond_info("KAMP purge is not using firmware retraction, it is recommended to configure it.")} {% endif %} {% if purge_y_origin > 0 %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_center), (purge_y_origin), (purge_amount), (flow_rate), )) } {% else %} {action_respond_info("KAMP purge starting at {}, {} and purging {}mm of filament, requested flow rate is {}mm3/s.".format( (purge_x_origin), (purge_y_center), (purge_amount), (flow_rate), )) } {% endif %} SAVE_GCODE_STATE NAME=Prepurge_State {% if purge_y_origin > 0 %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_center} Y{purge_y_origin} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 X{purge_x_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 X{purge_x_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% else %} G92 E0 G0 F{travel_speed} G90 G0 X{purge_x_origin} Y{purge_y_center} G0 Z{purge_height} M83 G1 E{tip_distance} F{purge_move_speed} G1 Y{purge_y_center + purge_amount} E{purge_amount} F{purge_move_speed} {RETRACT} G0 Y{purge_y_center + purge_amount + 10} F{travel_speed} G92 E0 M82 G0 Z{purge_height * 2} F{travel_speed} {% endif %} RESTORE_GCODE_STATE NAME=Prepurge_State {% endif %} [gcode_macro SMART_PARK] description = Parks your printhead near the print area for pre-print hotend heating. gcode = {% set kamp_settings = printer["gcode_macro _KAMP_Settings"] %} {% set z_height = kamp_settings.smart_park_height | float %} {% set purge_margin = kamp_settings.purge_margin | float %} {% set verbose_enable = kamp_settings.verbose_enable | abs %} {% set center_x = printer.toolhead.axis_maximum.x / 2 | float %} {% set center_y = printer.toolhead.axis_maximum.y / 2 | float %} {% set axis_minimum_x = printer.toolhead.axis_minimum.x | float %} {% set axis_minimum_y = printer.toolhead.axis_minimum.y | float %} {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %} {% set x_min = all_points | map(attribute=0) | min | default(center_x) %} {% set y_min = all_points | map(attribute=1) | min | default(center_y) %} {% set travel_speed = (printer.toolhead.max_velocity) * 60 | float %} {% if purge_margin > 0 and x_min != center_x and y_min != center_y %} {% set x_min = [ x_min - purge_margin , x_min ] | min %} {% set y_min = [ y_min - purge_margin , y_min ] | min %} {% set x_min = [ x_min , axis_minimum_x ] | max %} {% set y_min = [ y_min , axis_minimum_y ] | max %} {% endif %} {% if verbose_enable == True %} { action_respond_info("Smart Park location: {},{}.".format( (x_min), (y_min), )) } {% endif %} SAVE_GCODE_STATE NAME=Presmartpark_State G90 {% if printer.toolhead.position.z < z_height %} G0 Z{z_height} {% endif %} G0 X{x_min} Y{y_min} F{travel_speed} G0 Z{z_height} RESTORE_GCODE_STATE NAME=Presmartpark_State [gcode_macro _KAMP_Settings] description = Cette macro contient tous les paramètres réglables pour KAMP variable_verbose_enable = False variable_mesh_margin = 5 variable_fuzz_amount = 0 variable_probe_dock_enable = False variable_attach_macro = 'Attach_Probe' variable_detach_macro = 'Dock_Probe' variable_purge_height = 0.6 variable_tip_distance = 2 variable_purge_margin = 15 variable_purge_amount = 30 variable_flow_rate = 10 variable_smart_park_height = 10 gcode = {action_respond_info(" L'exécution de la macro KAMP_Settings ne fait rien, elle est uniquement utilisée pour stocker les paramètres KAMP. ")} [gcode_macro G32] gcode = G28 BED_MESH_CLEAR BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5 SMART_PARK [gcode_macro PRINT_START] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 {% set BED = params.BED|default(60)|float %} {% set EXTRUDER = params.EXTRUDER|default(230)|float %} {% set FL_SIZE = params.SIZE|default("0_0_0_0")|string %} M190 S{BED} G32 M109 S{EXTRUDER} G92 E0 LINE_PURGE [gcode_macro PRINT_END] gcode = G91 G1 E-2 F2700 G1 E-2 Z0.2 F2400 G1 X5 Y5 F3500 G1 Z10 G90 G1 X0 Y200 F3000 M106 S0 M104 S0 M140 S0 M18 [gcode_macro LED_ON] gcode = SET_LED LED=LED WHITE=1.0 SYNC=0 TRANSMIT=1 [gcode_macro LED_OFF] gcode = SET_LED LED=LED WHITE=0.0 SYNC=0 TRANSMIT=1 [bed_mesh default] version = 1 points = 0.028750, -0.002813, -0.011875, -0.048750, -0.072500, -0.071875, -0.125313 -0.034063, -0.009375, 0.004687, -0.017500, -0.000938, 0.023437, -0.014375 -0.072188, -0.050313, -0.034688, 0.004687, 0.035625, 0.064687, 0.006875 -0.120625, -0.105938, -0.071563, 0.036562, 0.039375, 0.026875, 0.010312 -0.080000, -0.082813, -0.106563, -0.051250, -0.007500, 0.041562, 0.021562 -0.077500, -0.088438, -0.123125, -0.119688, -0.040000, 0.043750, 0.017812 -0.032188, -0.074688, -0.156875, -0.126563, -0.074063, 0.001250, 0.008750 x_count = 7 y_count = 7 mesh_x_pps = 2 mesh_y_pps = 2 algo = bicubic tension = 0.2 min_x = 38.0 max_x = 200.0 min_y = 10.0 max_y = 190.0 ======================= Extruder max_extrude_ratio=2.078758 mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' webhooks client 281473552373408: New connection webhooks client 281473552373408: Client info {'program': 'Moonraker', 'version': 'v0.8.0-325-g99b97af'} mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' mcu 'mcu': Unable to open serial port: [Errno 13] could not open port /dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if: [Errno 13] Permission denied: '/dev/serial/by-id/usb-Klipper_stm32h723xx_170038000C51323433323831-if' MCU error during connect Traceback (most recent call last): File "/home/biqu/klipper/klippy/mcu.py", line 791, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error raise error(self.warn_prefix + (msg % params)) serialhdl.error: mcu 'mcu': Unable to connect During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/biqu/klipper/klippy/mcu.py", line 796, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect Build file /home/biqu/klipper/klippy/../.config(3446): Sat Apr 13 11:39:52 2024 ========= Last MCU build config ========= CONFIG_LOW_LEVEL_OPTIONS=y # CONFIG_MACH_AVR is not set # CONFIG_MACH_ATSAM is not set # CONFIG_MACH_ATSAMD is not set # CONFIG_MACH_LPC176X is not set CONFIG_MACH_STM32=y # CONFIG_MACH_HC32F460 is not set # CONFIG_MACH_RP2040 is not set # CONFIG_MACH_PRU is not set # CONFIG_MACH_AR100 is not set # CONFIG_MACH_LINUX is not set # CONFIG_MACH_SIMU is not set CONFIG_BOARD_DIRECTORY="stm32" CONFIG_MCU="stm32h723xx" CONFIG_CLOCK_FREQ=400000000 CONFIG_USBSERIAL=y CONFIG_FLASH_SIZE=0x40000 CONFIG_FLASH_BOOT_ADDRESS=0x8000000 CONFIG_RAM_START=0x20000000 CONFIG_RAM_SIZE=0x20000 CONFIG_STACK_SIZE=512 CONFIG_FLASH_APPLICATION_ADDRESS=0x8020000 CONFIG_STM32_SELECT=y # CONFIG_MACH_STM32F103 is not set # CONFIG_MACH_STM32F207 is not set # CONFIG_MACH_STM32F401 is not set # CONFIG_MACH_STM32F405 is not set # CONFIG_MACH_STM32F407 is not set # CONFIG_MACH_STM32F429 is not set # CONFIG_MACH_STM32F446 is not set # CONFIG_MACH_STM32F765 is not set # CONFIG_MACH_STM32F031 is not set # CONFIG_MACH_STM32F042 is not set # CONFIG_MACH_STM32F070 is not set # CONFIG_MACH_STM32F072 is not set # CONFIG_MACH_STM32G070 is not set # CONFIG_MACH_STM32G071 is not set # CONFIG_MACH_STM32G0B0 is not set # CONFIG_MACH_STM32G0B1 is not set # CONFIG_MACH_STM32G431 is not set CONFIG_MACH_STM32H723=y # CONFIG_MACH_STM32H743 is not set # CONFIG_MACH_STM32H750 is not set # CONFIG_MACH_STM32L412 is not set # CONFIG_MACH_N32G452 is not set # CONFIG_MACH_N32G455 is not set CONFIG_MACH_STM32H7=y CONFIG_HAVE_STM32_USBOTG=y CONFIG_HAVE_STM32_FDCANBUS=y CONFIG_HAVE_STM32_USBCANBUS=y CONFIG_STM32_DFU_ROM_ADDRESS=0x1ff09800 CONFIG_STM32_FLASH_START_20000=y # CONFIG_STM32_FLASH_START_0000 is not set # CONFIG_STM32_CLOCK_REF_8M is not set # CONFIG_STM32_CLOCK_REF_12M is not set # CONFIG_STM32_CLOCK_REF_16M is not set # CONFIG_STM32_CLOCK_REF_20M is not set # CONFIG_STM32_CLOCK_REF_24M is not set CONFIG_STM32_CLOCK_REF_25M=y # CONFIG_STM32_CLOCK_REF_INTERNAL is not set CONFIG_CLOCK_REF_FREQ=25000000 CONFIG_STM32F0_TRIM=16 CONFIG_STM32_USB_PA11_PA12=y # CONFIG_STM32_SERIAL_USART1 is not set # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set # CONFIG_STM32_SERIAL_USART2 is not set # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set # CONFIG_STM32_SERIAL_USART3 is not set # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set # CONFIG_STM32_SERIAL_UART4 is not set # CONFIG_STM32_CANBUS_PA11_PA12 is not set # CONFIG_STM32_CANBUS_PA11_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set # CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set # CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set # CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set # CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set # CONFIG_STM32_USBCANBUS_PA11_PA12 is not set CONFIG_USB=y CONFIG_USB_VENDOR_ID=0x1d50 CONFIG_USB_DEVICE_ID=0x614e CONFIG_USB_SERIAL_NUMBER_CHIPID=y CONFIG_USB_SERIAL_NUMBER="12345" # # USB ids # # end of USB ids CONFIG_WANT_GPIO_BITBANGING=y CONFIG_WANT_DISPLAYS=y CONFIG_WANT_SENSORS=y CONFIG_WANT_LIS2DW=y CONFIG_WANT_LDC1612=y CONFIG_WANT_SOFTWARE_I2C=y CONFIG_WANT_SOFTWARE_SPI=y CONFIG_NEED_SENSOR_BULK=y CONFIG_CANBUS_FREQUENCY=1000000 CONFIG_INITIAL_PINS="" CONFIG_HAVE_GPIO=y CONFIG_HAVE_GPIO_ADC=y CONFIG_HAVE_GPIO_SPI=y CONFIG_HAVE_GPIO_I2C=y CONFIG_HAVE_GPIO_HARD_PWM=y CONFIG_HAVE_STRICT_TIMING=y CONFIG_HAVE_CHIPID=y CONFIG_HAVE_STEPPER_BOTH_EDGE=y CONFIG_HAVE_BOOTLOADER_REQUEST=y CONFIG_INLINE_STEPPER_HACK=y ======================= Build file /home/biqu/klipper/klippy/../out/klipper.dict(8145): Sat Apr 13 11:40:57 2024 Last MCU build version: v0.12.0-158-g36f9b26e Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2 Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1_PB6_PB7=PB6,PB7 BUS_PINS_i2c1_PB8_PB9=PB8,PB9 BUS_PINS_i2c2_PB10_PB11=PB10,PB11 BUS_PINS_i2c3_PA8_PC9=PA8,PC9 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi2a=PC2,PC3,PB10 BUS_PINS_spi3a=PC11,PC12,PC10 BUS_PINS_spi4=PE13,PE14,PE12 BUS_PINS_spi5=PF8,PF9,PF7 BUS_PINS_spi5a=PH7,PF11,PH6 BUS_PINS_spi6=PG12,PG14,PG13 CLOCK_FREQ=400000000 MCU=stm32h723xx PWM_MAX=255 RESERVE_PINS_USB=PA11,PA12 RESERVE_PINS_crystal=PH0,PH1 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Build file /home/biqu/klipper/klippy/../out/klipper.elf(1678828): Sat Apr 13 11:41:15 2024