Aller au contenu

Anycubic Kobra 3 Combo

KLIPPER ---> mcu 'mcu': Unable to connect


Aller à la solution Résolu par RicoDarksky,

Messages recommandés


Salut à tous,

Depuis quelques jours, je fais de nombreux efforts pour me connecter à Mainsail avec Klipper. J'ai suivi plusieurs tutoriels et explications, mais je suis complètement perdu à ce stade. Deux tutoriels en particulier semblaient bien détaillés :

J'ai suivi le tutoriel sur l'installation et la configuration de Klipper pour toutes les imprimantes 3D, notamment l'Ender 3, CR-10, Anycubic, etc.

J'ai également exploré un guide sur CB1, une alternative à la Raspberry Pi pour Klipper, qui portait sur sa présentation et son installation.

Mon imprimante est une Ender 3 v1 avec une carte Creality 4.2.7, à laquelle j'ai ajouté le BIGTREETECH BTT Pi V1.2 et l'écran tactile BIGTREETECH TFT35 SPI V2.1 pour CB1.

Un autre problème que je rencontre est un écran blanc sur le TFT35, et je ne parviens pas à résoudre ce problème non plus.

Pour vous donner un aperçu de ma configuration, voici quelques détails :

Mon MCU est configuré comme suit : serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 (j'ai essayé avec plusieurs câbles).
Je vous remercie infiniment pour votre précieuse aide.

Capture.PNG

Capture2.PNG

Capture3.PNG

Lien vers le commentaire
Partager sur d’autres sites

il y a 12 minutes, RicoDarksky a dit :

Mon MCU est configuré comme suit : serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0

si tu fais un ls /dev/serial/by-id/ ça te donnes quoi ?

Lien vers le commentaire
Partager sur d’autres sites

Salut,

Est-ce que tu pourrais fournir le contenu du fichier printer.cfg (à copier dans un fichier texte que tu joints à ton message ou à copier dans une citation, icône guillemet)?

Tu peux aussi passer par la commande ls -l /dev/serial/by-path/ . C'est ce qui a dû être fait sur un PAD 7 de chez BigTreeTech avec CB1 pour établir la communication.

Modifié (le) par pommeverte
Lien vers le commentaire
Partager sur d’autres sites

 avec la commande ls -l /dev/serial/by-path/ cela donne ca que je vais essayer on c'est jamais 😉

pour le fichier printer.cfg

 

Citation

# This file contains pin mappings for the stock 2020 Creality Ender 3
# Pro with the 32-bit Creality 4.2.2 board. To use this config, during
# "make menuconfig" select the STM32F103 with a "28KiB bootloader" and
# serial (on USART1 PA10/PA9) communication.

# It should be noted that newer variations of this printer shipping in
# 2022 may have GD32F103 chips installed and not STM32F103. You may
# have to inspect the mainboard to ascertain which one you have. If it
# is the GD32F103 then please select Disable SWD at startup in the
# "make menuconfig" along with the same settings for STM32F103.

# If you prefer a direct serial connection, in "make menuconfig"
# select "Enable extra low-level configuration options" and select
# serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC
# cable used for the LCD module as follows:
# 3: Tx, 4: Rx, 9: GND, 10: VCC

# Flash this firmware by copying "out/klipper.bin" to a SD card and
# turning on the printer with the card inserted. The firmware
# filename must end in ".bin" and must not match the last filename
# that was flashed.

# See docs/Config_Reference.md for a description of parameters.

[stepper_x]
step_pin: PC2
dir_pin: PB9
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA5
position_endstop: 0
position_max: 235
homing_speed: 50

[stepper_y]
step_pin: PB8
dir_pin: PB7
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA6
position_endstop: 0
position_max: 235
homing_speed: 50

[stepper_z]
step_pin: PB6
dir_pin: !PB5
enable_pin: !PC3
microsteps: 16
rotation_distance: 8
endstop_pin: ^PA7
position_endstop: 0.0
position_max: 250

[extruder]
max_extrude_only_distance: 100.0
step_pin: PB4
dir_pin: PB3
enable_pin: !PC3
microsteps: 16
rotation_distance: 34.406
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA1
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC5
control: pid
# tuned for stock hardware with 200 degree Celsius target
pid_Kp: 21.527
pid_Ki: 1.063
pid_Kd: 108.982
min_temp: 0
max_temp: 250

[heater_bed]
heater_pin: PA2
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC4
control: pid
# tuned for stock hardware with 50 degree Celsius target
pid_Kp: 54.027
pid_Ki: 0.770
pid_Kd: 948.182
min_temp: 0
max_temp: 130

[fan]
pin: PA0

[mcu]
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method: command

[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100

# Pin mappings for BL_T port
#[bltouch]
#sensor_pin: ^PB1
#control_pin: PB0

[display]
lcd_type: st7920
cs_pin: PB12
sclk_pin: PB13
sid_pin: PB15
encoder_pins: ^PB14, ^PB10
click_pin: ^!PB2
[include mainsail.cfg]

 

Capture5.PNG

Lien vers le commentaire
Partager sur d’autres sites

il y a 6 minutes, pommeverte a dit :

serial: /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0

non plu

il y a 1 minute, pommeverte a dit :

ATTENTION: ce n'est pas by-id mais by-path

ok

j'ai bien mis serial: /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0

c'est dingue avec mon encienne carte 1.1.4 ca marcher nikel

Lien vers le commentaire
Partager sur d’autres sites

Ok pas de souci en tous cas merci de ton aide
ci-joint klippy.log

Citation

===== Config file =====
[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}

[stepper_x]
step_pin = PB9
dir_pin = PC2
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB7
dir_pin = PB8
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB5
dir_pin = !PB6
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB3
dir_pin = PB4
enable_pin = !PC3
microsteps = 16
rotation_distance = 33.500
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[board_pins]
aliases = 
    EXP1_1=PC6,EXP1_3=PB10,EXP1_5=PB14,EXP1_7=PB12,EXP1_9=<GND>,
    EXP1_2=PB2,EXP1_4=PB11,EXP1_6=PB13,EXP1_8=PB15,EXP1_10=<5V>,
    PROBE_IN=PB0,PROBE_OUT=PB1,FIL_RUNOUT=PC6
=======================
Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock']
Git version: 'v0.11.0-276-ge9bf2d4c'
Branch: master
Remote: origin
Tracked URL: https://github.com/Klipper3d/klipper
CPU: 4 core ?
Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]'
webhooks client 281472905649840: {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
=============== Log rollover at Tue Sep 26 08:35:01 2023 ===============
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(3443): Sun Sep 24 20:25:23 2023
========= Last MCU build config =========
CONFIG_LOW_LEVEL_OPTIONS=y
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
# CONFIG_MACH_STM32F103x6 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
# CONFIG_STM32F103GD_DISABLE_SWD is not set
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_STM32_CLOCK_REF_8M=y
# CONFIG_STM32_CLOCK_REF_12M is not set
# CONFIG_STM32_CLOCK_REF_16M is not set
# CONFIG_STM32_CLOCK_REF_20M is not set
# CONFIG_STM32_CLOCK_REF_24M is not set
# CONFIG_STM32_CLOCK_REF_25M is not set
# CONFIG_STM32_CLOCK_REF_INTERNAL is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set
# CONFIG_STM32_SERIAL_USART2 is not set
# CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set
# CONFIG_STM32_SERIAL_USART3 is not set
# CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_INITIAL_PINS=""
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Sun Sep 24 20:26:07 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Sun Sep 24 20:26:22 2023
Unable to issue reset command on MCU 'mcu'
webhooks client 281472905649840: Disconnected
Restarting printer
Start printer at Tue Sep 26 08:36:20 2023 (1695717380.4 171.8)
===== Config file =====
[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}

[stepper_x]
step_pin = PB9
dir_pin = PC2
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB7
dir_pin = PB8
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB5
dir_pin = !PB6
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB3
dir_pin = PB4
enable_pin = !PC3
microsteps = 16
rotation_distance = 33.500
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[board_pins]
aliases = 
    EXP1_1=PC6,EXP1_3=PB10,EXP1_5=PB14,EXP1_7=PB12,EXP1_9=<GND>,
    EXP1_2=PB2,EXP1_4=PB11,EXP1_6=PB13,EXP1_8=PB15,EXP1_10=<5V>,
    PROBE_IN=PB0,PROBE_OUT=PB1,FIL_RUNOUT=PC6
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
webhooks client 281472912630688: New connection
webhooks client 281472912630688: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281472912630688: Disconnected
Restarting printer
Start printer at Tue Sep 26 08:36:55 2023 (1695717415.7 207.2)
===== Config file =====
[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}

[stepper_x]
step_pin = PB9
dir_pin = PC2
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB7
dir_pin = PB8
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB5
dir_pin = !PB6
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB3
dir_pin = PB4
enable_pin = !PC3
microsteps = 16
rotation_distance = 33.500
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[board_pins]
aliases = 
    EXP1_1=PC6,EXP1_3=PB10,EXP1_5=PB14,EXP1_7=PB12,EXP1_9=<GND>,
    EXP1_2=PB2,EXP1_4=PB11,EXP1_6=PB13,EXP1_8=PB15,EXP1_10=<5V>,
    PROBE_IN=PB0,PROBE_OUT=PB1,FIL_RUNOUT=PC6
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281472905120592: New connection
webhooks client 281472905120592: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281472905120592: Disconnected
Restarting printer
Start printer at Tue Sep 26 08:37:03 2023 (1695717423.9 215.3)
===== Config file =====
[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}

[stepper_x]
step_pin = PB9
dir_pin = PC2
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB7
dir_pin = PB8
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB5
dir_pin = !PB6
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB3
dir_pin = PB4
enable_pin = !PC3
microsteps = 16
rotation_distance = 33.500
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[board_pins]
aliases = 
    EXP1_1=PC6,EXP1_3=PB10,EXP1_5=PB14,EXP1_7=PB12,EXP1_9=<GND>,
    EXP1_2=PB2,EXP1_4=PB11,EXP1_6=PB13,EXP1_8=PB15,EXP1_10=<5V>,
    PROBE_IN=PB0,PROBE_OUT=PB1,FIL_RUNOUT=PC6
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281472905257312: New connection
webhooks client 281472905257312: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
webhooks client 281472905257312: Disconnected
Restarting printer
Start printer at Tue Sep 26 08:37:09 2023 (1695717429.1 220.5)
===== Config file =====
[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}

[stepper_x]
step_pin = PB9
dir_pin = PC2
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB7
dir_pin = PB8
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB5
dir_pin = !PB6
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB3
dir_pin = PB4
enable_pin = !PC3
microsteps = 16
rotation_distance = 33.500
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[board_pins]
aliases = 
    EXP1_1=PC6,EXP1_3=PB10,EXP1_5=PB14,EXP1_7=PB12,EXP1_9=<GND>,
    EXP1_2=PB2,EXP1_4=PB11,EXP1_6=PB13,EXP1_8=PB15,EXP1_10=<5V>,
    PROBE_IN=PB0,PROBE_OUT=PB1,FIL_RUNOUT=PC6
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281472905869824: New connection
webhooks client 281472905869824: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(3443): Sun Sep 24 20:25:23 2023
========= Last MCU build config =========
CONFIG_LOW_LEVEL_OPTIONS=y
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
# CONFIG_MACH_STM32F103x6 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
# CONFIG_STM32F103GD_DISABLE_SWD is not set
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_STM32_CLOCK_REF_8M=y
# CONFIG_STM32_CLOCK_REF_12M is not set
# CONFIG_STM32_CLOCK_REF_16M is not set
# CONFIG_STM32_CLOCK_REF_20M is not set
# CONFIG_STM32_CLOCK_REF_24M is not set
# CONFIG_STM32_CLOCK_REF_25M is not set
# CONFIG_STM32_CLOCK_REF_INTERNAL is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set
# CONFIG_STM32_SERIAL_USART2 is not set
# CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set
# CONFIG_STM32_SERIAL_USART3 is not set
# CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_INITIAL_PINS=""
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Sun Sep 24 20:26:07 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Sun Sep 24 20:26:22 2023
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281472905869824: Disconnected
Restarting printer
Start printer at Tue Sep 26 09:26:15 2023 (1695720375.4 3166.9)
Unable to open config file /home/biqu/printer_data/config/printer.cfg
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/configfile.py", line 158, in _read_config_file
    f = open(filename, 'r')
FileNotFoundError: [Errno 2] No such file or directory: '/home/biqu/printer_data/config/printer.cfg'
Config error
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/configfile.py", line 158, in _read_config_file
    f = open(filename, 'r')
FileNotFoundError: [Errno 2] No such file or directory: '/home/biqu/printer_data/config/printer.cfg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 175, in _connect
    self._read_config()
  File "/home/biqu/klipper/klippy/klippy.py", line 134, in _read_config
    config = pconfig.read_main_config()
  File "/home/biqu/klipper/klippy/configfile.py", line 279, in read_main_config
    data = self._read_config_file(filename)
  File "/home/biqu/klipper/klippy/configfile.py", line 164, in _read_config_file
    raise error(msg)
configparser.Error: Unable to open config file /home/biqu/printer_data/config/printer.cfg
webhooks client 281472906581760: New connection
webhooks client 281472906581760: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
webhooks client 281472906581760: Disconnected
Restarting printer
Start printer at Tue Sep 26 09:28:56 2023 (1695720536.2 3327.7)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281472820063248: New connection
webhooks client 281472820063248: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281472820063248: Disconnected
Restarting printer
Start printer at Tue Sep 26 09:29:33 2023 (1695720573.6 3365.1)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281472820402880: New connection
webhooks client 281472820402880: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Starting Klippy...
Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock']
Git version: 'v0.11.0-276-ge9bf2d4c'
Branch: master
Remote: origin
Tracked URL: https://github.com/Klipper3d/klipper
CPU: 4 core ?
Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]'
Start printer at Tue Sep 26 09:30:37 2023 (1695720637.9 30.9)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
webhooks client 281473142659248: New connection
webhooks client 281473142659248: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(2747): Tue Sep 26 08:57:31 2023
========= Last MCU build config =========
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Tue Sep 26 08:59:12 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Tue Sep 26 08:59:29 2023
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281473142659248: Disconnected
Restarting printer
Start printer at Tue Sep 26 09:33:24 2023 (1695720805.0 182.9)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473142795904: New connection
webhooks client 281473142795904: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(2747): Tue Sep 26 08:57:31 2023
========= Last MCU build config =========
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Tue Sep 26 08:59:12 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Tue Sep 26 08:59:29 2023
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281473142795904: Disconnected
Restarting printer
Start printer at Tue Sep 26 09:36:52 2023 (1695721012.3 390.2)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473141941152: New connection
webhooks client 281473141941152: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(2747): Tue Sep 26 08:57:31 2023
========= Last MCU build config =========
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Tue Sep 26 08:59:12 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Tue Sep 26 08:59:29 2023
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281473141941152: Disconnected
Restarting printer
Start printer at Tue Sep 26 09:40:53 2023 (1695721253.9 631.8)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473149773856: New connection
webhooks client 281473149773856: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281473149773856: Disconnected
Restarting printer
Start printer at Tue Sep 26 09:41:24 2023 (1695721284.7 662.6)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473142900768: New connection
webhooks client 281473142900768: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281473142900768: Disconnected
Restarting printer
Start printer at Tue Sep 26 09:41:49 2023 (1695721309.7 687.6)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473143009440: New connection
webhooks client 281473143009440: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(2747): Tue Sep 26 08:57:31 2023
========= Last MCU build config =========
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Tue Sep 26 08:59:12 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Tue Sep 26 08:59:29 2023
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281473143009440: Disconnected
Restarting printer
Start printer at Tue Sep 26 09:44:31 2023 (1695721471.4 849.3)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473124672128: New connection
webhooks client 281473124672128: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
b'Got EOF when reading from device'
mcu 'mcu': Timeout on connect
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(2747): Tue Sep 26 08:57:31 2023
========= Last MCU build config =========
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Tue Sep 26 08:59:12 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Tue Sep 26 08:59:29 2023
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281473124672128: Disconnected
Restarting printer
Start printer at Tue Sep 26 09:49:53 2023 (1695721793.8 1171.7)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
webhooks client 281473141722080: New connection
webhooks client 281473141722080: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
mcu 'mcu': Unable to open serial port: [Errno 21] could not open port /dev/serial/by-id/: [Errno 21] Is a directory: '/dev/serial/by-id/'
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(2747): Tue Sep 26 08:57:31 2023
========= Last MCU build config =========
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Tue Sep 26 08:59:12 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Tue Sep 26 08:59:29 2023
Unable to issue reset command on MCU 'mcu'
webhooks client 281473141722080: Disconnected
Restarting printer
Start printer at Tue Sep 26 11:10:34 2023 (1695726634.3 6012.2)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473142920288: New connection
webhooks client 281473142920288: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(2747): Tue Sep 26 08:57:31 2023
========= Last MCU build config =========
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Tue Sep 26 08:59:12 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Tue Sep 26 08:59:29 2023
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Starting Klippy...
Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock']
Git version: 'v0.11.0-276-ge9bf2d4c'
Branch: master
Remote: origin
Tracked URL: https://github.com/Klipper3d/klipper
CPU: 4 core ?
Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]'
Start printer at Tue Sep 26 11:17:23 2023 (1695727043.3 31.3)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473343093296: New connection
webhooks client 281473343093296: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
b'Got EOF when reading from device'
mcu 'mcu': Timeout on connect
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0'
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(2747): Tue Sep 26 08:57:31 2023
========= Last MCU build config =========
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Tue Sep 26 08:59:12 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Tue Sep 26 08:59:29 2023
Unable to issue reset command on MCU 'mcu'
webhooks client 281473343093296: Disconnected
Restarting printer
Start printer at Tue Sep 26 15:15:31 2023 (1695741331.5 4511.9)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473343496496: New connection
webhooks client 281473343496496: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(2747): Tue Sep 26 08:57:31 2023
========= Last MCU build config =========
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Tue Sep 26 08:59:12 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Tue Sep 26 08:59:29 2023
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281473343496496: Disconnected
Restarting printer
Start printer at Tue Sep 26 17:16:03 2023 (1695748563.6 11744.0)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473350214032: New connection
webhooks client 281473350214032: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(2747): Tue Sep 26 08:57:31 2023
========= Last MCU build config =========
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Tue Sep 26 08:59:12 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Tue Sep 26 08:59:29 2023
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
webhooks client 281473350214032: Disconnected
webhooks client 281473350214416: New connection
webhooks client 281473350214416: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
Unable to issue reset command on MCU 'mcu'
webhooks client 281473350214416: Disconnected
Restarting printer
Start printer at Tue Sep 26 17:55:51 2023 (1695750951.2 14131.6)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473343561984: New connection
webhooks client 281473343561984: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(2747): Tue Sep 26 08:57:31 2023
========= Last MCU build config =========
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Tue Sep 26 08:59:12 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Tue Sep 26 08:59:29 2023
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281473343561984: Disconnected
Restarting printer
Start printer at Tue Sep 26 20:19:07 2023 (1695759547.3 22727.7)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
webhooks client 281473342306624: New connection
webhooks client 281473342306624: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
Unable to issue reset command on MCU 'mcu'
webhooks client 281473342306624: Disconnected
Restarting printer
Start printer at Tue Sep 26 20:19:19 2023 (1695759559.4 22739.9)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
webhooks client 281473325164096: New connection
webhooks client 281473325164096: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 2] No such file or directory: '/dev/serial/by-id/platform-5101400.usb-usb-0:1:1.0-port0'
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(2747): Tue Sep 26 08:57:31 2023
========= Last MCU build config =========
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Tue Sep 26 08:59:12 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Tue Sep 26 08:59:29 2023
Unable to issue reset command on MCU 'mcu'
webhooks client 281473325164096: Disconnected
Restarting printer
Start printer at Tue Sep 26 20:24:28 2023 (1695759868.2 23048.6)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
webhooks client 281473343674928: New connection
webhooks client 281473343674928: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
Unable to issue reset command on MCU 'mcu'
webhooks client 281473343674928: Disconnected
Restarting printer
Start printer at Tue Sep 26 20:24:35 2023 (1695759875.6 23056.0)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
webhooks client 281473325117600: New connection
webhooks client 281473325117600: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
Unable to issue reset command on MCU 'mcu'
webhooks client 281473325117600: Disconnected
Restarting printer
Start printer at Tue Sep 26 20:24:52 2023 (1695759892.1 23072.5)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
webhooks client 281473343276608: New connection
webhooks client 281473343276608: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(2747): Tue Sep 26 08:57:31 2023
========= Last MCU build config =========
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Tue Sep 26 08:59:12 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Tue Sep 26 08:59:29 2023
Unable to issue reset command on MCU 'mcu'
webhooks client 281473343276608: Disconnected
Restarting printer
Start printer at Tue Sep 26 20:30:39 2023 (1695760239.7 23420.1)
===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
webhooks client 281473325188000: New connection
webhooks client 281473325188000: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-5200000.usb-usb-0:1.2:1.0'
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(2747): Tue Sep 26 08:57:31 2023
========= Last MCU build config =========
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Tue Sep 26 08:59:12 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Tue Sep 26 08:59:29 2023
 

 

Lien vers le commentaire
Partager sur d’autres sites

Très bonne question  on c'est jamais 😉

  • Nom de la carte : CREALITY 4.2.7
  • Microcontrôleur  STM32F103 / RET6 / 990R3 93 / MYS 99 152 ST 03
  • lettre sur le lecteur : T5 🤔

pour moi c'est bon dans ma config, mais la lettre T5 m'étonne, je doit dire.

Capture.PNG.6965b6bb030ecb2a9d9f2c5a18e359ef.PNG

La je vois pas d'où viens le problème 
PS: Enable extra ...... options peut etre utile ? 

1695796496240.jpg

1695796496231.jpg

Lien vers le commentaire
Partager sur d’autres sites

il y a 17 minutes, hyoti a dit :

Bonjour @RicoDarksky

T5 c'est pour les contrôleurs moteurs TMC2225

🙂

Bon ok ca m'explique pas la lettre de lecteur alors 🤔

il y a 14 minutes, RicoDarksky a dit :

Bon ok ca m'explique pas la lettre de lecteur alors 🤔

en cherchant un peu avec la commande lsblk peut etre sa peut vous aidez ?
 

Captu6re.PNG

Lien vers le commentaire
Partager sur d’autres sites

Il y a 1 heure, RicoDarksky a dit :

La je vois pas d'où viens le problème 

Vite fait en passant.

Si tu as respecté la procédure, à ce stade il ne reste plus beaucoup d'alternatives.

- Vérifier que tout le monde est à la même vitesse, mini 115200. Attention sur les dernières mise à jour du "make" ils ont changé pour 250000, je crois.

- Débrancher l'écran LCD du contrôleur durant l'opération suivante.

- Flasher la carte contrôleur avec le .bin sur une SDcard.

 

 

Lien vers le commentaire
Partager sur d’autres sites

Il y a 3 heures, RicoDarksky a dit :

en cherchant un peu avec la commande lsblk peut etre sa peut vous aidez ?

un lsusb ça te donne quoi comme infos ?

 

Lors du make menuconfig, coche la case 'extra low level options' pour avoir plus de détails

Modifié (le) par Savate
Lien vers le commentaire
Partager sur d’autres sites

Il y a 7 heures, Funboard29 a dit :

Vite fait en passant.

Si tu as respecté la procédure, à ce stade il ne reste plus beaucoup d'alternatives.

- Vérifier que tout le monde est à la même vitesse, mini 115200. Attention sur les dernières mise à jour du "make" ils ont changé pour 250000, je crois.

- Débrancher l'écran LCD du contrôleur durant l'opération suivante.

- Flasher la carte contrôleur avec le .bin sur une SDcard.

 

 

ok c'est noté merci

Il y a 5 heures, Savate a dit :

un lsusb ça te donne quoi comme infos ?

 

Lors du make menuconfig, coche la case 'extra low level options' pour avoir plus de détails

Ca donne du chinois pour moi 😂 vous comprendrez mieux que moi.
sinon plus d'option es bien utile actuellement ?

Citation

Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 002: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

Lien vers le commentaire
Partager sur d’autres sites

il y a 20 minutes, RicoDarksky a dit :

Ca donne du chinois pour moi 😂 vous comprendrez mieux que moi.

pas plus d'options, plus de "détails" ce qui n'est pas pareil 🙂 

tu le fais tourner sur quoi ton kipper ?

oups j'avais pas tout lu BTT PI -> il y en des saletés usb sur ce truc 🙂 

donc ta carte est bien reconnue Bus 007 Device 002: ID 1a86:7523 QinHeng Electronics CH340 serial converter

le seul truc, maintenant c'est qu'elle ne soit pas flashée correctement ... donc make menuconfig / make à refaire.

 

Modifié (le) par Savate
  • +1 2
Lien vers le commentaire
Partager sur d’autres sites

Oui je voulais dire + de détails 

Donc ce matin j'ai refait

  • menuconfigue
  • make
  • mv out/klipper.bin ../printer_data/config/
  • ls -l /dev/serial/by-path/
  • lsblk
  • lsusb 

Je vous remet les fichier printer.cfg (config/generic-creality-v4.2.7.cfg) et klippy.log

Comme vous pouvez le voir ci-joint 

➡️ printer.cfg

Citation

# This file contains pin mappings for the Creality "v4.2.7" board. To
# use this config, during "make menuconfig" select the STM32F103 with
# a "28KiB bootloader" and serial (on USART1 PA10/PA9) communication.

# If you prefer a direct serial connection, in "make menuconfig"
# select "Enable extra low-level configuration options" and select
# serial (on USART3 PB11/PB10), which is broken out on the 10 pin IDC
# cable used for the LCD module as follows:
# 3: Tx, 4: Rx, 9: GND, 10: VCC

# Flash this firmware by copying "out/klipper.bin" to a SD card and
# turning on the printer with the card inserted. The firmware
# filename must end in ".bin" and must not match the last filename
# that was flashed.

# See docs/Config_Reference.md for a description of parameters.

[include mainsail.cfg]

[stepper_x]
step_pin: PB9
dir_pin: PC2
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA5
position_endstop: 0
position_max: 235
homing_speed: 50

[stepper_y]
step_pin: PB7
dir_pin: PB8
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA6
position_endstop: 0
position_max: 235
homing_speed: 50

[stepper_z]
step_pin: PB5
dir_pin: !PB6
enable_pin: !PC3
microsteps: 16
rotation_distance: 8
endstop_pin: ^PA7
position_endstop: 0.0
position_max: 250

[extruder]
max_extrude_only_distance: 100.0
step_pin: PB3
dir_pin: PB4
enable_pin: !PC3
microsteps: 16
rotation_distance: 33.500
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA1
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC5
control: pid
pid_Kp: 21.527
pid_Ki: 1.063
pid_Kd: 108.982
min_temp: 0
max_temp: 250

[heater_bed]
heater_pin: PA2
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC4
control: pid
pid_Kp: 54.027
pid_Ki: 0.770
pid_Kd: 948.182
min_temp: 0
max_temp: 130

[fan]
pin: PA0

[mcu]
serial: /dev/serial/by-path/platform-5310400.usb-usb-0:1:1.0-port0
restart_method: command

[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100

[board_pins]
aliases:
  EXP1_1=PC6,EXP1_3=PB10,EXP1_5=PB14,EXP1_7=PB12,EXP1_9=<GND>,
  EXP1_2=PB2,EXP1_4=PB11,EXP1_6=PB13,EXP1_8=PB15,EXP1_10=<5V>,
  PROBE_IN=PB0,PROBE_OUT=PB1,FIL_RUNOUT=PC6

➡️ klippy.log

Citation

===== Config file =====
[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2

[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
=======================
Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock']
Git version: 'v0.11.0-276-ge9bf2d4c'
Branch: master
Remote: origin
Tracked URL: https://github.com/Klipper3d/klipper
CPU: 4 core ?
Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]'
webhooks client 281472906181936: {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
=============== Log rollover at Thu Sep 28 05:02:53 2023 ===============
mcu 'mcu': Unable to open serial port: [Errno 20] could not open port /dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 20] Not a directory: '/dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 20] could not open port /dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 20] Not a directory: '/dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 20] could not open port /dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 20] Not a directory: '/dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 20] could not open port /dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 20] Not a directory: '/dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 20] could not open port /dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 20] Not a directory: '/dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 20] could not open port /dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 20] Not a directory: '/dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 20] could not open port /dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 20] Not a directory: '/dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 20] could not open port /dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 20] Not a directory: '/dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 20] could not open port /dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 20] Not a directory: '/dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 20] could not open port /dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 20] Not a directory: '/dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 20] could not open port /dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 20] Not a directory: '/dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0'
mcu 'mcu': Unable to open serial port: [Errno 20] could not open port /dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0: [Errno 20] Not a directory: '/dev/ttyUSB0/platform-5101400.usb-usb-0:1:1.0-port0'
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(2747): Tue Sep 26 08:57:31 2023
========= Last MCU build config =========
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Tue Sep 26 08:59:12 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Tue Sep 26 08:59:29 2023
Starting Klippy...
Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock']
Git version: 'v0.11.0-276-ge9bf2d4c'
Branch: master
Remote: origin
Tracked URL: https://github.com/Klipper3d/klipper
CPU: 4 core ?
Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]'
Start printer at Thu Sep 28 06:15:49 2023 (1695881749.1 30.0)
Unable to open config file /home/biqu/printer_data/config/printer.cfg
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/configfile.py", line 158, in _read_config_file
    f = open(filename, 'r')
FileNotFoundError: [Errno 2] No such file or directory: '/home/biqu/printer_data/config/printer.cfg'
Config error
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/configfile.py", line 158, in _read_config_file
    f = open(filename, 'r')
FileNotFoundError: [Errno 2] No such file or directory: '/home/biqu/printer_data/config/printer.cfg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 175, in _connect
    self._read_config()
  File "/home/biqu/klipper/klippy/klippy.py", line 134, in _read_config
    config = pconfig.read_main_config()
  File "/home/biqu/klipper/klippy/configfile.py", line 279, in read_main_config
    data = self._read_config_file(filename)
  File "/home/biqu/klipper/klippy/configfile.py", line 164, in _read_config_file
    raise error(msg)
configparser.Error: Unable to open config file /home/biqu/printer_data/config/printer.cfg
webhooks client 281473556383680: New connection
webhooks client 281473556383680: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
webhooks client 281473556383680: Disconnected
Restarting printer
Start printer at Thu Sep 28 06:25:03 2023 (1695882303.7 570.3)
===== Config file =====
[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}

[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473548584464: New connection
webhooks client 281473548584464: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281473548584464: Disconnected
Restarting printer
Start printer at Thu Sep 28 06:25:27 2023 (1695882327.7 594.2)
===== Config file =====
[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}

[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473548839520: New connection
webhooks client 281473548839520: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(3443): Thu Sep 28 05:42:52 2023
========= Last MCU build config =========
CONFIG_LOW_LEVEL_OPTIONS=y
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
# CONFIG_MACH_STM32F103x6 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
# CONFIG_STM32F103GD_DISABLE_SWD is not set
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_STM32_CLOCK_REF_8M=y
# CONFIG_STM32_CLOCK_REF_12M is not set
# CONFIG_STM32_CLOCK_REF_16M is not set
# CONFIG_STM32_CLOCK_REF_20M is not set
# CONFIG_STM32_CLOCK_REF_24M is not set
# CONFIG_STM32_CLOCK_REF_25M is not set
# CONFIG_STM32_CLOCK_REF_INTERNAL is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set
# CONFIG_STM32_SERIAL_USART2 is not set
# CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set
# CONFIG_STM32_SERIAL_USART3 is not set
# CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_INITIAL_PINS=""
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Thu Sep 28 05:44:18 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Thu Sep 28 05:44:34 2023
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281473548839520: Disconnected
Restarting printer
Start printer at Thu Sep 28 06:33:54 2023 (1695882834.4 1101.0)
===== Config file =====
[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}

[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-path/platform-5310400.usb-usb-0:1:1.0-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473548819712: New connection
webhooks client 281473548819712: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Starting Klippy...
Args: ['/home/biqu/klipper/klippy/klippy.py', '/home/biqu/printer_data/config/printer.cfg', '-I', '/home/biqu/printer_data/comms/klippy.serial', '-l', '/home/biqu/printer_data/logs/klippy.log', '-a', '/home/biqu/printer_data/comms/klippy.sock']
Git version: 'v0.11.0-277-g21b78429'
Branch: master
Remote: origin
Tracked URL: https://github.com/Klipper3d/klipper
CPU: 4 core ?
Python: '3.9.2 (default, Feb 28 2021, 17:03:44) \n[GCC 10.2.1 20210110]'
Start printer at Thu Sep 28 06:34:08 2023 (1695882849.0 1115.6)
===== Config file =====
[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}

[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-path/platform-5310400.usb-usb-0:1:1.0-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473467221520: New connection
webhooks client 281473467221520: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(3443): Thu Sep 28 05:42:52 2023
========= Last MCU build config =========
CONFIG_LOW_LEVEL_OPTIONS=y
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
# CONFIG_MACH_STM32F103x6 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
# CONFIG_STM32F103GD_DISABLE_SWD is not set
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_STM32_CLOCK_REF_8M=y
# CONFIG_STM32_CLOCK_REF_12M is not set
# CONFIG_STM32_CLOCK_REF_16M is not set
# CONFIG_STM32_CLOCK_REF_20M is not set
# CONFIG_STM32_CLOCK_REF_24M is not set
# CONFIG_STM32_CLOCK_REF_25M is not set
# CONFIG_STM32_CLOCK_REF_INTERNAL is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set
# CONFIG_STM32_SERIAL_USART2 is not set
# CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set
# CONFIG_STM32_SERIAL_USART3 is not set
# CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_INITIAL_PINS=""
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Thu Sep 28 05:44:18 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Thu Sep 28 05:44:34 2023
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281473467221520: Disconnected
Restarting printer
Start printer at Thu Sep 28 06:52:25 2023 (1695883945.6 2212.1)
===== Config file =====
[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}

[stepper_x]
step_pin = PC2
dir_pin = PB9
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB8
dir_pin = PB7
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB6
dir_pin = !PB5
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB4
dir_pin = PB3
enable_pin = !PC3
microsteps = 16
rotation_distance = 34.406
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-path/platform-5310400.usb-usb-0:1:1.0-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[display]
lcd_type = st7920
cs_pin = PB12
sclk_pin = PB13
sid_pin = PB15
encoder_pins = ^PB14, ^PB10
click_pin = ^!PB2
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473467844688: New connection
webhooks client 281473467844688: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(3443): Thu Sep 28 05:42:52 2023
========= Last MCU build config =========
CONFIG_LOW_LEVEL_OPTIONS=y
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
# CONFIG_MACH_STM32F103x6 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
# CONFIG_STM32F103GD_DISABLE_SWD is not set
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_STM32_CLOCK_REF_8M=y
# CONFIG_STM32_CLOCK_REF_12M is not set
# CONFIG_STM32_CLOCK_REF_16M is not set
# CONFIG_STM32_CLOCK_REF_20M is not set
# CONFIG_STM32_CLOCK_REF_24M is not set
# CONFIG_STM32_CLOCK_REF_25M is not set
# CONFIG_STM32_CLOCK_REF_INTERNAL is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set
# CONFIG_STM32_SERIAL_USART2 is not set
# CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set
# CONFIG_STM32_SERIAL_USART3 is not set
# CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_INITIAL_PINS=""
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Thu Sep 28 05:44:18 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Thu Sep 28 05:44:34 2023
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281473467844688: Disconnected
Restarting printer
Start printer at Thu Sep 28 06:58:32 2023 (1695884312.9 2579.5)
===== Config file =====
[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}

[stepper_x]
step_pin = PB9
dir_pin = PC2
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB7
dir_pin = PB8
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB5
dir_pin = !PB6
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB3
dir_pin = PB4
enable_pin = !PC3
microsteps = 16
rotation_distance = 33.500
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-path/platform-5310400.usb-usb-0:1:1.0-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[board_pins]
aliases = 
    EXP1_1=PC6,EXP1_3=PB10,EXP1_5=PB14,EXP1_7=PB12,EXP1_9=<GND>,
    EXP1_2=PB2,EXP1_4=PB11,EXP1_6=PB13,EXP1_8=PB15,EXP1_10=<5V>,
    PROBE_IN=PB0,PROBE_OUT=PB1,FIL_RUNOUT=PC6
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473467627216: New connection
webhooks client 281473467627216: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(3443): Thu Sep 28 05:42:52 2023
========= Last MCU build config =========
CONFIG_LOW_LEVEL_OPTIONS=y
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
# CONFIG_MACH_STM32F103x6 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
# CONFIG_STM32F103GD_DISABLE_SWD is not set
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_STM32_CLOCK_REF_8M=y
# CONFIG_STM32_CLOCK_REF_12M is not set
# CONFIG_STM32_CLOCK_REF_16M is not set
# CONFIG_STM32_CLOCK_REF_20M is not set
# CONFIG_STM32_CLOCK_REF_24M is not set
# CONFIG_STM32_CLOCK_REF_25M is not set
# CONFIG_STM32_CLOCK_REF_INTERNAL is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set
# CONFIG_STM32_SERIAL_USART2 is not set
# CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set
# CONFIG_STM32_SERIAL_USART3 is not set
# CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_INITIAL_PINS=""
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Thu Sep 28 05:44:18 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Thu Sep 28 05:44:34 2023
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
Unable to issue reset command on MCU 'mcu'
webhooks client 281473467627216: Disconnected
Restarting printer
Start printer at Thu Sep 28 07:04:19 2023 (1695884659.5 2926.1)
===== Config file =====
[virtual_sdcard]
path = ~/printer_data/gcodes
on_error_gcode = CANCEL_PRINT

[pause_resume]

[display_status]

[respond]

[gcode_macro CANCEL_PRINT]
description = Cancel the actual running print
rename_existing = CANCEL_PRINT_BASE
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
    {% set retract = client.cancel_retract|default(5.0)|abs %}
    
    {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
    else "X=" ~ client.park_at_cancel_x %}
    {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
    else "Y=" ~ client.park_at_cancel_y %}
    {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% 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
variable_restore_idle_timeout = 0
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set idle_timeout = client.idle_timeout|default(0) %}
    {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
    {% set restore = False if printer.toolhead.extruder == ''
    else True  if params.RESTORE|default(1)|int == 1 else False %}
    
    SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
    
    {% if idle_timeout > 0 %}
    SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
    SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
    {% endif %}
    PAUSE_BASE
    _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}

[gcode_macro RESUME]
description = Resume the actual running print
rename_existing = RESUME_BASE
variable_last_extruder_temp = {'restore': False, 'temp': 0}
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set sp_move = client.speed_move|default(velocity) %}
    
    
    {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
    SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
    {% endif %}
    {% if printer.idle_timeout.state|upper == "IDLE" %}
    {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
    {% endif %}
    _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 %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
    {pause_next_layer.call}
    SET_PAUSE_NEXT_LAYER ENABLE=0
    {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
    RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
    {pause_at_layer.call}
    SET_PAUSE_AT_LAYER ENABLE=0
    {% endif %}
    SET_PRINT_STATS_INFO_BASE {rawparams}

[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
    {% set use_custom     = client.use_custom_pos|default(false)|lower == 'true' %}
    {% set custom_park_x  = client.custom_park_x|default(0.0) %}
    {% set custom_park_y  = client.custom_park_y|default(0.0) %}
    {% set park_dz        = client.custom_park_dz|default(2.0)|abs %}
    {% set sp_hop         = client.speed_hop|default(15) * 60 %}
    {% set sp_move        = client.speed_move|default(velocity) * 60 %}
    
    {% set origin    = printer.gcode_move.homing_origin %}
    {% set act       = printer.gcode_move.gcode_position %}
    {% set max       = printer.toolhead.axis_maximum %}
    {% set cone      = printer.toolhead.cone_start_z|default(max.z) %}
    {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
    else False %}
    
    {% set z_min = params.Z_MIN|default(0)|float %}
    {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
    {% set x_park = params.X       if params.X is defined
    else custom_park_x  if use_custom
    else 0.0            if round_bed
    else (max.x - 5.0) %}
    {% set y_park = params.Y       if params.Y is defined
    else custom_park_y  if use_custom
    else (max.y - 5.0)  if round_bed and z_park < cone
    else 0.0            if round_bed
    else (max.y - 5.0) %}
    
    _CLIENT_RETRACT
    {% if "xyz" in printer.toolhead.homed_axes %}
    G90
    G1 Z{z_park} F{sp_hop}
    G1 X{x_park} Y{y_park} F{sp_move}
    {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Printer not homed'
    {% endif %}

[gcode_macro _CLIENT_EXTRUDE]
description = Extrudes, if the extruder is hot enough
gcode = 
    
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
    {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
    {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
    
    {% if printer.toolhead.extruder != '' %}
    {% if printer[printer.toolhead.extruder].can_extrude %}
    {% if use_fw_retract %}
    {% if length < 0 %}
    G10
    {% else %}
    G11
    {% endif %}
    {% else %}
    M83
    G1 E{length} F{(speed|float|abs) * 60}
    {% if absolute_extrude %}
    M82
    {% endif %}
    {% endif %}
    {% else %}
    RESPOND TYPE=echo MSG='Extruder not hot enough'
    {% endif %}
    {% endif %}

[gcode_macro _CLIENT_RETRACT]
description = Retracts, if the extruder is hot enough
gcode = 
    {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
    {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
    {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
    
    _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}

[stepper_x]
step_pin = PB9
dir_pin = PC2
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA5
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = PB7
dir_pin = PB8
enable_pin = !PC3
microsteps = 16
rotation_distance = 40
endstop_pin = ^PA6
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = PB5
dir_pin = !PB6
enable_pin = !PC3
microsteps = 16
rotation_distance = 8
endstop_pin = ^PA7
position_endstop = 0.0
position_max = 250

[extruder]
max_extrude_only_distance = 100.0
step_pin = PB3
dir_pin = PB4
enable_pin = !PC3
microsteps = 16
rotation_distance = 33.500
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = PA1
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC5
control = pid
pid_kp = 21.527
pid_ki = 1.063
pid_kd = 108.982
min_temp = 0
max_temp = 250

[heater_bed]
heater_pin = PA2
sensor_type = EPCOS 100K B57560G104F
sensor_pin = PC4
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = PA0

[mcu]
serial = /dev/serial/by-path/platform-5310400.usb-usb-0:1:1.0-port0
restart_method = command

[printer]
kinematics = cartesian
max_velocity = 300
max_accel = 3000
max_z_velocity = 5
max_z_accel = 100

[board_pins]
aliases = 
    EXP1_1=PC6,EXP1_3=PB10,EXP1_5=PB14,EXP1_7=PB12,EXP1_9=<GND>,
    EXP1_2=PB2,EXP1_4=PB11,EXP1_6=PB13,EXP1_8=PB15,EXP1_10=<5V>,
    PROBE_IN=PB0,PROBE_OUT=PB1,FIL_RUNOUT=PC6
=======================
Extruder max_extrude_ratio=0.266081
mcu 'mcu': Starting serial connect
webhooks client 281473475287024: New connection
webhooks client 281473475287024: Client info {'program': 'Moonraker', 'version': 'v0.8.0-142-gee62d07'}
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
mcu 'mcu': Timeout on connect
MCU error during connect
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/mcu.py", line 800, in _mcu_identify
    self._serial.connect_uart(self._serialport, self._baud, rts)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 182, in connect_uart
    self._error("Unable to connect")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Unable to connect

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/klippy.py", line 176, in _connect
    self.send_event("klippy:mcu_identify")
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in send_event
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/klippy.py", line 263, in <listcomp>
    return [cb(*params) for cb in self.event_handlers.get(event, [])]
  File "/home/biqu/klipper/klippy/mcu.py", line 805, in _mcu_identify
    raise error(str(e))
mcu.error: mcu 'mcu': Unable to connect
Build file /home/biqu/klipper/klippy/../.config(3443): Thu Sep 28 05:42:52 2023
========= Last MCU build config =========
CONFIG_LOW_LEVEL_OPTIONS=y
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_HC32F460 is not set
# CONFIG_MACH_RP2040 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32f103xe"
CONFIG_CLOCK_FREQ=72000000
CONFIG_SERIAL=y
CONFIG_FLASH_SIZE=0x10000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
# CONFIG_MACH_STM32G0B1 is not set
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
# CONFIG_MACH_STM32F103x6 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_CANBUS=y
# CONFIG_STM32F103GD_DISABLE_SWD is not set
CONFIG_STM32_DFU_ROM_ADDRESS=0
# CONFIG_STM32_FLASH_START_2000 is not set
# CONFIG_STM32_FLASH_START_5000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_8000 is not set
# CONFIG_STM32_FLASH_START_8800 is not set
# CONFIG_STM32_FLASH_START_10000 is not set
# CONFIG_STM32_FLASH_START_800 is not set
# CONFIG_STM32_FLASH_START_1000 is not set
# CONFIG_STM32_FLASH_START_4000 is not set
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_STM32_CLOCK_REF_8M=y
# CONFIG_STM32_CLOCK_REF_12M is not set
# CONFIG_STM32_CLOCK_REF_16M is not set
# CONFIG_STM32_CLOCK_REF_20M is not set
# CONFIG_STM32_CLOCK_REF_24M is not set
# CONFIG_STM32_CLOCK_REF_25M is not set
# CONFIG_STM32_CLOCK_REF_INTERNAL is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
CONFIG_STM32_SERIAL_USART1=y
# CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set
# CONFIG_STM32_SERIAL_USART2 is not set
# CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set
# CONFIG_STM32_SERIAL_USART3 is not set
# CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set
CONFIG_SERIAL_BAUD=250000
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_SENSORS=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_INITIAL_PINS=""
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
CONFIG_HAVE_GPIO_HARD_PWM=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_STEPPER_BOTH_EDGE=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/biqu/klipper/klippy/../out/klipper.dict(7937): Thu Sep 28 05:44:18 2023
Last MCU build version: v0.11.0-276-ge9bf2d4c
Last MCU build tools: gcc: (15:8-2019-q3-1+b1) 8.3.1 20190703 (release) [gcc-8-branch revision 273027] binutils: (2.35.2-2+14+b2) 2.35.2
Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 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 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
Build file /home/biqu/klipper/klippy/../out/klipper.elf(1026196): Thu Sep 28 05:44:34 2023
mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/biqu/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/biqu/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/biqu/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/biqu/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/biqu/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed
 

😉

1.PNG

2.PNG

3.PNG

4.PNG

5.PNG

6.PNG

7.PNG

Capture.PNG

Capture2.PNG

Modifié (le) par RicoDarksky
Lien vers le commentaire
Partager sur d’autres sites

il y a une heure, RicoDarksky a dit :

Comme vous pouvez le voir ci-joint 

tu peux joindre le fichier klipper.log (accessible à partir de l'écran d'erreur) il permettra de voir ce qui se passe et - peut-etre - ce qui ne va pas 🙂

 

Lien vers le commentaire
Partager sur d’autres sites

 

il y a 46 minutes, Funboard29 a dit :

Pourquoi flasher en USART alors que tu es connecté en USB ?

oui pourquoi je me pose la question mais jai juste suivi le tuto de tom's mais vu que c'est pour une ender 3 pro la reponse est la, suite a mon cas c'est pas bon je pense vu comme tu dit je suis en USB voila peut etre pourquoi ;)

il y a 17 minutes, Savate a dit :

tu peux joindre le fichier klipper.log (accessible à partir de l'écran d'erreur) il permettra de voir ce qui se passe et - peut-etre - ce qui ne va pas 🙂

 

je m'en occupe des que possible ;)

Lien vers le commentaire
Partager sur d’autres sites

Salut,

il y a 59 minutes, Funboard29 a dit :

Pourquoi flasher en USART alors que tu es connecté en USB ?

parce que les pattes utilisées pour la communication USB sont PA9 et PA10 sur une carte V4.2.7.😉 Creality.4.2.7.-.Schematic.22-9-21.pdf

Par contre, je pense que tu as allègrement zappé l'étape de flashage du firmware klipper.bin en copiant le fichier sur une carte µSD que tu glisseras dans le lecteur de la carte-mère. A la mise sous tension, le firmware se flashera automatiquement 😉. Tu peux utiliser des logiciels comme filezilla,WinSCP, MobaXterm,... pour récupérer le fichier ~/klipper/out/klipper.bin sur un ordinateur afin de faire la copie.

Perso, je ne comprends pas à quoi sert cette commande:

Il y a 1 heure, RicoDarksky a dit :

mv out/klipper.bin ../printer_data/config/

à part jouer à cache-cache 🤪

RAPPEL: tu ne peux pas flasher 2 fois successivement le même nom de fichier du firmware. Il faut qu'il soit différent.

Modifié (le) par pommeverte
  • +1 1
Lien vers le commentaire
Partager sur d’autres sites

Créer un compte ou se connecter pour commenter

Vous devez être membre afin de pouvoir déposer un commentaire

Créer un compte

Créez un compte sur notre communauté. C’est facile !

Créer un nouveau compte

Se connecter

Vous avez déjà un compte ? Connectez-vous ici.

Connectez-vous maintenant
  • Sur cette page :   0 membre est en ligne

    • Aucun utilisateur enregistré regarde cette page.
  • YouTube / Les Imprimantes 3D .fr

×
×
  • Créer...