===== Config file ===== [virtual_sdcard] path = /home/pi/printer_data/gcodes on_error_gcode = CANCEL_PRINT [pause_resume] [display_status] [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set allow_park = False if not macro_found else False if client.park_at_cancel is not defined else True if client.park_at_cancel|lower == 'true' else False %} {% set retract = 5.0 if not macro_found else client.cancel_retract|default(5.0)|abs %} {% set park_x = "" if not macro_found else "" if client.park_at_cancel_x is not defined else "X=" + client.park_at_cancel_x|string if client.park_at_cancel_x is not none %} {% set park_y = "" if not macro_found else "" if client.park_at_cancel_y is not defined else "Y=" + client.park_at_cancel_y|string if client.park_at_cancel_y is not none %} {% set custom_park = True if (park_x|length > 0 or park_y|length > 0) else False %} {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %} _CLIENT_RETRACT LENGTH={retract} TURN_OFF_HEATERS M106 S0 SET_PAUSE_NEXT_LAYER ENABLE=0 SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0 CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{printer[printer.toolhead.extruder].target}" PAUSE_BASE _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = 0 gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set sp_move = velocity if not macro_found else client.speed_move|default(velocity) %} M109 S{last_extruder_temp} _CLIENT_EXTRUDE RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)} [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 %} {action_respond_info("%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 %} {action_respond_info("%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 macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = False if not macro_found else False if client.use_custom_pos is not defined else True if client.use_custom_pos|lower == 'true' else False %} {% set custom_park_x = 0.0 if not macro_found else client.custom_park_x|default(0.0) %} {% set custom_park_y = 0.0 if not macro_found else client.custom_park_y|default(0.0) %} {% set park_dz = 2.0 if not macro_found else client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = 900 if not macro_found else client.speed_hop|default(15) * 60 %} {% set sp_move = velocity * 60 if not macro_found else 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 %} {action_respond_info("Printer not homed")} {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set use_fw_retract = False if not macro_found else False if client.use_fw_retract is not defined else True if client.use_fw_retract|lower == 'true' and printer.firmware_retraction is defined else False %} {% set length = (params.LENGTH|float) if params.LENGTH is defined else 1.0 if not macro_found else client.unretract|default(1.0) %} {% set speed = params.SPEED if params.SPEED is defined else 35 if not macro_found else client.speed_unretract|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.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 %} {action_respond_info("Extruder not hot enough")} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set length = (params.LENGTH|float) if params.LENGTH is defined else 1.0 if not macro_found else client.retract|default(1.0) %} {% set speed = params.SPEED if params.SPEED is defined else 35 if not macro_found else client.speed_retract|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [mcu] serial = /dev/serial/by-id/ [printer] kinematics = none max_velocity = 1000 max_accel = 1000 ======================= Args: ['/home/pi/klipper/klippy/klippy.py', '/home/pi/printer_data/config/printer.cfg', '-I', '/home/pi/printer_data/comms/klippy.serial', '-l', '/home/pi/printer_data/logs/klippy.log', '-a', '/home/pi/printer_data/comms/klippy.sock'] Git version: 'v0.11.0-205-g5f0d252b' Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Mar 12 2021, 04:06:34) \n[GCC 10.2.1 20210110]' webhooks client 4125359888: {'program': 'Moonraker', 'version': 'v0.8.0-45-gc41c588'} =============== Log rollover at Tue May 30 10:02:31 2023 =============== mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' MCU error during connect Traceback (most recent call last): File "/home/pi/klipper/klippy/mcu.py", line 798, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/pi/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/pi/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/pi/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/mcu.py", line 803, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect No build file /home/pi/klipper/klippy/../.config No build file /home/pi/klipper/klippy/../out/klipper.dict No build file /home/pi/klipper/klippy/../out/klipper.elf Attempting MCU 'mcu' reset Unhandled exception during post run Traceback (most recent call last): File "/home/pi/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) FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pi/klipper/klippy/klippy.py", line 234, in run self.send_event("klippy:firmware_restart") File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/mcu.py", line 949, in _firmware_restart self._restart_arduino() File "/home/pi/klipper/klippy/mcu.py", line 909, in _restart_arduino serialhdl.arduino_reset(self._serialport, self._reactor) File "/home/pi/klipper/klippy/serialhdl.py", line 379, in arduino_reset ser = serial.Serial(serialport, 2400, timeout=0, exclusive=True) File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialutil.py", line 240, in __init__ self.open() File "/home/pi/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 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' Restarting printer Start printer at Tue May 30 10:36:18 2023 (1685468178.8 2069.7) ===== Config file ===== [virtual_sdcard] path = /home/pi/printer_data/gcodes on_error_gcode = CANCEL_PRINT [pause_resume] [display_status] [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set allow_park = False if not macro_found else False if client.park_at_cancel is not defined else True if client.park_at_cancel|lower == 'true' else False %} {% set retract = 5.0 if not macro_found else client.cancel_retract|default(5.0)|abs %} {% set park_x = "" if not macro_found else "" if client.park_at_cancel_x is not defined else "X=" + client.park_at_cancel_x|string if client.park_at_cancel_x is not none %} {% set park_y = "" if not macro_found else "" if client.park_at_cancel_y is not defined else "Y=" + client.park_at_cancel_y|string if client.park_at_cancel_y is not none %} {% set custom_park = True if (park_x|length > 0 or park_y|length > 0) else False %} {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %} _CLIENT_RETRACT LENGTH={retract} TURN_OFF_HEATERS M106 S0 SET_PAUSE_NEXT_LAYER ENABLE=0 SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0 CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{printer[printer.toolhead.extruder].target}" PAUSE_BASE _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = 0 gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set sp_move = velocity if not macro_found else client.speed_move|default(velocity) %} M109 S{last_extruder_temp} _CLIENT_EXTRUDE RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)} [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 %} {action_respond_info("%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 %} {action_respond_info("%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 macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = False if not macro_found else False if client.use_custom_pos is not defined else True if client.use_custom_pos|lower == 'true' else False %} {% set custom_park_x = 0.0 if not macro_found else client.custom_park_x|default(0.0) %} {% set custom_park_y = 0.0 if not macro_found else client.custom_park_y|default(0.0) %} {% set park_dz = 2.0 if not macro_found else client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = 900 if not macro_found else client.speed_hop|default(15) * 60 %} {% set sp_move = velocity * 60 if not macro_found else 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 %} {action_respond_info("Printer not homed")} {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set use_fw_retract = False if not macro_found else False if client.use_fw_retract is not defined else True if client.use_fw_retract|lower == 'true' and printer.firmware_retraction is defined else False %} {% set length = (params.LENGTH|float) if params.LENGTH is defined else 1.0 if not macro_found else client.unretract|default(1.0) %} {% set speed = params.SPEED if params.SPEED is defined else 35 if not macro_found else client.speed_unretract|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.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 %} {action_respond_info("Extruder not hot enough")} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set length = (params.LENGTH|float) if params.LENGTH is defined else 1.0 if not macro_found else client.retract|default(1.0) %} {% set speed = params.SPEED if params.SPEED is defined else 35 if not macro_found else client.speed_retract|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [mcu] serial = /dev/serial/by-id/ [printer] kinematics = none max_velocity = 1000 max_accel = 1000 ======================= mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' webhooks client 4126329560: New connection webhooks client 4126329560: Client info {'program': 'Moonraker', 'version': 'v0.8.0-45-gc41c588'} mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' MCU error during connect Traceback (most recent call last): File "/home/pi/klipper/klippy/mcu.py", line 798, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/pi/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/pi/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/pi/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/mcu.py", line 803, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect No build file /home/pi/klipper/klippy/../.config No build file /home/pi/klipper/klippy/../out/klipper.dict No build file /home/pi/klipper/klippy/../out/klipper.elf Attempting MCU 'mcu' reset Unhandled exception during post run Traceback (most recent call last): File "/home/pi/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) FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pi/klipper/klippy/klippy.py", line 234, in run self.send_event("klippy:firmware_restart") File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/mcu.py", line 949, in _firmware_restart self._restart_arduino() File "/home/pi/klipper/klippy/mcu.py", line 909, in _restart_arduino serialhdl.arduino_reset(self._serialport, self._reactor) File "/home/pi/klipper/klippy/serialhdl.py", line 379, in arduino_reset ser = serial.Serial(serialport, 2400, timeout=0, exclusive=True) File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialutil.py", line 240, in __init__ self.open() File "/home/pi/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 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' Restarting printer Start printer at Tue May 30 10:39:44 2023 (1685468384.3 2275.2) ===== Config file ===== [virtual_sdcard] path = /home/pi/printer_data/gcodes on_error_gcode = CANCEL_PRINT [pause_resume] [display_status] [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set allow_park = False if not macro_found else False if client.park_at_cancel is not defined else True if client.park_at_cancel|lower == 'true' else False %} {% set retract = 5.0 if not macro_found else client.cancel_retract|default(5.0)|abs %} {% set park_x = "" if not macro_found else "" if client.park_at_cancel_x is not defined else "X=" + client.park_at_cancel_x|string if client.park_at_cancel_x is not none %} {% set park_y = "" if not macro_found else "" if client.park_at_cancel_y is not defined else "Y=" + client.park_at_cancel_y|string if client.park_at_cancel_y is not none %} {% set custom_park = True if (park_x|length > 0 or park_y|length > 0) else False %} {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %} _CLIENT_RETRACT LENGTH={retract} TURN_OFF_HEATERS M106 S0 SET_PAUSE_NEXT_LAYER ENABLE=0 SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0 CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{printer[printer.toolhead.extruder].target}" PAUSE_BASE _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = 0 gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set sp_move = velocity if not macro_found else client.speed_move|default(velocity) %} M109 S{last_extruder_temp} _CLIENT_EXTRUDE RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)} [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 %} {action_respond_info("%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 %} {action_respond_info("%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 macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = False if not macro_found else False if client.use_custom_pos is not defined else True if client.use_custom_pos|lower == 'true' else False %} {% set custom_park_x = 0.0 if not macro_found else client.custom_park_x|default(0.0) %} {% set custom_park_y = 0.0 if not macro_found else client.custom_park_y|default(0.0) %} {% set park_dz = 2.0 if not macro_found else client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = 900 if not macro_found else client.speed_hop|default(15) * 60 %} {% set sp_move = velocity * 60 if not macro_found else 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 %} {action_respond_info("Printer not homed")} {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set use_fw_retract = False if not macro_found else False if client.use_fw_retract is not defined else True if client.use_fw_retract|lower == 'true' and printer.firmware_retraction is defined else False %} {% set length = (params.LENGTH|float) if params.LENGTH is defined else 1.0 if not macro_found else client.unretract|default(1.0) %} {% set speed = params.SPEED if params.SPEED is defined else 35 if not macro_found else client.speed_unretract|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.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 %} {action_respond_info("Extruder not hot enough")} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set length = (params.LENGTH|float) if params.LENGTH is defined else 1.0 if not macro_found else client.retract|default(1.0) %} {% set speed = params.SPEED if params.SPEED is defined else 35 if not macro_found else client.speed_retract|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [mcu] serial = /dev/serial/by-id/ [printer] kinematics = none max_velocity = 1000 max_accel = 1000 ======================= mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' webhooks client 4126329584: New connection webhooks client 4126329584: Client info {'program': 'Moonraker', 'version': 'v0.8.0-45-gc41c588'} mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' MCU error during connect Traceback (most recent call last): File "/home/pi/klipper/klippy/mcu.py", line 798, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/pi/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/pi/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/pi/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/mcu.py", line 803, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect No build file /home/pi/klipper/klippy/../.config No build file /home/pi/klipper/klippy/../out/klipper.dict No build file /home/pi/klipper/klippy/../out/klipper.elf Attempting MCU 'mcu' reset Unhandled exception during post run Traceback (most recent call last): File "/home/pi/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) FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pi/klipper/klippy/klippy.py", line 234, in run self.send_event("klippy:firmware_restart") File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/mcu.py", line 949, in _firmware_restart self._restart_arduino() File "/home/pi/klipper/klippy/mcu.py", line 909, in _restart_arduino serialhdl.arduino_reset(self._serialport, self._reactor) File "/home/pi/klipper/klippy/serialhdl.py", line 379, in arduino_reset ser = serial.Serial(serialport, 2400, timeout=0, exclusive=True) File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialutil.py", line 240, in __init__ self.open() File "/home/pi/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 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' Restarting printer Start printer at Tue May 30 10:51:04 2023 (1685469064.6 2955.5) ===== Config file ===== [virtual_sdcard] path = /home/pi/printer_data/gcodes on_error_gcode = CANCEL_PRINT [pause_resume] [display_status] [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set allow_park = False if not macro_found else False if client.park_at_cancel is not defined else True if client.park_at_cancel|lower == 'true' else False %} {% set retract = 5.0 if not macro_found else client.cancel_retract|default(5.0)|abs %} {% set park_x = "" if not macro_found else "" if client.park_at_cancel_x is not defined else "X=" + client.park_at_cancel_x|string if client.park_at_cancel_x is not none %} {% set park_y = "" if not macro_found else "" if client.park_at_cancel_y is not defined else "Y=" + client.park_at_cancel_y|string if client.park_at_cancel_y is not none %} {% set custom_park = True if (park_x|length > 0 or park_y|length > 0) else False %} {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %} _CLIENT_RETRACT LENGTH={retract} TURN_OFF_HEATERS M106 S0 SET_PAUSE_NEXT_LAYER ENABLE=0 SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0 CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{printer[printer.toolhead.extruder].target}" PAUSE_BASE _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = 0 gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set sp_move = velocity if not macro_found else client.speed_move|default(velocity) %} M109 S{last_extruder_temp} _CLIENT_EXTRUDE RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)} [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 %} {action_respond_info("%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 %} {action_respond_info("%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 macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = False if not macro_found else False if client.use_custom_pos is not defined else True if client.use_custom_pos|lower == 'true' else False %} {% set custom_park_x = 0.0 if not macro_found else client.custom_park_x|default(0.0) %} {% set custom_park_y = 0.0 if not macro_found else client.custom_park_y|default(0.0) %} {% set park_dz = 2.0 if not macro_found else client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = 900 if not macro_found else client.speed_hop|default(15) * 60 %} {% set sp_move = velocity * 60 if not macro_found else 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 %} {action_respond_info("Printer not homed")} {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set use_fw_retract = False if not macro_found else False if client.use_fw_retract is not defined else True if client.use_fw_retract|lower == 'true' and printer.firmware_retraction is defined else False %} {% set length = (params.LENGTH|float) if params.LENGTH is defined else 1.0 if not macro_found else client.unretract|default(1.0) %} {% set speed = params.SPEED if params.SPEED is defined else 35 if not macro_found else client.speed_unretract|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.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 %} {action_respond_info("Extruder not hot enough")} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set length = (params.LENGTH|float) if params.LENGTH is defined else 1.0 if not macro_found else client.retract|default(1.0) %} {% set speed = params.SPEED if params.SPEED is defined else 35 if not macro_found else client.speed_retract|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [mcu] serial = /dev/serial/by-id/ [printer] kinematics = none max_velocity = 1000 max_accel = 1000 ======================= mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' webhooks client 4126329488: New connection webhooks client 4126329488: Client info {'program': 'Moonraker', 'version': 'v0.8.0-45-gc41c588'} mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' MCU error during connect Traceback (most recent call last): File "/home/pi/klipper/klippy/mcu.py", line 798, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/pi/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/pi/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/pi/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/mcu.py", line 803, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect No build file /home/pi/klipper/klippy/../.config No build file /home/pi/klipper/klippy/../out/klipper.dict No build file /home/pi/klipper/klippy/../out/klipper.elf Starting Klippy... Args: ['/home/pi/klipper/klippy/klippy.py', '/home/pi/printer_data/config/printer.cfg', '-I', '/home/pi/printer_data/comms/klippy.serial', '-l', '/home/pi/printer_data/logs/klippy.log', '-a', '/home/pi/printer_data/comms/klippy.sock'] Git version: 'v0.11.0-205-g5f0d252b' Branch: master Remote: origin Tracked URL: https://github.com/Klipper3d/klipper CPU: 4 core ? Python: '3.9.2 (default, Mar 12 2021, 04:06:34) \n[GCC 10.2.1 20210110]' Start printer at Tue May 30 10:48:57 2023 (1685468937.4 11.6) ===== Config file ===== [virtual_sdcard] path = /home/pi/printer_data/gcodes on_error_gcode = CANCEL_PRINT [pause_resume] [display_status] [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set allow_park = False if not macro_found else False if client.park_at_cancel is not defined else True if client.park_at_cancel|lower == 'true' else False %} {% set retract = 5.0 if not macro_found else client.cancel_retract|default(5.0)|abs %} {% set park_x = "" if not macro_found else "" if client.park_at_cancel_x is not defined else "X=" + client.park_at_cancel_x|string if client.park_at_cancel_x is not none %} {% set park_y = "" if not macro_found else "" if client.park_at_cancel_y is not defined else "Y=" + client.park_at_cancel_y|string if client.park_at_cancel_y is not none %} {% set custom_park = True if (park_x|length > 0 or park_y|length > 0) else False %} {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %} _CLIENT_RETRACT LENGTH={retract} TURN_OFF_HEATERS M106 S0 SET_PAUSE_NEXT_LAYER ENABLE=0 SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0 CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{printer[printer.toolhead.extruder].target}" PAUSE_BASE _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = 0 gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set sp_move = velocity if not macro_found else client.speed_move|default(velocity) %} M109 S{last_extruder_temp} _CLIENT_EXTRUDE RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)} [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 %} {action_respond_info("%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 %} {action_respond_info("%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 macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = False if not macro_found else False if client.use_custom_pos is not defined else True if client.use_custom_pos|lower == 'true' else False %} {% set custom_park_x = 0.0 if not macro_found else client.custom_park_x|default(0.0) %} {% set custom_park_y = 0.0 if not macro_found else client.custom_park_y|default(0.0) %} {% set park_dz = 2.0 if not macro_found else client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = 900 if not macro_found else client.speed_hop|default(15) * 60 %} {% set sp_move = velocity * 60 if not macro_found else 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 %} {action_respond_info("Printer not homed")} {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set use_fw_retract = False if not macro_found else False if client.use_fw_retract is not defined else True if client.use_fw_retract|lower == 'true' and printer.firmware_retraction is defined else False %} {% set length = (params.LENGTH|float) if params.LENGTH is defined else 1.0 if not macro_found else client.unretract|default(1.0) %} {% set speed = params.SPEED if params.SPEED is defined else 35 if not macro_found else client.speed_unretract|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.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 %} {action_respond_info("Extruder not hot enough")} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set length = (params.LENGTH|float) if params.LENGTH is defined else 1.0 if not macro_found else client.retract|default(1.0) %} {% set speed = params.SPEED if params.SPEED is defined else 35 if not macro_found else client.speed_retract|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [mcu] serial = /dev/serial/by-id/ [printer] kinematics = none max_velocity = 1000 max_accel = 1000 ======================= mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' webhooks client 4126084880: New connection webhooks client 4126084880: Client info {'program': 'Moonraker', 'version': 'v0.8.0-45-gc41c588'} mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' Attempting MCU 'mcu' reset Unhandled exception during post run Traceback (most recent call last): File "/home/pi/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) FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pi/klipper/klippy/klippy.py", line 234, in run self.send_event("klippy:firmware_restart") File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/mcu.py", line 949, in _firmware_restart self._restart_arduino() File "/home/pi/klipper/klippy/mcu.py", line 909, in _restart_arduino serialhdl.arduino_reset(self._serialport, self._reactor) File "/home/pi/klipper/klippy/serialhdl.py", line 379, in arduino_reset ser = serial.Serial(serialport, 2400, timeout=0, exclusive=True) File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialutil.py", line 240, in __init__ self.open() File "/home/pi/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 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' Restarting printer Start printer at Tue May 30 10:55:36 2023 (1685469337.0 39.3) ===== Config file ===== [virtual_sdcard] path = /home/pi/printer_data/gcodes on_error_gcode = CANCEL_PRINT [pause_resume] [display_status] [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set allow_park = False if not macro_found else False if client.park_at_cancel is not defined else True if client.park_at_cancel|lower == 'true' else False %} {% set retract = 5.0 if not macro_found else client.cancel_retract|default(5.0)|abs %} {% set park_x = "" if not macro_found else "" if client.park_at_cancel_x is not defined else "X=" + client.park_at_cancel_x|string if client.park_at_cancel_x is not none %} {% set park_y = "" if not macro_found else "" if client.park_at_cancel_y is not defined else "Y=" + client.park_at_cancel_y|string if client.park_at_cancel_y is not none %} {% set custom_park = True if (park_x|length > 0 or park_y|length > 0) else False %} {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %} _CLIENT_RETRACT LENGTH={retract} TURN_OFF_HEATERS M106 S0 SET_PAUSE_NEXT_LAYER ENABLE=0 SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0 CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{printer[printer.toolhead.extruder].target}" PAUSE_BASE _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = 0 gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set sp_move = velocity if not macro_found else client.speed_move|default(velocity) %} M109 S{last_extruder_temp} _CLIENT_EXTRUDE RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)} [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 %} {action_respond_info("%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 %} {action_respond_info("%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 macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = False if not macro_found else False if client.use_custom_pos is not defined else True if client.use_custom_pos|lower == 'true' else False %} {% set custom_park_x = 0.0 if not macro_found else client.custom_park_x|default(0.0) %} {% set custom_park_y = 0.0 if not macro_found else client.custom_park_y|default(0.0) %} {% set park_dz = 2.0 if not macro_found else client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = 900 if not macro_found else client.speed_hop|default(15) * 60 %} {% set sp_move = velocity * 60 if not macro_found else 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 %} {action_respond_info("Printer not homed")} {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set use_fw_retract = False if not macro_found else False if client.use_fw_retract is not defined else True if client.use_fw_retract|lower == 'true' and printer.firmware_retraction is defined else False %} {% set length = (params.LENGTH|float) if params.LENGTH is defined else 1.0 if not macro_found else client.unretract|default(1.0) %} {% set speed = params.SPEED if params.SPEED is defined else 35 if not macro_found else client.speed_unretract|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.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 %} {action_respond_info("Extruder not hot enough")} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set length = (params.LENGTH|float) if params.LENGTH is defined else 1.0 if not macro_found else client.retract|default(1.0) %} {% set speed = params.SPEED if params.SPEED is defined else 35 if not macro_found else client.speed_retract|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [mcu] serial = /dev/serial/by-id/ [printer] kinematics = none max_velocity = 1000 max_accel = 1000 ======================= mcu 'mcu': Starting serial connect mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' webhooks client 4130583120: New connection webhooks client 4130583120: Client info {'program': 'Moonraker', 'version': 'v0.8.0-45-gc41c588'} mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' MCU error during connect Traceback (most recent call last): File "/home/pi/klipper/klippy/mcu.py", line 798, in _mcu_identify self._serial.connect_uart(self._serialport, self._baud, rts) File "/home/pi/klipper/klippy/serialhdl.py", line 182, in connect_uart self._error("Unable to connect") File "/home/pi/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/pi/klipper/klippy/klippy.py", line 176, in _connect self.send_event("klippy:mcu_identify") File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/mcu.py", line 803, in _mcu_identify raise error(str(e)) mcu.error: mcu 'mcu': Unable to connect No build file /home/pi/klipper/klippy/../.config No build file /home/pi/klipper/klippy/../out/klipper.dict No build file /home/pi/klipper/klippy/../out/klipper.elf Attempting MCU 'mcu' reset Unhandled exception during post run Traceback (most recent call last): File "/home/pi/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) FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pi/klipper/klippy/klippy.py", line 234, in run self.send_event("klippy:firmware_restart") File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/klippy.py", line 263, in return [cb(*params) for cb in self.event_handlers.get(event, [])] File "/home/pi/klipper/klippy/mcu.py", line 949, in _firmware_restart self._restart_arduino() File "/home/pi/klipper/klippy/mcu.py", line 909, in _restart_arduino serialhdl.arduino_reset(self._serialport, self._reactor) File "/home/pi/klipper/klippy/serialhdl.py", line 379, in arduino_reset ser = serial.Serial(serialport, 2400, timeout=0, exclusive=True) File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialutil.py", line 240, in __init__ self.open() File "/home/pi/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 2] could not open port /dev/serial/by-id/: [Errno 2] No such file or directory: '/dev/serial/by-id/' Restarting printer Start printer at Tue May 30 11:07:32 2023 (1685470052.2 754.6) ===== Config file ===== [virtual_sdcard] path = /home/pi/printer_data/gcodes on_error_gcode = CANCEL_PRINT [pause_resume] [display_status] [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set allow_park = False if not macro_found else False if client.park_at_cancel is not defined else True if client.park_at_cancel|lower == 'true' else False %} {% set retract = 5.0 if not macro_found else client.cancel_retract|default(5.0)|abs %} {% set park_x = "" if not macro_found else "" if client.park_at_cancel_x is not defined else "X=" + client.park_at_cancel_x|string if client.park_at_cancel_x is not none %} {% set park_y = "" if not macro_found else "" if client.park_at_cancel_y is not defined else "Y=" + client.park_at_cancel_y|string if client.park_at_cancel_y is not none %} {% set custom_park = True if (park_x|length > 0 or park_y|length > 0) else False %} {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %} _CLIENT_RETRACT LENGTH={retract} TURN_OFF_HEATERS M106 S0 SET_PAUSE_NEXT_LAYER ENABLE=0 SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0 CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{printer[printer.toolhead.extruder].target}" PAUSE_BASE _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = 0 gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set sp_move = velocity if not macro_found else client.speed_move|default(velocity) %} M109 S{last_extruder_temp} _CLIENT_EXTRUDE RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)} [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 %} {action_respond_info("%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 %} {action_respond_info("%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 macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = False if not macro_found else False if client.use_custom_pos is not defined else True if client.use_custom_pos|lower == 'true' else False %} {% set custom_park_x = 0.0 if not macro_found else client.custom_park_x|default(0.0) %} {% set custom_park_y = 0.0 if not macro_found else client.custom_park_y|default(0.0) %} {% set park_dz = 2.0 if not macro_found else client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = 900 if not macro_found else client.speed_hop|default(15) * 60 %} {% set sp_move = velocity * 60 if not macro_found else 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 %} {action_respond_info("Printer not homed")} {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set use_fw_retract = False if not macro_found else False if client.use_fw_retract is not defined else True if client.use_fw_retract|lower == 'true' and printer.firmware_retraction is defined else False %} {% set length = (params.LENGTH|float) if params.LENGTH is defined else 1.0 if not macro_found else client.unretract|default(1.0) %} {% set speed = params.SPEED if params.SPEED is defined else 35 if not macro_found else client.speed_unretract|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.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 %} {action_respond_info("Extruder not hot enough")} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set length = (params.LENGTH|float) if params.LENGTH is defined else 1.0 if not macro_found else client.retract|default(1.0) %} {% set speed = params.SPEED if params.SPEED is defined else 35 if not macro_found else client.speed_retract|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [mcu] serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 [printer] kinematics = none max_velocity = 1000 max_accel = 1000 ======================= mcu 'mcu': Starting serial connect webhooks client 4130582688: New connection webhooks client 4130582688: Client info {'program': 'Moonraker', 'version': 'v0.8.0-45-gc41c588'} Loaded MCU 'mcu' 105 commands (v0.11.0-201-g37315bf3 / gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.34-4+rpi1+14) 2.34) MCU 'mcu' config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 BUS_PINS_i2c1a=PB8,PB9 BUS_PINS_i2c2=PB10,PB11 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi3=PB4,PB5,PB3 CLOCK_FREQ=72000000 INITIAL_PINS=!PC6,!PD13 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PB11,PB10 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Sending MCU 'mcu' printer configuration... Configured MCU 'mcu' (1024 moves) webhooks: registering remote method 'shutdown_machine' for connection id: 4130582688 webhooks: registering remote method 'reboot_machine' for connection id: 4130582688 webhooks: registering remote method 'pause_job_queue' for connection id: 4130582688 webhooks: registering remote method 'start_job_queue' for connection id: 4130582688 Stats 1585.5: gcodein=0 mcu: mcu_awake=0.000 mcu_task_avg=0.000005 mcu_task_stddev=0.000004 bytes_write=5786 bytes_read=19548 bytes_retransmit=9 bytes_invalid=0 send_seq=943 receive_seq=943 retransmit_seq=2 srtt=0.003 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=71997807 sysload=0.07 cputime=8.395 memavail=7571968 print_time=2687.588 buffer_time=0.242 print_stall=0 webhooks client 4130582688: Disconnected Restarting printer Start printer at Tue May 30 11:21:24 2023 (1685470884.5 1586.8) ===== Config file ===== [virtual_sdcard] path = /home/pi/printer_data/gcodes on_error_gcode = CANCEL_PRINT [pause_resume] [display_status] [gcode_macro CANCEL_PRINT] description = Cancel the actual running print rename_existing = CANCEL_PRINT_BASE gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set allow_park = False if not macro_found else False if client.park_at_cancel is not defined else True if client.park_at_cancel|lower == 'true' else False %} {% set retract = 5.0 if not macro_found else client.cancel_retract|default(5.0)|abs %} {% set park_x = "" if not macro_found else "" if client.park_at_cancel_x is not defined else "X=" + client.park_at_cancel_x|string if client.park_at_cancel_x is not none %} {% set park_y = "" if not macro_found else "" if client.park_at_cancel_y is not defined else "Y=" + client.park_at_cancel_y|string if client.park_at_cancel_y is not none %} {% set custom_park = True if (park_x|length > 0 or park_y|length > 0) else False %} {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %} _CLIENT_RETRACT LENGTH={retract} TURN_OFF_HEATERS M106 S0 SET_PAUSE_NEXT_LAYER ENABLE=0 SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0 CANCEL_PRINT_BASE [gcode_macro PAUSE] description = Pause the actual running print rename_existing = PAUSE_BASE gcode = SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{printer[printer.toolhead.extruder].target}" PAUSE_BASE _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams} [gcode_macro RESUME] description = Resume the actual running print rename_existing = RESUME_BASE variable_last_extruder_temp = 0 gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set sp_move = velocity if not macro_found else client.speed_move|default(velocity) %} M109 S{last_extruder_temp} _CLIENT_EXTRUDE RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)} [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 %} {action_respond_info("%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 %} {action_respond_info("%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 macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %} {% set use_custom = False if not macro_found else False if client.use_custom_pos is not defined else True if client.use_custom_pos|lower == 'true' else False %} {% set custom_park_x = 0.0 if not macro_found else client.custom_park_x|default(0.0) %} {% set custom_park_y = 0.0 if not macro_found else client.custom_park_y|default(0.0) %} {% set park_dz = 2.0 if not macro_found else client.custom_park_dz|default(2.0)|abs %} {% set sp_hop = 900 if not macro_found else client.speed_hop|default(15) * 60 %} {% set sp_move = velocity * 60 if not macro_found else 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 %} {action_respond_info("Printer not homed")} {% endif %} [gcode_macro _CLIENT_EXTRUDE] description = Extrudes, if the extruder is hot enough gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set use_fw_retract = False if not macro_found else False if client.use_fw_retract is not defined else True if client.use_fw_retract|lower == 'true' and printer.firmware_retraction is defined else False %} {% set length = (params.LENGTH|float) if params.LENGTH is defined else 1.0 if not macro_found else client.unretract|default(1.0) %} {% set speed = params.SPEED if params.SPEED is defined else 35 if not macro_found else client.speed_unretract|default(35) %} {% set absolute_extrude = printer.gcode_move.absolute_extrude %} {% if printer.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 %} {action_respond_info("Extruder not hot enough")} {% endif %} [gcode_macro _CLIENT_RETRACT] description = Retracts, if the extruder is hot enough gcode = {% set macro_found = True if printer['gcode_macro _CLIENT_VARIABLE'] is defined else False %} {% set client = printer['gcode_macro _CLIENT_VARIABLE'] %} {% set length = (params.LENGTH|float) if params.LENGTH is defined else 1.0 if not macro_found else client.retract|default(1.0) %} {% set speed = params.SPEED if params.SPEED is defined else 35 if not macro_found else client.speed_retract|default(35) %} _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs} [mcu] serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 [printer] kinematics = none max_velocity = 1000 max_accel = 1000 ======================= mcu 'mcu': Starting serial connect webhooks client 4130584224: New connection webhooks client 4130584224: Client info {'program': 'Moonraker', 'version': 'v0.8.0-45-gc41c588'} Loaded MCU 'mcu' 105 commands (v0.11.0-201-g37315bf3 / gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.34-4+rpi1+14) 2.34) MCU 'mcu' config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 BUS_PINS_i2c1a=PB8,PB9 BUS_PINS_i2c2=PB10,PB11 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi3=PB4,PB5,PB3 CLOCK_FREQ=72000000 INITIAL_PINS=!PC6,!PD13 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PB11,PB10 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1 Configured MCU 'mcu' (1024 moves) webhooks: registering remote method 'shutdown_machine' for connection id: 4130584224 webhooks: registering remote method 'reboot_machine' for connection id: 4130584224 webhooks: registering remote method 'pause_job_queue' for connection id: 4130584224 webhooks: registering remote method 'start_job_queue' for connection id: 4130584224 Starting SD card print (position 0) Unknown command:"START_PRINT" Unknown command:"SET_PRESSURE_ADVANCE" Unknown command:"M104" Unknown command:"M109" Unknown command:"M190" Extrude when no extruder present: 0.000 0.000 0.000 [-1.200] Error evaluating 'gcode_macro _CLIENT_EXTRUDE:gcode': jinja2.exceptions.UndefinedError: 'extras.gcode_macro.GetStatusWrapper object' has no attribute 'extruder' Traceback (most recent call last): File "/home/pi/klipper/klippy/extras/virtual_sdcard.py", line 264, in work_handler self.gcode.run_script(line) File "/home/pi/klipper/klippy/gcode.py", line 216, in run_script self._process_commands(script.split('\n'), need_ack=False) File "/home/pi/klipper/klippy/gcode.py", line 198, in _process_commands handler(gcmd) File "/home/pi/klipper/klippy/extras/gcode_move.py", line 143, in cmd_G1 self.move_with_transform(self.last_position, self.speed) File "/home/pi/klipper/klippy/toolhead.py", line 424, in move self.extruder.check_move(move) File "/home/pi/klipper/klippy/kinematics/extruder.py", line 319, in check_move raise move.move_error("Extrude when no extruder present") gcode.CommandError: Extrude when no extruder present: 0.000 0.000 0.000 [-1.200] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/pi/klipper/klippy/extras/gcode_macro.py", line 61, in render return str(self.template.render(context)) File "/home/pi/klippy-env/lib/python3.9/site-packages/jinja2/environment.py", line 1090, in render self.environment.handle_exception() File "/home/pi/klippy-env/lib/python3.9/site-packages/jinja2/environment.py", line 832, in handle_exception reraise(*rewrite_traceback_stack(source=source)) File "/home/pi/klippy-env/lib/python3.9/site-packages/jinja2/_compat.py", line 28, in reraise raise value.with_traceback(tb) File "