Guest User

Untitled

a guest
Sep 11th, 2023
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 134.18 KB | None | 0 0
  1. ===== Config file =====
  2. [virtual_sdcard]
  3. path = ~/printer_data/gcodes
  4. on_error_gcode = CANCEL_PRINT
  5.  
  6. [pause_resume]
  7.  
  8. [display_status]
  9.  
  10. [respond]
  11.  
  12. [gcode_macro CANCEL_PRINT]
  13. description = Cancel the actual running print
  14. rename_existing = CANCEL_PRINT_BASE
  15. gcode =
  16.  
  17. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  18. {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
  19. {% set retract = client.cancel_retract|default(5.0)|abs %}
  20.  
  21. {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
  22. else "X=" ~ client.park_at_cancel_x %}
  23. {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
  24. else "Y=" ~ client.park_at_cancel_y %}
  25. {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
  26.  
  27.  
  28. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  29. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  30. {% endif %}
  31. {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %}
  32. _CLIENT_RETRACT LENGTH={retract}
  33. TURN_OFF_HEATERS
  34. M106 S0
  35.  
  36. SET_PAUSE_NEXT_LAYER ENABLE=0
  37. SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0
  38. CANCEL_PRINT_BASE
  39.  
  40. [gcode_macro PAUSE]
  41. description = Pause the actual running print
  42. rename_existing = PAUSE_BASE
  43. variable_restore_idle_timeout = 0
  44. gcode =
  45.  
  46. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  47. {% set idle_timeout = client.idle_timeout|default(0) %}
  48. {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
  49. {% set restore = False if printer.toolhead.extruder == ''
  50. else True if params.RESTORE|default(1)|int == 1 else False %}
  51.  
  52. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
  53.  
  54. {% if idle_timeout > 0 %}
  55. SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
  56. SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
  57. {% endif %}
  58. PAUSE_BASE
  59. _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}
  60.  
  61. [gcode_macro RESUME]
  62. description = Resume the actual running print
  63. rename_existing = RESUME_BASE
  64. variable_last_extruder_temp = {'restore': False, 'temp': 0}
  65. gcode =
  66.  
  67. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  68. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  69. {% set sp_move = client.speed_move|default(velocity) %}
  70.  
  71.  
  72. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  73. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  74. {% endif %}
  75. {% if printer.idle_timeout.state|upper == "IDLE" %}
  76. {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
  77. {% endif %}
  78. _CLIENT_EXTRUDE
  79. RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)}
  80.  
  81. [gcode_macro SET_PAUSE_NEXT_LAYER]
  82. description = Enable a pause if the next layer is reached
  83. gcode =
  84. {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %}
  85. {% set ENABLE = params.ENABLE|default(1)|int != 0 %}
  86. {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %}
  87. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}"
  88.  
  89. [gcode_macro SET_PAUSE_AT_LAYER]
  90. description = Enable/disable a pause if a given layer number is reached
  91. gcode =
  92. {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %}
  93. {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined
  94. else params.LAYER is defined %}
  95. {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %}
  96. {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %}
  97. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}"
  98.  
  99. [gcode_macro SET_PRINT_STATS_INFO]
  100. rename_existing = SET_PRINT_STATS_INFO_BASE
  101. description = Overwrite, to get pause_next_layer and pause_at_layer feature
  102. variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" }
  103. variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" }
  104. gcode =
  105. {% if pause_next_layer.enable %}
  106. RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
  107. {pause_next_layer.call}
  108. SET_PAUSE_NEXT_LAYER ENABLE=0
  109. {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
  110. RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
  111. {pause_at_layer.call}
  112. SET_PAUSE_AT_LAYER ENABLE=0
  113. {% endif %}
  114. SET_PRINT_STATS_INFO_BASE {rawparams}
  115.  
  116. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  117. description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
  118. gcode =
  119.  
  120. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  121. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  122. {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %}
  123. {% set custom_park_x = client.custom_park_x|default(0.0) %}
  124. {% set custom_park_y = client.custom_park_y|default(0.0) %}
  125. {% set park_dz = client.custom_park_dz|default(2.0)|abs %}
  126. {% set sp_hop = client.speed_hop|default(15) * 60 %}
  127. {% set sp_move = client.speed_move|default(velocity) * 60 %}
  128.  
  129. {% set origin = printer.gcode_move.homing_origin %}
  130. {% set act = printer.gcode_move.gcode_position %}
  131. {% set max = printer.toolhead.axis_maximum %}
  132. {% set cone = printer.toolhead.cone_start_z|default(max.z) %}
  133. {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
  134. else False %}
  135.  
  136. {% set z_min = params.Z_MIN|default(0)|float %}
  137. {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
  138. {% set x_park = params.X if params.X is defined
  139. else custom_park_x if use_custom
  140. else 0.0 if round_bed
  141. else (max.x - 5.0) %}
  142. {% set y_park = params.Y if params.Y is defined
  143. else custom_park_y if use_custom
  144. else (max.y - 5.0) if round_bed and z_park < cone
  145. else 0.0 if round_bed
  146. else (max.y - 5.0) %}
  147.  
  148. _CLIENT_RETRACT
  149. {% if "xyz" in printer.toolhead.homed_axes %}
  150. G90
  151. G1 Z{z_park} F{sp_hop}
  152. G1 X{x_park} Y{y_park} F{sp_move}
  153. {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
  154. {% else %}
  155. RESPOND TYPE=echo MSG='Printer not homed'
  156. {% endif %}
  157.  
  158. [gcode_macro _CLIENT_EXTRUDE]
  159. description = Extrudes, if the extruder is hot enough
  160. gcode =
  161.  
  162. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  163. {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
  164. {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
  165. {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
  166. {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
  167.  
  168. {% if printer.toolhead.extruder != '' %}
  169. {% if printer[printer.toolhead.extruder].can_extrude %}
  170. {% if use_fw_retract %}
  171. {% if length < 0 %}
  172. G10
  173. {% else %}
  174. G11
  175. {% endif %}
  176. {% else %}
  177. M83
  178. G1 E{length} F{(speed|float|abs) * 60}
  179. {% if absolute_extrude %}
  180. M82
  181. {% endif %}
  182. {% endif %}
  183. {% else %}
  184. RESPOND TYPE=echo MSG='Extruder not hot enough'
  185. {% endif %}
  186. {% endif %}
  187.  
  188. [gcode_macro _CLIENT_RETRACT]
  189. description = Retracts, if the extruder is hot enough
  190. gcode =
  191. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  192. {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
  193. {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
  194.  
  195. _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
  196.  
  197. [stepper_x]
  198. step_pin = P2.2
  199. dir_pin = P2.6
  200. enable_pin = !P2.1
  201. microsteps = 16
  202. rotation_distance = 40
  203. endstop_pin = !P1.29
  204. position_endstop = 0
  205. position_max = 235
  206. homing_speed = 50
  207.  
  208. [stepper_y]
  209. step_pin = P0.19
  210. dir_pin = P0.20
  211. enable_pin = !P2.8
  212. microsteps = 16
  213. rotation_distance = 40
  214. endstop_pin = !P1.28
  215. position_endstop = 0
  216. position_max = 235
  217. homing_speed = 50
  218.  
  219. [stepper_z]
  220. step_pin = P0.22
  221. dir_pin = !P2.11
  222. enable_pin = !P0.21
  223. microsteps = 16
  224. rotation_distance = 8
  225. endstop_pin = !P1.27
  226. position_endstop = 0.0
  227. position_max = 300
  228.  
  229. [extruder]
  230. step_pin = P2.13
  231. dir_pin = !P0.11
  232. enable_pin = !P2.12
  233. microsteps = 16
  234. rotation_distance = 33.500
  235. nozzle_diameter = 0.400
  236. filament_diameter = 1.750
  237. heater_pin = P2.7
  238. sensor_type = EPCOS 100K B57560G104F
  239. sensor_pin = P0.24
  240. control = pid
  241. pid_kp = 22.2
  242. pid_ki = 1.08
  243. pid_kd = 114
  244. min_temp = 0
  245. max_temp = 260
  246.  
  247. [heater_bed]
  248. heater_pin = P2.5
  249. sensor_type = EPCOS 100K B57560G104F
  250. sensor_pin = P0.25
  251. control = pid
  252. pid_kp = 54.027
  253. pid_ki = 0.770
  254. pid_kd = 948.182
  255. min_temp = 0
  256. max_temp = 130
  257.  
  258. [fan]
  259. pin = P2.3
  260.  
  261. [mcu]
  262. serial = /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00
  263.  
  264. [printer]
  265. kinematics = cartesian
  266. max_velocity = 400
  267. max_accel = 500
  268. max_z_velocity = 10
  269. max_z_accel = 100
  270.  
  271. [board_pins]
  272. aliases =
  273.  
  274. EXP1_1=P1.30, EXP1_3=P1.18, EXP1_5=P1.20, EXP1_7=P1.22, EXP1_9=<GND>,
  275. EXP1_2=P0.28, EXP1_4=P1.19, EXP1_6=P1.21, EXP1_8=P1.23, EXP1_10=<5V>,
  276.  
  277. EXP2_1=P0.17, EXP2_3=P3.26, EXP2_5=P3.25, EXP2_7=P1.31, EXP2_9=<GND>,
  278. EXP2_2=P0.15, EXP2_4=P0.16, EXP2_6=P0.18, EXP2_8=<RST>, EXP2_10=<NC>
  279. =======================
  280. Args: ['/home/pi/klipper/klippy/klippy.py', '/home/pi/printer_data/config/printer.cfg', '-l', '/home/pi/printer_data/logs/klippy.log', '-I', '/home/pi/printer_data/comms/klippy.serial', '-a', '/home/pi/printer_data/comms/klippy.sock']
  281. Git version: 'v0.11.0-271-g5f990f93'
  282. Branch: master
  283. Remote: origin
  284. Tracked URL: https://github.com/Klipper3d/klipper.git
  285. CPU: 4 core ARMv7 Processor rev 4 (v7l)
  286. Python: '3.9.2 (default, Mar 12 2021, 04:06:34) \n[GCC 10.2.1 20210110]'
  287. webhooks client 1965668888: {'program': 'Moonraker', 'version': 'v0.8.0-138-gfe12095'}
  288. =============== Log rollover at Mon Sep 11 11:13:33 2023 ===============
  289. mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00'
  290. mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00'
  291. mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00'
  292. mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00'
  293. mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00'
  294. mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00'
  295. mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00'
  296. mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00'
  297. mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00'
  298. mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00'
  299. mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00'
  300. mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00'
  301. mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00'
  302. mcu 'mcu': Unable to open serial port: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00'
  303. MCU error during connect
  304. Traceback (most recent call last):
  305. File "/home/pi/klipper/klippy/mcu.py", line 798, in _mcu_identify
  306. self._serial.connect_uart(self._serialport, self._baud, rts)
  307. File "/home/pi/klipper/klippy/serialhdl.py", line 182, in connect_uart
  308. self._error("Unable to connect")
  309. File "/home/pi/klipper/klippy/serialhdl.py", line 61, in _error
  310. raise error(self.warn_prefix + (msg % params))
  311. serialhdl.error: mcu 'mcu': Unable to connect
  312.  
  313. During handling of the above exception, another exception occurred:
  314.  
  315. Traceback (most recent call last):
  316. File "/home/pi/klipper/klippy/klippy.py", line 176, in _connect
  317. self.send_event("klippy:mcu_identify")
  318. File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event
  319. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  320. File "/home/pi/klipper/klippy/klippy.py", line 263, in <listcomp>
  321. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  322. File "/home/pi/klipper/klippy/mcu.py", line 803, in _mcu_identify
  323. raise error(str(e))
  324. mcu.error: mcu 'mcu': Unable to connect
  325. No build file /home/pi/klipper/klippy/../.config
  326. No build file /home/pi/klipper/klippy/../out/klipper.dict
  327. No build file /home/pi/klipper/klippy/../out/klipper.elf
  328. Attempting MCU 'mcu' reset
  329. Unhandled exception during post run
  330. Traceback (most recent call last):
  331. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 265, in open
  332. self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
  333. FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00'
  334.  
  335. During handling of the above exception, another exception occurred:
  336.  
  337. Traceback (most recent call last):
  338. File "/home/pi/klipper/klippy/klippy.py", line 234, in run
  339. self.send_event("klippy:firmware_restart")
  340. File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event
  341. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  342. File "/home/pi/klipper/klippy/klippy.py", line 263, in <listcomp>
  343. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  344. File "/home/pi/klipper/klippy/mcu.py", line 949, in _firmware_restart
  345. self._restart_arduino()
  346. File "/home/pi/klipper/klippy/mcu.py", line 909, in _restart_arduino
  347. serialhdl.arduino_reset(self._serialport, self._reactor)
  348. File "/home/pi/klipper/klippy/serialhdl.py", line 379, in arduino_reset
  349. ser = serial.Serial(serialport, 2400, timeout=0, exclusive=True)
  350. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialutil.py", line 240, in __init__
  351. self.open()
  352. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 268, in open
  353. raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
  354. serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00'
  355. Restarting printer
  356. Start printer at Mon Sep 11 13:10:51 2023 (1694463051.0 7079.2)
  357. ===== Config file =====
  358. [probe]
  359. pin = 1.27
  360. x_offset = 48
  361. y_offset = -2
  362. speed = 5
  363. samples = 2
  364. lift_speed = 8
  365.  
  366. [safe_z_home]
  367. home_xy_position = 102, 152
  368. z_hop = 5
  369. z_hop_speed = 10.0
  370.  
  371. [bed_mesh]
  372. mesh_min = 48, 20
  373. mesh_max = 280, 280
  374. probe_count = 5, 5
  375.  
  376. [virtual_sdcard]
  377. path = ~/printer_data/gcodes
  378. on_error_gcode = CANCEL_PRINT
  379.  
  380. [pause_resume]
  381.  
  382. [display_status]
  383.  
  384. [respond]
  385.  
  386. [gcode_macro CANCEL_PRINT]
  387. description = Cancel the actual running print
  388. rename_existing = CANCEL_PRINT_BASE
  389. gcode =
  390.  
  391. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  392. {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
  393. {% set retract = client.cancel_retract|default(5.0)|abs %}
  394.  
  395. {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
  396. else "X=" ~ client.park_at_cancel_x %}
  397. {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
  398. else "Y=" ~ client.park_at_cancel_y %}
  399. {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
  400.  
  401.  
  402. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  403. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  404. {% endif %}
  405. {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %}
  406. _CLIENT_RETRACT LENGTH={retract}
  407. TURN_OFF_HEATERS
  408. M106 S0
  409.  
  410. SET_PAUSE_NEXT_LAYER ENABLE=0
  411. SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0
  412. CANCEL_PRINT_BASE
  413.  
  414. [gcode_macro PAUSE]
  415. description = Pause the actual running print
  416. rename_existing = PAUSE_BASE
  417. variable_restore_idle_timeout = 0
  418. gcode =
  419.  
  420. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  421. {% set idle_timeout = client.idle_timeout|default(0) %}
  422. {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
  423. {% set restore = False if printer.toolhead.extruder == ''
  424. else True if params.RESTORE|default(1)|int == 1 else False %}
  425.  
  426. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
  427.  
  428. {% if idle_timeout > 0 %}
  429. SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
  430. SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
  431. {% endif %}
  432. PAUSE_BASE
  433. _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}
  434.  
  435. [gcode_macro RESUME]
  436. description = Resume the actual running print
  437. rename_existing = RESUME_BASE
  438. variable_last_extruder_temp = {'restore': False, 'temp': 0}
  439. gcode =
  440.  
  441. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  442. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  443. {% set sp_move = client.speed_move|default(velocity) %}
  444.  
  445.  
  446. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  447. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  448. {% endif %}
  449. {% if printer.idle_timeout.state|upper == "IDLE" %}
  450. {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
  451. {% endif %}
  452. _CLIENT_EXTRUDE
  453. RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)}
  454.  
  455. [gcode_macro SET_PAUSE_NEXT_LAYER]
  456. description = Enable a pause if the next layer is reached
  457. gcode =
  458. {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %}
  459. {% set ENABLE = params.ENABLE|default(1)|int != 0 %}
  460. {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %}
  461. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}"
  462.  
  463. [gcode_macro SET_PAUSE_AT_LAYER]
  464. description = Enable/disable a pause if a given layer number is reached
  465. gcode =
  466. {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %}
  467. {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined
  468. else params.LAYER is defined %}
  469. {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %}
  470. {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %}
  471. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}"
  472.  
  473. [gcode_macro SET_PRINT_STATS_INFO]
  474. rename_existing = SET_PRINT_STATS_INFO_BASE
  475. description = Overwrite, to get pause_next_layer and pause_at_layer feature
  476. variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" }
  477. variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" }
  478. gcode =
  479. {% if pause_next_layer.enable %}
  480. RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
  481. {pause_next_layer.call}
  482. SET_PAUSE_NEXT_LAYER ENABLE=0
  483. {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
  484. RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
  485. {pause_at_layer.call}
  486. SET_PAUSE_AT_LAYER ENABLE=0
  487. {% endif %}
  488. SET_PRINT_STATS_INFO_BASE {rawparams}
  489.  
  490. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  491. description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
  492. gcode =
  493.  
  494. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  495. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  496. {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %}
  497. {% set custom_park_x = client.custom_park_x|default(0.0) %}
  498. {% set custom_park_y = client.custom_park_y|default(0.0) %}
  499. {% set park_dz = client.custom_park_dz|default(2.0)|abs %}
  500. {% set sp_hop = client.speed_hop|default(15) * 60 %}
  501. {% set sp_move = client.speed_move|default(velocity) * 60 %}
  502.  
  503. {% set origin = printer.gcode_move.homing_origin %}
  504. {% set act = printer.gcode_move.gcode_position %}
  505. {% set max = printer.toolhead.axis_maximum %}
  506. {% set cone = printer.toolhead.cone_start_z|default(max.z) %}
  507. {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
  508. else False %}
  509.  
  510. {% set z_min = params.Z_MIN|default(0)|float %}
  511. {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
  512. {% set x_park = params.X if params.X is defined
  513. else custom_park_x if use_custom
  514. else 0.0 if round_bed
  515. else (max.x - 5.0) %}
  516. {% set y_park = params.Y if params.Y is defined
  517. else custom_park_y if use_custom
  518. else (max.y - 5.0) if round_bed and z_park < cone
  519. else 0.0 if round_bed
  520. else (max.y - 5.0) %}
  521.  
  522. _CLIENT_RETRACT
  523. {% if "xyz" in printer.toolhead.homed_axes %}
  524. G90
  525. G1 Z{z_park} F{sp_hop}
  526. G1 X{x_park} Y{y_park} F{sp_move}
  527. {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
  528. {% else %}
  529. RESPOND TYPE=echo MSG='Printer not homed'
  530. {% endif %}
  531.  
  532. [gcode_macro _CLIENT_EXTRUDE]
  533. description = Extrudes, if the extruder is hot enough
  534. gcode =
  535.  
  536. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  537. {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
  538. {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
  539. {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
  540. {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
  541.  
  542. {% if printer.toolhead.extruder != '' %}
  543. {% if printer[printer.toolhead.extruder].can_extrude %}
  544. {% if use_fw_retract %}
  545. {% if length < 0 %}
  546. G10
  547. {% else %}
  548. G11
  549. {% endif %}
  550. {% else %}
  551. M83
  552. G1 E{length} F{(speed|float|abs) * 60}
  553. {% if absolute_extrude %}
  554. M82
  555. {% endif %}
  556. {% endif %}
  557. {% else %}
  558. RESPOND TYPE=echo MSG='Extruder not hot enough'
  559. {% endif %}
  560. {% endif %}
  561.  
  562. [gcode_macro _CLIENT_RETRACT]
  563. description = Retracts, if the extruder is hot enough
  564. gcode =
  565. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  566. {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
  567. {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
  568.  
  569. _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
  570.  
  571. [stepper_x]
  572. microsteps = 16
  573. step_pin = P2.2
  574. dir_pin = P2.6
  575. enable_pin = !P2.1
  576. rotation_distance = 40
  577. endstop_pin = tmc2209_stepper_x:virtual_endstop
  578. position_endstop = 0
  579. position_max = 300
  580. homing_speed = 20
  581. homing_retract_dist = 0
  582.  
  583. [tmc2209 stepper_x]
  584. uart_pin = P1.10
  585. interpolate = True
  586. run_current = 0.800
  587. stealthchop_threshold = 999999
  588. diag_pin = 1.29
  589. driver_sgthrs = 255
  590.  
  591. [stepper_y]
  592. microsteps = 16
  593. step_pin = P0.19
  594. dir_pin = P0.20
  595. enable_pin = !P2.8
  596. rotation_distance = 40
  597. endstop_pin = tmc2209_stepper_y:virtual_endstop
  598. position_endstop = 0
  599. position_max = 300
  600. homing_speed = 20
  601. homing_retract_dist = 0
  602.  
  603. [tmc2209 stepper_y]
  604. uart_pin = P1.9
  605. interpolate = True
  606. run_current = 0.800
  607. stealthchop_threshold = 999999
  608. diag_pin = 1.28
  609. driver_sgthrs = 255
  610.  
  611. [stepper_z]
  612. microsteps = 16
  613. step_pin = P0.22
  614. dir_pin = !P2.11
  615. enable_pin = !P0.21
  616. rotation_distance = 8
  617. endstop_pin = probe:z_virtual_endstop
  618. position_endstop = 0
  619. position_min = -3.5
  620. position_max = 400
  621.  
  622. [tmc2209 stepper_z]
  623. uart_pin = P1.8
  624. interpolate = True
  625. run_current = 0.750
  626. hold_current = 0.450
  627. stealthchop_threshold = 999999
  628.  
  629. [stepper_z1]
  630. microsteps = 16
  631. step_pin = P1.15
  632. dir_pin = !P1.14
  633. enable_pin = !P1.16
  634. rotation_distance = 8
  635.  
  636. [tmc2209 stepper_z1]
  637. uart_pin = P1.1
  638. interpolate = True
  639. run_current = 0.750
  640. hold_current = 0.450
  641. stealthchop_threshold = 999999
  642.  
  643. [extruder]
  644. microsteps = 16
  645. step_pin = P2.13
  646. dir_pin = P0.11
  647. enable_pin = !P2.12
  648. rotation_distance = 33.683
  649. nozzle_diameter = 0.400
  650. filament_diameter = 1.750
  651. heater_pin = P2.7
  652. sensor_type = EPCOS 100K B57560G104F
  653. sensor_pin = P0.24
  654. control = pid
  655. pid_kp = 22.2
  656. pid_ki = 1.72
  657. pid_kd = 73.96
  658. min_temp = 0
  659. max_temp = 260
  660. pressure_advance = 0.0
  661. pressure_advance_smooth_time = 0.040
  662.  
  663. [tmc2209 extruder]
  664. uart_pin = P1.4
  665. interpolate = True
  666. run_current = 0.600
  667. hold_current = 0.500
  668. stealthchop_threshold = 999999
  669.  
  670. [heater_bed]
  671. heater_pin = P2.5
  672. sensor_type = EPCOS 100K B57560G104F
  673. sensor_pin = P0.25
  674. control = pid
  675. pid_kp = 54.027
  676. pid_ki = 0.770
  677. pid_kd = 948.182
  678. min_temp = 0
  679. max_temp = 130
  680.  
  681. [fan]
  682. pin = P2.3
  683.  
  684. [mcu]
  685. serial = /dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00
  686. method = command
  687.  
  688. [printer]
  689. kinematics = cartesian
  690. max_velocity = 400
  691. max_accel = 3000
  692. max_z_velocity = 10
  693. max_z_accel = 100
  694.  
  695. [z_tilt]
  696. z_positions = -32, 179
  697. 332, 179
  698. points = 40, 179
  699. 295, 179
  700. speed = 50
  701. horizontal_move_z = 5
  702. retries = 10
  703. retry_tolerance = 0.01
  704.  
  705. [gcode_arcs]
  706. resolution = 1.0
  707.  
  708. [board_pins]
  709. aliases =
  710.  
  711. EXP1_1=P1.30, EXP1_3=P1.18, EXP1_5=P1.20, EXP1_7=P1.22, EXP1_9=<GND>,
  712. EXP1_2=P0.28, EXP1_4=P1.19, EXP1_6=P1.21, EXP1_8=P1.23, EXP1_10=<5V>,
  713.  
  714. EXP2_1=P0.17, EXP2_3=P3.26, EXP2_5=P3.25, EXP2_7=P1.31, EXP2_9=<GND>,
  715. EXP2_2=P0.15, EXP2_4=P0.16, EXP2_6=P0.18, EXP2_8=<RST>, EXP2_10=<NC>
  716.  
  717. [display]
  718. lcd_type = st7920
  719. cs_pin = EXP1_4
  720. sclk_pin = EXP1_5
  721. sid_pin = EXP1_3
  722. encoder_pins = ^EXP2_3, ^EXP2_5
  723. click_pin = ^!EXP1_2
  724.  
  725. [output_pin beeper]
  726. pin = EXP1_1
  727. =======================
  728. Config error
  729. Traceback (most recent call last):
  730. File "/home/pi/klipper/klippy/klippy.py", line 175, in _connect
  731. self._read_config()
  732. File "/home/pi/klipper/klippy/klippy.py", line 141, in _read_config
  733. self.load_object(config, section_config.get_name(), None)
  734. File "/home/pi/klipper/klippy/klippy.py", line 130, in load_object
  735. self.objects[section] = init_func(config.getsection(section))
  736. File "/home/pi/klipper/klippy/extras/probe.py", line 458, in load_config
  737. return PrinterProbe(config, ProbeEndstopWrapper(config))
  738. File "/home/pi/klipper/klippy/extras/probe.py", line 298, in __init__
  739. self.position_endstop = config.getfloat('z_offset')
  740. File "/home/pi/klipper/klippy/configfile.py", line 65, in getfloat
  741. return self._get_wrapper(self.fileconfig.getfloat, option, default,
  742. File "/home/pi/klipper/klippy/configfile.py", line 32, in _get_wrapper
  743. raise error("Option '%s' in section '%s' must be specified"
  744. configparser.Error: Option 'z_offset' in section 'probe' must be specified
  745. webhooks client 1970611656: New connection
  746. webhooks client 1970611656: Client info {'program': 'Moonraker', 'version': 'v0.8.0-138-gfe12095'}
  747. Attempting MCU 'mcu' reset
  748. Unhandled exception during post run
  749. Traceback (most recent call last):
  750. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 265, in open
  751. self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
  752. FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00'
  753.  
  754. During handling of the above exception, another exception occurred:
  755.  
  756. Traceback (most recent call last):
  757. File "/home/pi/klipper/klippy/klippy.py", line 234, in run
  758. self.send_event("klippy:firmware_restart")
  759. File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event
  760. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  761. File "/home/pi/klipper/klippy/klippy.py", line 263, in <listcomp>
  762. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  763. File "/home/pi/klipper/klippy/mcu.py", line 949, in _firmware_restart
  764. self._restart_arduino()
  765. File "/home/pi/klipper/klippy/mcu.py", line 909, in _restart_arduino
  766. serialhdl.arduino_reset(self._serialport, self._reactor)
  767. File "/home/pi/klipper/klippy/serialhdl.py", line 379, in arduino_reset
  768. ser = serial.Serial(serialport, 2400, timeout=0, exclusive=True)
  769. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialutil.py", line 240, in __init__
  770. self.open()
  771. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 268, in open
  772. raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
  773. serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00'
  774. Restarting printer
  775. Start printer at Mon Sep 11 13:11:46 2023 (1694463106.4 7134.5)
  776. ===== Config file =====
  777. [probe]
  778. pin = 1.27
  779. x_offset = 48
  780. y_offset = -2
  781. z_offset = 1
  782. speed = 5
  783. samples = 2
  784. lift_speed = 8
  785.  
  786. [safe_z_home]
  787. home_xy_position = 102, 152
  788. z_hop = 5
  789. z_hop_speed = 10.0
  790.  
  791. [bed_mesh]
  792. mesh_min = 48, 20
  793. mesh_max = 280, 280
  794. probe_count = 5, 5
  795.  
  796. [virtual_sdcard]
  797. path = ~/printer_data/gcodes
  798. on_error_gcode = CANCEL_PRINT
  799.  
  800. [pause_resume]
  801.  
  802. [display_status]
  803.  
  804. [respond]
  805.  
  806. [gcode_macro CANCEL_PRINT]
  807. description = Cancel the actual running print
  808. rename_existing = CANCEL_PRINT_BASE
  809. gcode =
  810.  
  811. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  812. {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
  813. {% set retract = client.cancel_retract|default(5.0)|abs %}
  814.  
  815. {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
  816. else "X=" ~ client.park_at_cancel_x %}
  817. {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
  818. else "Y=" ~ client.park_at_cancel_y %}
  819. {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
  820.  
  821.  
  822. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  823. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  824. {% endif %}
  825. {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %}
  826. _CLIENT_RETRACT LENGTH={retract}
  827. TURN_OFF_HEATERS
  828. M106 S0
  829.  
  830. SET_PAUSE_NEXT_LAYER ENABLE=0
  831. SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0
  832. CANCEL_PRINT_BASE
  833.  
  834. [gcode_macro PAUSE]
  835. description = Pause the actual running print
  836. rename_existing = PAUSE_BASE
  837. variable_restore_idle_timeout = 0
  838. gcode =
  839.  
  840. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  841. {% set idle_timeout = client.idle_timeout|default(0) %}
  842. {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
  843. {% set restore = False if printer.toolhead.extruder == ''
  844. else True if params.RESTORE|default(1)|int == 1 else False %}
  845.  
  846. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
  847.  
  848. {% if idle_timeout > 0 %}
  849. SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
  850. SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
  851. {% endif %}
  852. PAUSE_BASE
  853. _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}
  854.  
  855. [gcode_macro RESUME]
  856. description = Resume the actual running print
  857. rename_existing = RESUME_BASE
  858. variable_last_extruder_temp = {'restore': False, 'temp': 0}
  859. gcode =
  860.  
  861. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  862. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  863. {% set sp_move = client.speed_move|default(velocity) %}
  864.  
  865.  
  866. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  867. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  868. {% endif %}
  869. {% if printer.idle_timeout.state|upper == "IDLE" %}
  870. {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
  871. {% endif %}
  872. _CLIENT_EXTRUDE
  873. RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)}
  874.  
  875. [gcode_macro SET_PAUSE_NEXT_LAYER]
  876. description = Enable a pause if the next layer is reached
  877. gcode =
  878. {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %}
  879. {% set ENABLE = params.ENABLE|default(1)|int != 0 %}
  880. {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %}
  881. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}"
  882.  
  883. [gcode_macro SET_PAUSE_AT_LAYER]
  884. description = Enable/disable a pause if a given layer number is reached
  885. gcode =
  886. {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %}
  887. {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined
  888. else params.LAYER is defined %}
  889. {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %}
  890. {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %}
  891. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}"
  892.  
  893. [gcode_macro SET_PRINT_STATS_INFO]
  894. rename_existing = SET_PRINT_STATS_INFO_BASE
  895. description = Overwrite, to get pause_next_layer and pause_at_layer feature
  896. variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" }
  897. variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" }
  898. gcode =
  899. {% if pause_next_layer.enable %}
  900. RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
  901. {pause_next_layer.call}
  902. SET_PAUSE_NEXT_LAYER ENABLE=0
  903. {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
  904. RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
  905. {pause_at_layer.call}
  906. SET_PAUSE_AT_LAYER ENABLE=0
  907. {% endif %}
  908. SET_PRINT_STATS_INFO_BASE {rawparams}
  909.  
  910. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  911. description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
  912. gcode =
  913.  
  914. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  915. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  916. {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %}
  917. {% set custom_park_x = client.custom_park_x|default(0.0) %}
  918. {% set custom_park_y = client.custom_park_y|default(0.0) %}
  919. {% set park_dz = client.custom_park_dz|default(2.0)|abs %}
  920. {% set sp_hop = client.speed_hop|default(15) * 60 %}
  921. {% set sp_move = client.speed_move|default(velocity) * 60 %}
  922.  
  923. {% set origin = printer.gcode_move.homing_origin %}
  924. {% set act = printer.gcode_move.gcode_position %}
  925. {% set max = printer.toolhead.axis_maximum %}
  926. {% set cone = printer.toolhead.cone_start_z|default(max.z) %}
  927. {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
  928. else False %}
  929.  
  930. {% set z_min = params.Z_MIN|default(0)|float %}
  931. {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
  932. {% set x_park = params.X if params.X is defined
  933. else custom_park_x if use_custom
  934. else 0.0 if round_bed
  935. else (max.x - 5.0) %}
  936. {% set y_park = params.Y if params.Y is defined
  937. else custom_park_y if use_custom
  938. else (max.y - 5.0) if round_bed and z_park < cone
  939. else 0.0 if round_bed
  940. else (max.y - 5.0) %}
  941.  
  942. _CLIENT_RETRACT
  943. {% if "xyz" in printer.toolhead.homed_axes %}
  944. G90
  945. G1 Z{z_park} F{sp_hop}
  946. G1 X{x_park} Y{y_park} F{sp_move}
  947. {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
  948. {% else %}
  949. RESPOND TYPE=echo MSG='Printer not homed'
  950. {% endif %}
  951.  
  952. [gcode_macro _CLIENT_EXTRUDE]
  953. description = Extrudes, if the extruder is hot enough
  954. gcode =
  955.  
  956. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  957. {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
  958. {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
  959. {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
  960. {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
  961.  
  962. {% if printer.toolhead.extruder != '' %}
  963. {% if printer[printer.toolhead.extruder].can_extrude %}
  964. {% if use_fw_retract %}
  965. {% if length < 0 %}
  966. G10
  967. {% else %}
  968. G11
  969. {% endif %}
  970. {% else %}
  971. M83
  972. G1 E{length} F{(speed|float|abs) * 60}
  973. {% if absolute_extrude %}
  974. M82
  975. {% endif %}
  976. {% endif %}
  977. {% else %}
  978. RESPOND TYPE=echo MSG='Extruder not hot enough'
  979. {% endif %}
  980. {% endif %}
  981.  
  982. [gcode_macro _CLIENT_RETRACT]
  983. description = Retracts, if the extruder is hot enough
  984. gcode =
  985. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  986. {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
  987. {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
  988.  
  989. _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
  990.  
  991. [stepper_x]
  992. microsteps = 16
  993. step_pin = P2.2
  994. dir_pin = P2.6
  995. enable_pin = !P2.1
  996. rotation_distance = 40
  997. endstop_pin = tmc2209_stepper_x:virtual_endstop
  998. position_endstop = 0
  999. position_max = 300
  1000. homing_speed = 20
  1001. homing_retract_dist = 0
  1002.  
  1003. [tmc2209 stepper_x]
  1004. uart_pin = P1.10
  1005. interpolate = True
  1006. run_current = 0.800
  1007. stealthchop_threshold = 999999
  1008. diag_pin = 1.29
  1009. driver_sgthrs = 255
  1010.  
  1011. [stepper_y]
  1012. microsteps = 16
  1013. step_pin = P0.19
  1014. dir_pin = P0.20
  1015. enable_pin = !P2.8
  1016. rotation_distance = 40
  1017. endstop_pin = tmc2209_stepper_y:virtual_endstop
  1018. position_endstop = 0
  1019. position_max = 300
  1020. homing_speed = 20
  1021. homing_retract_dist = 0
  1022.  
  1023. [tmc2209 stepper_y]
  1024. uart_pin = P1.9
  1025. interpolate = True
  1026. run_current = 0.800
  1027. stealthchop_threshold = 999999
  1028. diag_pin = 1.28
  1029. driver_sgthrs = 255
  1030.  
  1031. [stepper_z]
  1032. microsteps = 16
  1033. step_pin = P0.22
  1034. dir_pin = !P2.11
  1035. enable_pin = !P0.21
  1036. rotation_distance = 8
  1037. endstop_pin = probe:z_virtual_endstop
  1038. position_endstop = 0
  1039. position_min = -3.5
  1040. position_max = 400
  1041.  
  1042. [tmc2209 stepper_z]
  1043. uart_pin = P1.8
  1044. interpolate = True
  1045. run_current = 0.750
  1046. hold_current = 0.450
  1047. stealthchop_threshold = 999999
  1048.  
  1049. [stepper_z1]
  1050. microsteps = 16
  1051. step_pin = P1.15
  1052. dir_pin = !P1.14
  1053. enable_pin = !P1.16
  1054. rotation_distance = 8
  1055.  
  1056. [tmc2209 stepper_z1]
  1057. uart_pin = P1.1
  1058. interpolate = True
  1059. run_current = 0.750
  1060. hold_current = 0.450
  1061. stealthchop_threshold = 999999
  1062.  
  1063. [extruder]
  1064. microsteps = 16
  1065. step_pin = P2.13
  1066. dir_pin = P0.11
  1067. enable_pin = !P2.12
  1068. rotation_distance = 33.683
  1069. nozzle_diameter = 0.400
  1070. filament_diameter = 1.750
  1071. heater_pin = P2.7
  1072. sensor_type = EPCOS 100K B57560G104F
  1073. sensor_pin = P0.24
  1074. control = pid
  1075. pid_kp = 22.2
  1076. pid_ki = 1.72
  1077. pid_kd = 73.96
  1078. min_temp = 0
  1079. max_temp = 260
  1080. pressure_advance = 0.0
  1081. pressure_advance_smooth_time = 0.040
  1082.  
  1083. [tmc2209 extruder]
  1084. uart_pin = P1.4
  1085. interpolate = True
  1086. run_current = 0.600
  1087. hold_current = 0.500
  1088. stealthchop_threshold = 999999
  1089.  
  1090. [heater_bed]
  1091. heater_pin = P2.5
  1092. sensor_type = EPCOS 100K B57560G104F
  1093. sensor_pin = P0.25
  1094. control = pid
  1095. pid_kp = 54.027
  1096. pid_ki = 0.770
  1097. pid_kd = 948.182
  1098. min_temp = 0
  1099. max_temp = 130
  1100.  
  1101. [fan]
  1102. pin = P2.3
  1103.  
  1104. [mcu]
  1105. serial = /dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00
  1106. method = command
  1107.  
  1108. [printer]
  1109. kinematics = cartesian
  1110. max_velocity = 400
  1111. max_accel = 3000
  1112. max_z_velocity = 10
  1113. max_z_accel = 100
  1114.  
  1115. [z_tilt]
  1116. z_positions = -32, 179
  1117. 332, 179
  1118. points = 40, 179
  1119. 295, 179
  1120. speed = 50
  1121. horizontal_move_z = 5
  1122. retries = 10
  1123. retry_tolerance = 0.01
  1124.  
  1125. [gcode_arcs]
  1126. resolution = 1.0
  1127.  
  1128. [board_pins]
  1129. aliases =
  1130.  
  1131. EXP1_1=P1.30, EXP1_3=P1.18, EXP1_5=P1.20, EXP1_7=P1.22, EXP1_9=<GND>,
  1132. EXP1_2=P0.28, EXP1_4=P1.19, EXP1_6=P1.21, EXP1_8=P1.23, EXP1_10=<5V>,
  1133.  
  1134. EXP2_1=P0.17, EXP2_3=P3.26, EXP2_5=P3.25, EXP2_7=P1.31, EXP2_9=<GND>,
  1135. EXP2_2=P0.15, EXP2_4=P0.16, EXP2_6=P0.18, EXP2_8=<RST>, EXP2_10=<NC>
  1136.  
  1137. [display]
  1138. lcd_type = st7920
  1139. cs_pin = EXP1_4
  1140. sclk_pin = EXP1_5
  1141. sid_pin = EXP1_3
  1142. encoder_pins = ^EXP2_3, ^EXP2_5
  1143. click_pin = ^!EXP1_2
  1144.  
  1145. [output_pin beeper]
  1146. pin = EXP1_1
  1147. =======================
  1148. Extruder max_extrude_ratio=0.266081
  1149. Config error
  1150. Traceback (most recent call last):
  1151. File "/home/pi/klipper/klippy/klippy.py", line 175, in _connect
  1152. self._read_config()
  1153. File "/home/pi/klipper/klippy/klippy.py", line 145, in _read_config
  1154. pconfig.check_unused_options(config)
  1155. File "/home/pi/klipper/klippy/configfile.py", line 304, in check_unused_options
  1156. raise error("Option '%s' is not valid in section '%s'"
  1157. configparser.Error: Option 'position_endstop' is not valid in section 'stepper_z'
  1158. webhooks client 1965832968: New connection
  1159. webhooks client 1965832968: Client info {'program': 'Moonraker', 'version': 'v0.8.0-138-gfe12095'}
  1160. Attempting MCU 'mcu' reset
  1161. Unhandled exception during post run
  1162. Traceback (most recent call last):
  1163. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 265, in open
  1164. self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
  1165. FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00'
  1166.  
  1167. During handling of the above exception, another exception occurred:
  1168.  
  1169. Traceback (most recent call last):
  1170. File "/home/pi/klipper/klippy/klippy.py", line 234, in run
  1171. self.send_event("klippy:firmware_restart")
  1172. File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event
  1173. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  1174. File "/home/pi/klipper/klippy/klippy.py", line 263, in <listcomp>
  1175. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  1176. File "/home/pi/klipper/klippy/mcu.py", line 949, in _firmware_restart
  1177. self._restart_arduino()
  1178. File "/home/pi/klipper/klippy/mcu.py", line 909, in _restart_arduino
  1179. serialhdl.arduino_reset(self._serialport, self._reactor)
  1180. File "/home/pi/klipper/klippy/serialhdl.py", line 379, in arduino_reset
  1181. ser = serial.Serial(serialport, 2400, timeout=0, exclusive=True)
  1182. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialutil.py", line 240, in __init__
  1183. self.open()
  1184. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 268, in open
  1185. raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
  1186. serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00'
  1187. Restarting printer
  1188. Start printer at Mon Sep 11 13:17:43 2023 (1694463463.7 7491.8)
  1189. ===== Config file =====
  1190. [probe]
  1191. pin = 1.27
  1192. x_offset = 48
  1193. y_offset = -2
  1194. z_offset = 1
  1195. speed = 5
  1196. samples = 2
  1197. lift_speed = 8
  1198.  
  1199. [safe_z_home]
  1200. home_xy_position = 102, 152
  1201. z_hop = 5
  1202. z_hop_speed = 10.0
  1203.  
  1204. [bed_mesh]
  1205. mesh_min = 48, 20
  1206. mesh_max = 280, 280
  1207. probe_count = 5, 5
  1208.  
  1209. [virtual_sdcard]
  1210. path = ~/printer_data/gcodes
  1211. on_error_gcode = CANCEL_PRINT
  1212.  
  1213. [pause_resume]
  1214.  
  1215. [display_status]
  1216.  
  1217. [respond]
  1218.  
  1219. [gcode_macro CANCEL_PRINT]
  1220. description = Cancel the actual running print
  1221. rename_existing = CANCEL_PRINT_BASE
  1222. gcode =
  1223.  
  1224. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  1225. {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
  1226. {% set retract = client.cancel_retract|default(5.0)|abs %}
  1227.  
  1228. {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
  1229. else "X=" ~ client.park_at_cancel_x %}
  1230. {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
  1231. else "Y=" ~ client.park_at_cancel_y %}
  1232. {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
  1233.  
  1234.  
  1235. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  1236. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  1237. {% endif %}
  1238. {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %}
  1239. _CLIENT_RETRACT LENGTH={retract}
  1240. TURN_OFF_HEATERS
  1241. M106 S0
  1242.  
  1243. SET_PAUSE_NEXT_LAYER ENABLE=0
  1244. SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0
  1245. CANCEL_PRINT_BASE
  1246.  
  1247. [gcode_macro PAUSE]
  1248. description = Pause the actual running print
  1249. rename_existing = PAUSE_BASE
  1250. variable_restore_idle_timeout = 0
  1251. gcode =
  1252.  
  1253. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  1254. {% set idle_timeout = client.idle_timeout|default(0) %}
  1255. {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
  1256. {% set restore = False if printer.toolhead.extruder == ''
  1257. else True if params.RESTORE|default(1)|int == 1 else False %}
  1258.  
  1259. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
  1260.  
  1261. {% if idle_timeout > 0 %}
  1262. SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
  1263. SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
  1264. {% endif %}
  1265. PAUSE_BASE
  1266. _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}
  1267.  
  1268. [gcode_macro RESUME]
  1269. description = Resume the actual running print
  1270. rename_existing = RESUME_BASE
  1271. variable_last_extruder_temp = {'restore': False, 'temp': 0}
  1272. gcode =
  1273.  
  1274. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  1275. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  1276. {% set sp_move = client.speed_move|default(velocity) %}
  1277.  
  1278.  
  1279. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  1280. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  1281. {% endif %}
  1282. {% if printer.idle_timeout.state|upper == "IDLE" %}
  1283. {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
  1284. {% endif %}
  1285. _CLIENT_EXTRUDE
  1286. RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)}
  1287.  
  1288. [gcode_macro SET_PAUSE_NEXT_LAYER]
  1289. description = Enable a pause if the next layer is reached
  1290. gcode =
  1291. {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %}
  1292. {% set ENABLE = params.ENABLE|default(1)|int != 0 %}
  1293. {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %}
  1294. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}"
  1295.  
  1296. [gcode_macro SET_PAUSE_AT_LAYER]
  1297. description = Enable/disable a pause if a given layer number is reached
  1298. gcode =
  1299. {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %}
  1300. {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined
  1301. else params.LAYER is defined %}
  1302. {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %}
  1303. {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %}
  1304. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}"
  1305.  
  1306. [gcode_macro SET_PRINT_STATS_INFO]
  1307. rename_existing = SET_PRINT_STATS_INFO_BASE
  1308. description = Overwrite, to get pause_next_layer and pause_at_layer feature
  1309. variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" }
  1310. variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" }
  1311. gcode =
  1312. {% if pause_next_layer.enable %}
  1313. RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
  1314. {pause_next_layer.call}
  1315. SET_PAUSE_NEXT_LAYER ENABLE=0
  1316. {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
  1317. RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
  1318. {pause_at_layer.call}
  1319. SET_PAUSE_AT_LAYER ENABLE=0
  1320. {% endif %}
  1321. SET_PRINT_STATS_INFO_BASE {rawparams}
  1322.  
  1323. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  1324. description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
  1325. gcode =
  1326.  
  1327. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  1328. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  1329. {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %}
  1330. {% set custom_park_x = client.custom_park_x|default(0.0) %}
  1331. {% set custom_park_y = client.custom_park_y|default(0.0) %}
  1332. {% set park_dz = client.custom_park_dz|default(2.0)|abs %}
  1333. {% set sp_hop = client.speed_hop|default(15) * 60 %}
  1334. {% set sp_move = client.speed_move|default(velocity) * 60 %}
  1335.  
  1336. {% set origin = printer.gcode_move.homing_origin %}
  1337. {% set act = printer.gcode_move.gcode_position %}
  1338. {% set max = printer.toolhead.axis_maximum %}
  1339. {% set cone = printer.toolhead.cone_start_z|default(max.z) %}
  1340. {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
  1341. else False %}
  1342.  
  1343. {% set z_min = params.Z_MIN|default(0)|float %}
  1344. {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
  1345. {% set x_park = params.X if params.X is defined
  1346. else custom_park_x if use_custom
  1347. else 0.0 if round_bed
  1348. else (max.x - 5.0) %}
  1349. {% set y_park = params.Y if params.Y is defined
  1350. else custom_park_y if use_custom
  1351. else (max.y - 5.0) if round_bed and z_park < cone
  1352. else 0.0 if round_bed
  1353. else (max.y - 5.0) %}
  1354.  
  1355. _CLIENT_RETRACT
  1356. {% if "xyz" in printer.toolhead.homed_axes %}
  1357. G90
  1358. G1 Z{z_park} F{sp_hop}
  1359. G1 X{x_park} Y{y_park} F{sp_move}
  1360. {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
  1361. {% else %}
  1362. RESPOND TYPE=echo MSG='Printer not homed'
  1363. {% endif %}
  1364.  
  1365. [gcode_macro _CLIENT_EXTRUDE]
  1366. description = Extrudes, if the extruder is hot enough
  1367. gcode =
  1368.  
  1369. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  1370. {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
  1371. {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
  1372. {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
  1373. {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
  1374.  
  1375. {% if printer.toolhead.extruder != '' %}
  1376. {% if printer[printer.toolhead.extruder].can_extrude %}
  1377. {% if use_fw_retract %}
  1378. {% if length < 0 %}
  1379. G10
  1380. {% else %}
  1381. G11
  1382. {% endif %}
  1383. {% else %}
  1384. M83
  1385. G1 E{length} F{(speed|float|abs) * 60}
  1386. {% if absolute_extrude %}
  1387. M82
  1388. {% endif %}
  1389. {% endif %}
  1390. {% else %}
  1391. RESPOND TYPE=echo MSG='Extruder not hot enough'
  1392. {% endif %}
  1393. {% endif %}
  1394.  
  1395. [gcode_macro _CLIENT_RETRACT]
  1396. description = Retracts, if the extruder is hot enough
  1397. gcode =
  1398. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  1399. {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
  1400. {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
  1401.  
  1402. _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
  1403.  
  1404. [stepper_x]
  1405. microsteps = 16
  1406. step_pin = P2.2
  1407. dir_pin = P2.6
  1408. enable_pin = !P2.1
  1409. rotation_distance = 40
  1410. endstop_pin = tmc2209_stepper_x:virtual_endstop
  1411. position_endstop = 0
  1412. position_max = 300
  1413. homing_speed = 20
  1414. homing_retract_dist = 0
  1415.  
  1416. [tmc2209 stepper_x]
  1417. uart_pin = P1.10
  1418. interpolate = True
  1419. run_current = 0.800
  1420. stealthchop_threshold = 999999
  1421. diag_pin = 1.29
  1422. driver_sgthrs = 255
  1423.  
  1424. [stepper_y]
  1425. microsteps = 16
  1426. step_pin = P0.19
  1427. dir_pin = P0.20
  1428. enable_pin = !P2.8
  1429. rotation_distance = 40
  1430. endstop_pin = tmc2209_stepper_y:virtual_endstop
  1431. position_endstop = 0
  1432. position_max = 300
  1433. homing_speed = 20
  1434. homing_retract_dist = 0
  1435.  
  1436. [tmc2209 stepper_y]
  1437. uart_pin = P1.9
  1438. interpolate = True
  1439. run_current = 0.800
  1440. stealthchop_threshold = 999999
  1441. diag_pin = 1.28
  1442. driver_sgthrs = 255
  1443.  
  1444. [stepper_z]
  1445. microsteps = 16
  1446. step_pin = P0.22
  1447. dir_pin = !P2.11
  1448. enable_pin = !P0.21
  1449. rotation_distance = 8
  1450. endstop_pin = probe:z_virtual_endstop
  1451. position_endstop = 0
  1452. position_min = -3.5
  1453. position_max = 400
  1454.  
  1455. [tmc2209 stepper_z]
  1456. uart_pin = P1.8
  1457. interpolate = True
  1458. run_current = 0.750
  1459. hold_current = 0.450
  1460. stealthchop_threshold = 999999
  1461.  
  1462. [stepper_z1]
  1463. microsteps = 16
  1464. step_pin = P1.15
  1465. dir_pin = !P1.14
  1466. enable_pin = !P1.16
  1467. rotation_distance = 8
  1468.  
  1469. [tmc2209 stepper_z1]
  1470. uart_pin = P1.1
  1471. interpolate = True
  1472. run_current = 0.750
  1473. hold_current = 0.450
  1474. stealthchop_threshold = 999999
  1475.  
  1476. [extruder]
  1477. microsteps = 16
  1478. step_pin = P2.13
  1479. dir_pin = P0.11
  1480. enable_pin = !P2.12
  1481. rotation_distance = 33.683
  1482. nozzle_diameter = 0.400
  1483. filament_diameter = 1.750
  1484. heater_pin = P2.7
  1485. sensor_type = EPCOS 100K B57560G104F
  1486. sensor_pin = P0.24
  1487. control = pid
  1488. pid_kp = 22.2
  1489. pid_ki = 1.72
  1490. pid_kd = 73.96
  1491. min_temp = 0
  1492. max_temp = 260
  1493. pressure_advance = 0.0
  1494. pressure_advance_smooth_time = 0.040
  1495.  
  1496. [tmc2209 extruder]
  1497. uart_pin = P1.4
  1498. interpolate = True
  1499. run_current = 0.600
  1500. hold_current = 0.500
  1501. stealthchop_threshold = 999999
  1502.  
  1503. [heater_bed]
  1504. heater_pin = P2.5
  1505. sensor_type = EPCOS 100K B57560G104F
  1506. sensor_pin = P0.25
  1507. control = pid
  1508. pid_kp = 54.027
  1509. pid_ki = 0.770
  1510. pid_kd = 948.182
  1511. min_temp = 0
  1512. max_temp = 130
  1513.  
  1514. [fan]
  1515. pin = P2.3
  1516.  
  1517. [mcu]
  1518. serial = /dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00
  1519. method = command
  1520.  
  1521. [printer]
  1522. kinematics = cartesian
  1523. max_velocity = 400
  1524. max_accel = 3000
  1525. max_z_velocity = 10
  1526. max_z_accel = 100
  1527.  
  1528. [z_tilt]
  1529. z_positions = -32, 179
  1530. 332, 179
  1531. points = 40, 179
  1532. 295, 179
  1533. speed = 50
  1534. horizontal_move_z = 5
  1535. retries = 10
  1536. retry_tolerance = 0.01
  1537.  
  1538. [gcode_arcs]
  1539. resolution = 1.0
  1540.  
  1541. [board_pins]
  1542. aliases =
  1543.  
  1544. EXP1_1=P1.30, EXP1_3=P1.18, EXP1_5=P1.20, EXP1_7=P1.22, EXP1_9=<GND>,
  1545. EXP1_2=P0.28, EXP1_4=P1.19, EXP1_6=P1.21, EXP1_8=P1.23, EXP1_10=<5V>,
  1546.  
  1547. EXP2_1=P0.17, EXP2_3=P3.26, EXP2_5=P3.25, EXP2_7=P1.31, EXP2_9=<GND>,
  1548. EXP2_2=P0.15, EXP2_4=P0.16, EXP2_6=P0.18, EXP2_8=<RST>, EXP2_10=<NC>
  1549.  
  1550. [display]
  1551. lcd_type = st7920
  1552. cs_pin = EXP1_4
  1553. sclk_pin = EXP1_5
  1554. sid_pin = EXP1_3
  1555. encoder_pins = ^EXP2_3, ^EXP2_5
  1556. click_pin = ^!EXP1_2
  1557.  
  1558. [output_pin beeper]
  1559. pin = EXP1_1
  1560. =======================
  1561. Extruder max_extrude_ratio=0.266081
  1562. Config error
  1563. Traceback (most recent call last):
  1564. File "/home/pi/klipper/klippy/klippy.py", line 175, in _connect
  1565. self._read_config()
  1566. File "/home/pi/klipper/klippy/klippy.py", line 145, in _read_config
  1567. pconfig.check_unused_options(config)
  1568. File "/home/pi/klipper/klippy/configfile.py", line 304, in check_unused_options
  1569. raise error("Option '%s' is not valid in section '%s'"
  1570. configparser.Error: Option 'position_endstop' is not valid in section 'stepper_z'
  1571. webhooks client 1964108480: New connection
  1572. webhooks client 1964108480: Client info {'program': 'Moonraker', 'version': 'v0.8.0-138-gfe12095'}
  1573. Attempting MCU 'mcu' reset
  1574. Unhandled exception during post run
  1575. Traceback (most recent call last):
  1576. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 265, in open
  1577. self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
  1578. FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00'
  1579.  
  1580. During handling of the above exception, another exception occurred:
  1581.  
  1582. Traceback (most recent call last):
  1583. File "/home/pi/klipper/klippy/klippy.py", line 234, in run
  1584. self.send_event("klippy:firmware_restart")
  1585. File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event
  1586. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  1587. File "/home/pi/klipper/klippy/klippy.py", line 263, in <listcomp>
  1588. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  1589. File "/home/pi/klipper/klippy/mcu.py", line 949, in _firmware_restart
  1590. self._restart_arduino()
  1591. File "/home/pi/klipper/klippy/mcu.py", line 909, in _restart_arduino
  1592. serialhdl.arduino_reset(self._serialport, self._reactor)
  1593. File "/home/pi/klipper/klippy/serialhdl.py", line 379, in arduino_reset
  1594. ser = serial.Serial(serialport, 2400, timeout=0, exclusive=True)
  1595. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialutil.py", line 240, in __init__
  1596. self.open()
  1597. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 268, in open
  1598. raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
  1599. serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00'
  1600. Restarting printer
  1601. Start printer at Mon Sep 11 13:19:21 2023 (1694463561.4 7589.5)
  1602. ===== Config file =====
  1603. [probe]
  1604. pin = 1.27
  1605. x_offset = 48
  1606. y_offset = -2
  1607. z_offset = 1
  1608. speed = 5
  1609. samples = 2
  1610. lift_speed = 8
  1611.  
  1612. [safe_z_home]
  1613. home_xy_position = 102, 152
  1614. z_hop = 5
  1615. z_hop_speed = 10.0
  1616.  
  1617. [bed_mesh]
  1618. mesh_min = 48, 20
  1619. mesh_max = 280, 280
  1620. probe_count = 5, 5
  1621.  
  1622. [virtual_sdcard]
  1623. path = ~/printer_data/gcodes
  1624. on_error_gcode = CANCEL_PRINT
  1625.  
  1626. [pause_resume]
  1627.  
  1628. [display_status]
  1629.  
  1630. [respond]
  1631.  
  1632. [gcode_macro CANCEL_PRINT]
  1633. description = Cancel the actual running print
  1634. rename_existing = CANCEL_PRINT_BASE
  1635. gcode =
  1636.  
  1637. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  1638. {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
  1639. {% set retract = client.cancel_retract|default(5.0)|abs %}
  1640.  
  1641. {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
  1642. else "X=" ~ client.park_at_cancel_x %}
  1643. {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
  1644. else "Y=" ~ client.park_at_cancel_y %}
  1645. {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
  1646.  
  1647.  
  1648. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  1649. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  1650. {% endif %}
  1651. {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %}
  1652. _CLIENT_RETRACT LENGTH={retract}
  1653. TURN_OFF_HEATERS
  1654. M106 S0
  1655.  
  1656. SET_PAUSE_NEXT_LAYER ENABLE=0
  1657. SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0
  1658. CANCEL_PRINT_BASE
  1659.  
  1660. [gcode_macro PAUSE]
  1661. description = Pause the actual running print
  1662. rename_existing = PAUSE_BASE
  1663. variable_restore_idle_timeout = 0
  1664. gcode =
  1665.  
  1666. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  1667. {% set idle_timeout = client.idle_timeout|default(0) %}
  1668. {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
  1669. {% set restore = False if printer.toolhead.extruder == ''
  1670. else True if params.RESTORE|default(1)|int == 1 else False %}
  1671.  
  1672. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
  1673.  
  1674. {% if idle_timeout > 0 %}
  1675. SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
  1676. SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
  1677. {% endif %}
  1678. PAUSE_BASE
  1679. _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}
  1680.  
  1681. [gcode_macro RESUME]
  1682. description = Resume the actual running print
  1683. rename_existing = RESUME_BASE
  1684. variable_last_extruder_temp = {'restore': False, 'temp': 0}
  1685. gcode =
  1686.  
  1687. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  1688. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  1689. {% set sp_move = client.speed_move|default(velocity) %}
  1690.  
  1691.  
  1692. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  1693. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  1694. {% endif %}
  1695. {% if printer.idle_timeout.state|upper == "IDLE" %}
  1696. {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
  1697. {% endif %}
  1698. _CLIENT_EXTRUDE
  1699. RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)}
  1700.  
  1701. [gcode_macro SET_PAUSE_NEXT_LAYER]
  1702. description = Enable a pause if the next layer is reached
  1703. gcode =
  1704. {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %}
  1705. {% set ENABLE = params.ENABLE|default(1)|int != 0 %}
  1706. {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %}
  1707. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}"
  1708.  
  1709. [gcode_macro SET_PAUSE_AT_LAYER]
  1710. description = Enable/disable a pause if a given layer number is reached
  1711. gcode =
  1712. {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %}
  1713. {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined
  1714. else params.LAYER is defined %}
  1715. {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %}
  1716. {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %}
  1717. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}"
  1718.  
  1719. [gcode_macro SET_PRINT_STATS_INFO]
  1720. rename_existing = SET_PRINT_STATS_INFO_BASE
  1721. description = Overwrite, to get pause_next_layer and pause_at_layer feature
  1722. variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" }
  1723. variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" }
  1724. gcode =
  1725. {% if pause_next_layer.enable %}
  1726. RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
  1727. {pause_next_layer.call}
  1728. SET_PAUSE_NEXT_LAYER ENABLE=0
  1729. {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
  1730. RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
  1731. {pause_at_layer.call}
  1732. SET_PAUSE_AT_LAYER ENABLE=0
  1733. {% endif %}
  1734. SET_PRINT_STATS_INFO_BASE {rawparams}
  1735.  
  1736. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  1737. description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
  1738. gcode =
  1739.  
  1740. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  1741. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  1742. {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %}
  1743. {% set custom_park_x = client.custom_park_x|default(0.0) %}
  1744. {% set custom_park_y = client.custom_park_y|default(0.0) %}
  1745. {% set park_dz = client.custom_park_dz|default(2.0)|abs %}
  1746. {% set sp_hop = client.speed_hop|default(15) * 60 %}
  1747. {% set sp_move = client.speed_move|default(velocity) * 60 %}
  1748.  
  1749. {% set origin = printer.gcode_move.homing_origin %}
  1750. {% set act = printer.gcode_move.gcode_position %}
  1751. {% set max = printer.toolhead.axis_maximum %}
  1752. {% set cone = printer.toolhead.cone_start_z|default(max.z) %}
  1753. {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
  1754. else False %}
  1755.  
  1756. {% set z_min = params.Z_MIN|default(0)|float %}
  1757. {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
  1758. {% set x_park = params.X if params.X is defined
  1759. else custom_park_x if use_custom
  1760. else 0.0 if round_bed
  1761. else (max.x - 5.0) %}
  1762. {% set y_park = params.Y if params.Y is defined
  1763. else custom_park_y if use_custom
  1764. else (max.y - 5.0) if round_bed and z_park < cone
  1765. else 0.0 if round_bed
  1766. else (max.y - 5.0) %}
  1767.  
  1768. _CLIENT_RETRACT
  1769. {% if "xyz" in printer.toolhead.homed_axes %}
  1770. G90
  1771. G1 Z{z_park} F{sp_hop}
  1772. G1 X{x_park} Y{y_park} F{sp_move}
  1773. {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
  1774. {% else %}
  1775. RESPOND TYPE=echo MSG='Printer not homed'
  1776. {% endif %}
  1777.  
  1778. [gcode_macro _CLIENT_EXTRUDE]
  1779. description = Extrudes, if the extruder is hot enough
  1780. gcode =
  1781.  
  1782. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  1783. {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
  1784. {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
  1785. {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
  1786. {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
  1787.  
  1788. {% if printer.toolhead.extruder != '' %}
  1789. {% if printer[printer.toolhead.extruder].can_extrude %}
  1790. {% if use_fw_retract %}
  1791. {% if length < 0 %}
  1792. G10
  1793. {% else %}
  1794. G11
  1795. {% endif %}
  1796. {% else %}
  1797. M83
  1798. G1 E{length} F{(speed|float|abs) * 60}
  1799. {% if absolute_extrude %}
  1800. M82
  1801. {% endif %}
  1802. {% endif %}
  1803. {% else %}
  1804. RESPOND TYPE=echo MSG='Extruder not hot enough'
  1805. {% endif %}
  1806. {% endif %}
  1807.  
  1808. [gcode_macro _CLIENT_RETRACT]
  1809. description = Retracts, if the extruder is hot enough
  1810. gcode =
  1811. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  1812. {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
  1813. {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
  1814.  
  1815. _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
  1816.  
  1817. [stepper_x]
  1818. microsteps = 16
  1819. step_pin = P2.2
  1820. dir_pin = P2.6
  1821. enable_pin = !P2.1
  1822. rotation_distance = 40
  1823. endstop_pin = tmc2209_stepper_x:virtual_endstop
  1824. position_endstop = 0
  1825. position_max = 300
  1826. homing_speed = 20
  1827. homing_retract_dist = 0
  1828.  
  1829. [tmc2209 stepper_x]
  1830. uart_pin = P1.10
  1831. interpolate = True
  1832. run_current = 0.800
  1833. stealthchop_threshold = 999999
  1834. diag_pin = 1.29
  1835. driver_sgthrs = 255
  1836.  
  1837. [stepper_y]
  1838. microsteps = 16
  1839. step_pin = P0.19
  1840. dir_pin = P0.20
  1841. enable_pin = !P2.8
  1842. rotation_distance = 40
  1843. endstop_pin = tmc2209_stepper_y:virtual_endstop
  1844. position_endstop = 0
  1845. position_max = 300
  1846. homing_speed = 20
  1847. homing_retract_dist = 0
  1848.  
  1849. [tmc2209 stepper_y]
  1850. uart_pin = P1.9
  1851. interpolate = True
  1852. run_current = 0.800
  1853. stealthchop_threshold = 999999
  1854. diag_pin = 1.28
  1855. driver_sgthrs = 255
  1856.  
  1857. [stepper_z]
  1858. microsteps = 16
  1859. step_pin = P0.22
  1860. dir_pin = !P2.11
  1861. enable_pin = !P0.21
  1862. rotation_distance = 8
  1863. endstop_pin = probe:z_virtual_endstop
  1864. position_endstop = 0
  1865. position_min = -3.5
  1866. position_max = 400
  1867.  
  1868. [tmc2209 stepper_z]
  1869. uart_pin = P1.8
  1870. interpolate = True
  1871. run_current = 0.750
  1872. hold_current = 0.450
  1873. stealthchop_threshold = 999999
  1874.  
  1875. [stepper_z1]
  1876. microsteps = 16
  1877. step_pin = P1.15
  1878. dir_pin = !P1.14
  1879. enable_pin = !P1.16
  1880. rotation_distance = 8
  1881.  
  1882. [tmc2209 stepper_z1]
  1883. uart_pin = P1.1
  1884. interpolate = True
  1885. run_current = 0.750
  1886. hold_current = 0.450
  1887. stealthchop_threshold = 999999
  1888.  
  1889. [extruder]
  1890. microsteps = 16
  1891. step_pin = P2.13
  1892. dir_pin = P0.11
  1893. enable_pin = !P2.12
  1894. rotation_distance = 33.683
  1895. nozzle_diameter = 0.400
  1896. filament_diameter = 1.750
  1897. heater_pin = P2.7
  1898. sensor_type = EPCOS 100K B57560G104F
  1899. sensor_pin = P0.24
  1900. control = pid
  1901. pid_kp = 22.2
  1902. pid_ki = 1.72
  1903. pid_kd = 73.96
  1904. min_temp = 0
  1905. max_temp = 260
  1906. pressure_advance = 0.0
  1907. pressure_advance_smooth_time = 0.040
  1908.  
  1909. [tmc2209 extruder]
  1910. uart_pin = P1.4
  1911. interpolate = True
  1912. run_current = 0.600
  1913. hold_current = 0.500
  1914. stealthchop_threshold = 999999
  1915.  
  1916. [heater_bed]
  1917. heater_pin = P2.5
  1918. sensor_type = EPCOS 100K B57560G104F
  1919. sensor_pin = P0.25
  1920. control = pid
  1921. pid_kp = 54.027
  1922. pid_ki = 0.770
  1923. pid_kd = 948.182
  1924. min_temp = 0
  1925. max_temp = 130
  1926.  
  1927. [fan]
  1928. pin = P2.3
  1929.  
  1930. [mcu]
  1931. serial = /dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00
  1932. method = command
  1933.  
  1934. [printer]
  1935. kinematics = cartesian
  1936. max_velocity = 400
  1937. max_accel = 3000
  1938. max_z_velocity = 10
  1939. max_z_accel = 100
  1940.  
  1941. [z_tilt]
  1942. z_positions = -32, 179
  1943. 332, 179
  1944. points = 40, 179
  1945. 295, 179
  1946. speed = 50
  1947. horizontal_move_z = 5
  1948. retries = 10
  1949. retry_tolerance = 0.01
  1950.  
  1951. [gcode_arcs]
  1952. resolution = 1.0
  1953.  
  1954. [board_pins]
  1955. aliases =
  1956.  
  1957. EXP1_1=P1.30, EXP1_3=P1.18, EXP1_5=P1.20, EXP1_7=P1.22, EXP1_9=<GND>,
  1958. EXP1_2=P0.28, EXP1_4=P1.19, EXP1_6=P1.21, EXP1_8=P1.23, EXP1_10=<5V>,
  1959.  
  1960. EXP2_1=P0.17, EXP2_3=P3.26, EXP2_5=P3.25, EXP2_7=P1.31, EXP2_9=<GND>,
  1961. EXP2_2=P0.15, EXP2_4=P0.16, EXP2_6=P0.18, EXP2_8=<RST>, EXP2_10=<NC>
  1962.  
  1963. [display]
  1964. lcd_type = st7920
  1965. cs_pin = EXP1_4
  1966. sclk_pin = EXP1_5
  1967. sid_pin = EXP1_3
  1968. encoder_pins = ^EXP2_3, ^EXP2_5
  1969. click_pin = ^!EXP1_2
  1970.  
  1971. [output_pin beeper]
  1972. pin = EXP1_1
  1973. =======================
  1974. Extruder max_extrude_ratio=0.266081
  1975. Config error
  1976. Traceback (most recent call last):
  1977. File "/home/pi/klipper/klippy/klippy.py", line 175, in _connect
  1978. self._read_config()
  1979. File "/home/pi/klipper/klippy/klippy.py", line 145, in _read_config
  1980. pconfig.check_unused_options(config)
  1981. File "/home/pi/klipper/klippy/configfile.py", line 304, in check_unused_options
  1982. raise error("Option '%s' is not valid in section '%s'"
  1983. configparser.Error: Option 'position_endstop' is not valid in section 'stepper_z'
  1984. webhooks client 1965667784: New connection
  1985. webhooks client 1965667784: Client info {'program': 'Moonraker', 'version': 'v0.8.0-138-gfe12095'}
  1986. webhooks client 1965667784: Disconnected
  1987. Restarting printer
  1988. Start printer at Mon Sep 11 13:19:55 2023 (1694463595.2 7623.3)
  1989. ===== Config file =====
  1990. [probe]
  1991. pin = 1.27
  1992. x_offset = 48
  1993. y_offset = -2
  1994. z_offset = 1
  1995. speed = 5
  1996. samples = 2
  1997. lift_speed = 8
  1998.  
  1999. [safe_z_home]
  2000. home_xy_position = 102, 152
  2001. z_hop = 5
  2002. z_hop_speed = 10.0
  2003.  
  2004. [bed_mesh]
  2005. mesh_min = 48, 20
  2006. mesh_max = 280, 280
  2007. probe_count = 5, 5
  2008.  
  2009. [virtual_sdcard]
  2010. path = ~/printer_data/gcodes
  2011. on_error_gcode = CANCEL_PRINT
  2012.  
  2013. [pause_resume]
  2014.  
  2015. [display_status]
  2016.  
  2017. [respond]
  2018.  
  2019. [gcode_macro CANCEL_PRINT]
  2020. description = Cancel the actual running print
  2021. rename_existing = CANCEL_PRINT_BASE
  2022. gcode =
  2023.  
  2024. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2025. {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
  2026. {% set retract = client.cancel_retract|default(5.0)|abs %}
  2027.  
  2028. {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
  2029. else "X=" ~ client.park_at_cancel_x %}
  2030. {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
  2031. else "Y=" ~ client.park_at_cancel_y %}
  2032. {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
  2033.  
  2034.  
  2035. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  2036. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  2037. {% endif %}
  2038. {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %}
  2039. _CLIENT_RETRACT LENGTH={retract}
  2040. TURN_OFF_HEATERS
  2041. M106 S0
  2042.  
  2043. SET_PAUSE_NEXT_LAYER ENABLE=0
  2044. SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0
  2045. CANCEL_PRINT_BASE
  2046.  
  2047. [gcode_macro PAUSE]
  2048. description = Pause the actual running print
  2049. rename_existing = PAUSE_BASE
  2050. variable_restore_idle_timeout = 0
  2051. gcode =
  2052.  
  2053. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2054. {% set idle_timeout = client.idle_timeout|default(0) %}
  2055. {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
  2056. {% set restore = False if printer.toolhead.extruder == ''
  2057. else True if params.RESTORE|default(1)|int == 1 else False %}
  2058.  
  2059. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
  2060.  
  2061. {% if idle_timeout > 0 %}
  2062. SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
  2063. SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
  2064. {% endif %}
  2065. PAUSE_BASE
  2066. _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}
  2067.  
  2068. [gcode_macro RESUME]
  2069. description = Resume the actual running print
  2070. rename_existing = RESUME_BASE
  2071. variable_last_extruder_temp = {'restore': False, 'temp': 0}
  2072. gcode =
  2073.  
  2074. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2075. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  2076. {% set sp_move = client.speed_move|default(velocity) %}
  2077.  
  2078.  
  2079. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  2080. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  2081. {% endif %}
  2082. {% if printer.idle_timeout.state|upper == "IDLE" %}
  2083. {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
  2084. {% endif %}
  2085. _CLIENT_EXTRUDE
  2086. RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)}
  2087.  
  2088. [gcode_macro SET_PAUSE_NEXT_LAYER]
  2089. description = Enable a pause if the next layer is reached
  2090. gcode =
  2091. {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %}
  2092. {% set ENABLE = params.ENABLE|default(1)|int != 0 %}
  2093. {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %}
  2094. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}"
  2095.  
  2096. [gcode_macro SET_PAUSE_AT_LAYER]
  2097. description = Enable/disable a pause if a given layer number is reached
  2098. gcode =
  2099. {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %}
  2100. {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined
  2101. else params.LAYER is defined %}
  2102. {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %}
  2103. {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %}
  2104. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}"
  2105.  
  2106. [gcode_macro SET_PRINT_STATS_INFO]
  2107. rename_existing = SET_PRINT_STATS_INFO_BASE
  2108. description = Overwrite, to get pause_next_layer and pause_at_layer feature
  2109. variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" }
  2110. variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" }
  2111. gcode =
  2112. {% if pause_next_layer.enable %}
  2113. RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
  2114. {pause_next_layer.call}
  2115. SET_PAUSE_NEXT_LAYER ENABLE=0
  2116. {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
  2117. RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
  2118. {pause_at_layer.call}
  2119. SET_PAUSE_AT_LAYER ENABLE=0
  2120. {% endif %}
  2121. SET_PRINT_STATS_INFO_BASE {rawparams}
  2122.  
  2123. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  2124. description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
  2125. gcode =
  2126.  
  2127. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2128. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  2129. {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %}
  2130. {% set custom_park_x = client.custom_park_x|default(0.0) %}
  2131. {% set custom_park_y = client.custom_park_y|default(0.0) %}
  2132. {% set park_dz = client.custom_park_dz|default(2.0)|abs %}
  2133. {% set sp_hop = client.speed_hop|default(15) * 60 %}
  2134. {% set sp_move = client.speed_move|default(velocity) * 60 %}
  2135.  
  2136. {% set origin = printer.gcode_move.homing_origin %}
  2137. {% set act = printer.gcode_move.gcode_position %}
  2138. {% set max = printer.toolhead.axis_maximum %}
  2139. {% set cone = printer.toolhead.cone_start_z|default(max.z) %}
  2140. {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
  2141. else False %}
  2142.  
  2143. {% set z_min = params.Z_MIN|default(0)|float %}
  2144. {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
  2145. {% set x_park = params.X if params.X is defined
  2146. else custom_park_x if use_custom
  2147. else 0.0 if round_bed
  2148. else (max.x - 5.0) %}
  2149. {% set y_park = params.Y if params.Y is defined
  2150. else custom_park_y if use_custom
  2151. else (max.y - 5.0) if round_bed and z_park < cone
  2152. else 0.0 if round_bed
  2153. else (max.y - 5.0) %}
  2154.  
  2155. _CLIENT_RETRACT
  2156. {% if "xyz" in printer.toolhead.homed_axes %}
  2157. G90
  2158. G1 Z{z_park} F{sp_hop}
  2159. G1 X{x_park} Y{y_park} F{sp_move}
  2160. {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
  2161. {% else %}
  2162. RESPOND TYPE=echo MSG='Printer not homed'
  2163. {% endif %}
  2164.  
  2165. [gcode_macro _CLIENT_EXTRUDE]
  2166. description = Extrudes, if the extruder is hot enough
  2167. gcode =
  2168.  
  2169. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2170. {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
  2171. {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
  2172. {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
  2173. {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
  2174.  
  2175. {% if printer.toolhead.extruder != '' %}
  2176. {% if printer[printer.toolhead.extruder].can_extrude %}
  2177. {% if use_fw_retract %}
  2178. {% if length < 0 %}
  2179. G10
  2180. {% else %}
  2181. G11
  2182. {% endif %}
  2183. {% else %}
  2184. M83
  2185. G1 E{length} F{(speed|float|abs) * 60}
  2186. {% if absolute_extrude %}
  2187. M82
  2188. {% endif %}
  2189. {% endif %}
  2190. {% else %}
  2191. RESPOND TYPE=echo MSG='Extruder not hot enough'
  2192. {% endif %}
  2193. {% endif %}
  2194.  
  2195. [gcode_macro _CLIENT_RETRACT]
  2196. description = Retracts, if the extruder is hot enough
  2197. gcode =
  2198. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2199. {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
  2200. {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
  2201.  
  2202. _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
  2203.  
  2204. [stepper_x]
  2205. microsteps = 16
  2206. step_pin = P2.2
  2207. dir_pin = P2.6
  2208. enable_pin = !P2.1
  2209. rotation_distance = 40
  2210. endstop_pin = tmc2209_stepper_x:virtual_endstop
  2211. position_endstop = 0
  2212. position_max = 300
  2213. homing_speed = 20
  2214. homing_retract_dist = 0
  2215.  
  2216. [tmc2209 stepper_x]
  2217. uart_pin = P1.10
  2218. interpolate = True
  2219. run_current = 0.800
  2220. stealthchop_threshold = 999999
  2221. diag_pin = 1.29
  2222. driver_sgthrs = 255
  2223.  
  2224. [stepper_y]
  2225. microsteps = 16
  2226. step_pin = P0.19
  2227. dir_pin = P0.20
  2228. enable_pin = !P2.8
  2229. rotation_distance = 40
  2230. endstop_pin = tmc2209_stepper_y:virtual_endstop
  2231. position_endstop = 0
  2232. position_max = 300
  2233. homing_speed = 20
  2234. homing_retract_dist = 0
  2235.  
  2236. [tmc2209 stepper_y]
  2237. uart_pin = P1.9
  2238. interpolate = True
  2239. run_current = 0.800
  2240. stealthchop_threshold = 999999
  2241. diag_pin = 1.28
  2242. driver_sgthrs = 255
  2243.  
  2244. [stepper_z]
  2245. microsteps = 16
  2246. step_pin = P0.22
  2247. dir_pin = !P2.11
  2248. enable_pin = !P0.21
  2249. rotation_distance = 8
  2250. endstop_pin = probe:z_virtual_endstop
  2251. position_endstop = 0
  2252. position_min = -3.5
  2253. position_max = 400
  2254.  
  2255. [tmc2209 stepper_z]
  2256. uart_pin = P1.8
  2257. interpolate = True
  2258. run_current = 0.750
  2259. hold_current = 0.450
  2260. stealthchop_threshold = 999999
  2261.  
  2262. [stepper_z1]
  2263. microsteps = 16
  2264. step_pin = P1.15
  2265. dir_pin = !P1.14
  2266. enable_pin = !P1.16
  2267. rotation_distance = 8
  2268.  
  2269. [tmc2209 stepper_z1]
  2270. uart_pin = P1.1
  2271. interpolate = True
  2272. run_current = 0.750
  2273. hold_current = 0.450
  2274. stealthchop_threshold = 999999
  2275.  
  2276. [extruder]
  2277. microsteps = 16
  2278. step_pin = P2.13
  2279. dir_pin = P0.11
  2280. enable_pin = !P2.12
  2281. rotation_distance = 33.683
  2282. nozzle_diameter = 0.400
  2283. filament_diameter = 1.750
  2284. heater_pin = P2.7
  2285. sensor_type = EPCOS 100K B57560G104F
  2286. sensor_pin = P0.24
  2287. control = pid
  2288. pid_kp = 22.2
  2289. pid_ki = 1.72
  2290. pid_kd = 73.96
  2291. min_temp = 0
  2292. max_temp = 260
  2293. pressure_advance = 0.0
  2294. pressure_advance_smooth_time = 0.040
  2295.  
  2296. [tmc2209 extruder]
  2297. uart_pin = P1.4
  2298. interpolate = True
  2299. run_current = 0.600
  2300. hold_current = 0.500
  2301. stealthchop_threshold = 999999
  2302.  
  2303. [heater_bed]
  2304. heater_pin = P2.5
  2305. sensor_type = EPCOS 100K B57560G104F
  2306. sensor_pin = P0.25
  2307. control = pid
  2308. pid_kp = 54.027
  2309. pid_ki = 0.770
  2310. pid_kd = 948.182
  2311. min_temp = 0
  2312. max_temp = 130
  2313.  
  2314. [fan]
  2315. pin = P2.3
  2316.  
  2317. [mcu]
  2318. serial = /dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00
  2319. method = command
  2320.  
  2321. [printer]
  2322. kinematics = cartesian
  2323. max_velocity = 400
  2324. max_accel = 3000
  2325. max_z_velocity = 10
  2326. max_z_accel = 100
  2327.  
  2328. [z_tilt]
  2329. z_positions = -32, 179
  2330. 332, 179
  2331. points = 40, 179
  2332. 295, 179
  2333. speed = 50
  2334. horizontal_move_z = 5
  2335. retries = 10
  2336. retry_tolerance = 0.01
  2337.  
  2338. [gcode_arcs]
  2339. resolution = 1.0
  2340.  
  2341. [board_pins]
  2342. aliases =
  2343.  
  2344. EXP1_1=P1.30, EXP1_3=P1.18, EXP1_5=P1.20, EXP1_7=P1.22, EXP1_9=<GND>,
  2345. EXP1_2=P0.28, EXP1_4=P1.19, EXP1_6=P1.21, EXP1_8=P1.23, EXP1_10=<5V>,
  2346.  
  2347. EXP2_1=P0.17, EXP2_3=P3.26, EXP2_5=P3.25, EXP2_7=P1.31, EXP2_9=<GND>,
  2348. EXP2_2=P0.15, EXP2_4=P0.16, EXP2_6=P0.18, EXP2_8=<RST>, EXP2_10=<NC>
  2349.  
  2350. [display]
  2351. lcd_type = st7920
  2352. cs_pin = EXP1_4
  2353. sclk_pin = EXP1_5
  2354. sid_pin = EXP1_3
  2355. encoder_pins = ^EXP2_3, ^EXP2_5
  2356. click_pin = ^!EXP1_2
  2357.  
  2358. [output_pin beeper]
  2359. pin = EXP1_1
  2360. =======================
  2361. Extruder max_extrude_ratio=0.266081
  2362. Config error
  2363. Traceback (most recent call last):
  2364. File "/home/pi/klipper/klippy/klippy.py", line 175, in _connect
  2365. self._read_config()
  2366. File "/home/pi/klipper/klippy/klippy.py", line 145, in _read_config
  2367. pconfig.check_unused_options(config)
  2368. File "/home/pi/klipper/klippy/configfile.py", line 304, in check_unused_options
  2369. raise error("Option '%s' is not valid in section '%s'"
  2370. configparser.Error: Option 'position_endstop' is not valid in section 'stepper_z'
  2371. webhooks client 1964875368: New connection
  2372. webhooks client 1964875368: Client info {'program': 'Moonraker', 'version': 'v0.8.0-138-gfe12095'}
  2373. Attempting MCU 'mcu' reset
  2374. Unhandled exception during post run
  2375. Traceback (most recent call last):
  2376. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 265, in open
  2377. self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
  2378. FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00'
  2379.  
  2380. During handling of the above exception, another exception occurred:
  2381.  
  2382. Traceback (most recent call last):
  2383. File "/home/pi/klipper/klippy/klippy.py", line 234, in run
  2384. self.send_event("klippy:firmware_restart")
  2385. File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event
  2386. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  2387. File "/home/pi/klipper/klippy/klippy.py", line 263, in <listcomp>
  2388. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  2389. File "/home/pi/klipper/klippy/mcu.py", line 949, in _firmware_restart
  2390. self._restart_arduino()
  2391. File "/home/pi/klipper/klippy/mcu.py", line 909, in _restart_arduino
  2392. serialhdl.arduino_reset(self._serialport, self._reactor)
  2393. File "/home/pi/klipper/klippy/serialhdl.py", line 379, in arduino_reset
  2394. ser = serial.Serial(serialport, 2400, timeout=0, exclusive=True)
  2395. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialutil.py", line 240, in __init__
  2396. self.open()
  2397. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 268, in open
  2398. raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
  2399. serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00'
  2400. Restarting printer
  2401. Start printer at Mon Sep 11 13:38:59 2023 (1694464739.8 8768.0)
  2402. ===== Config file =====
  2403. [virtual_sdcard]
  2404. path = ~/printer_data/gcodes
  2405. on_error_gcode = CANCEL_PRINT
  2406.  
  2407. [pause_resume]
  2408.  
  2409. [display_status]
  2410.  
  2411. [respond]
  2412.  
  2413. [gcode_macro CANCEL_PRINT]
  2414. description = Cancel the actual running print
  2415. rename_existing = CANCEL_PRINT_BASE
  2416. gcode =
  2417.  
  2418. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2419. {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
  2420. {% set retract = client.cancel_retract|default(5.0)|abs %}
  2421.  
  2422. {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
  2423. else "X=" ~ client.park_at_cancel_x %}
  2424. {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
  2425. else "Y=" ~ client.park_at_cancel_y %}
  2426. {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
  2427.  
  2428.  
  2429. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  2430. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  2431. {% endif %}
  2432. {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %}
  2433. _CLIENT_RETRACT LENGTH={retract}
  2434. TURN_OFF_HEATERS
  2435. M106 S0
  2436.  
  2437. SET_PAUSE_NEXT_LAYER ENABLE=0
  2438. SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0
  2439. CANCEL_PRINT_BASE
  2440.  
  2441. [gcode_macro PAUSE]
  2442. description = Pause the actual running print
  2443. rename_existing = PAUSE_BASE
  2444. variable_restore_idle_timeout = 0
  2445. gcode =
  2446.  
  2447. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2448. {% set idle_timeout = client.idle_timeout|default(0) %}
  2449. {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
  2450. {% set restore = False if printer.toolhead.extruder == ''
  2451. else True if params.RESTORE|default(1)|int == 1 else False %}
  2452.  
  2453. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
  2454.  
  2455. {% if idle_timeout > 0 %}
  2456. SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
  2457. SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
  2458. {% endif %}
  2459. PAUSE_BASE
  2460. _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}
  2461.  
  2462. [gcode_macro RESUME]
  2463. description = Resume the actual running print
  2464. rename_existing = RESUME_BASE
  2465. variable_last_extruder_temp = {'restore': False, 'temp': 0}
  2466. gcode =
  2467.  
  2468. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2469. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  2470. {% set sp_move = client.speed_move|default(velocity) %}
  2471.  
  2472.  
  2473. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  2474. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  2475. {% endif %}
  2476. {% if printer.idle_timeout.state|upper == "IDLE" %}
  2477. {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
  2478. {% endif %}
  2479. _CLIENT_EXTRUDE
  2480. RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)}
  2481.  
  2482. [gcode_macro SET_PAUSE_NEXT_LAYER]
  2483. description = Enable a pause if the next layer is reached
  2484. gcode =
  2485. {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %}
  2486. {% set ENABLE = params.ENABLE|default(1)|int != 0 %}
  2487. {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %}
  2488. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}"
  2489.  
  2490. [gcode_macro SET_PAUSE_AT_LAYER]
  2491. description = Enable/disable a pause if a given layer number is reached
  2492. gcode =
  2493. {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %}
  2494. {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined
  2495. else params.LAYER is defined %}
  2496. {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %}
  2497. {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %}
  2498. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}"
  2499.  
  2500. [gcode_macro SET_PRINT_STATS_INFO]
  2501. rename_existing = SET_PRINT_STATS_INFO_BASE
  2502. description = Overwrite, to get pause_next_layer and pause_at_layer feature
  2503. variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" }
  2504. variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" }
  2505. gcode =
  2506. {% if pause_next_layer.enable %}
  2507. RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
  2508. {pause_next_layer.call}
  2509. SET_PAUSE_NEXT_LAYER ENABLE=0
  2510. {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
  2511. RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
  2512. {pause_at_layer.call}
  2513. SET_PAUSE_AT_LAYER ENABLE=0
  2514. {% endif %}
  2515. SET_PRINT_STATS_INFO_BASE {rawparams}
  2516.  
  2517. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  2518. description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
  2519. gcode =
  2520.  
  2521. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2522. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  2523. {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %}
  2524. {% set custom_park_x = client.custom_park_x|default(0.0) %}
  2525. {% set custom_park_y = client.custom_park_y|default(0.0) %}
  2526. {% set park_dz = client.custom_park_dz|default(2.0)|abs %}
  2527. {% set sp_hop = client.speed_hop|default(15) * 60 %}
  2528. {% set sp_move = client.speed_move|default(velocity) * 60 %}
  2529.  
  2530. {% set origin = printer.gcode_move.homing_origin %}
  2531. {% set act = printer.gcode_move.gcode_position %}
  2532. {% set max = printer.toolhead.axis_maximum %}
  2533. {% set cone = printer.toolhead.cone_start_z|default(max.z) %}
  2534. {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
  2535. else False %}
  2536.  
  2537. {% set z_min = params.Z_MIN|default(0)|float %}
  2538. {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
  2539. {% set x_park = params.X if params.X is defined
  2540. else custom_park_x if use_custom
  2541. else 0.0 if round_bed
  2542. else (max.x - 5.0) %}
  2543. {% set y_park = params.Y if params.Y is defined
  2544. else custom_park_y if use_custom
  2545. else (max.y - 5.0) if round_bed and z_park < cone
  2546. else 0.0 if round_bed
  2547. else (max.y - 5.0) %}
  2548.  
  2549. _CLIENT_RETRACT
  2550. {% if "xyz" in printer.toolhead.homed_axes %}
  2551. G90
  2552. G1 Z{z_park} F{sp_hop}
  2553. G1 X{x_park} Y{y_park} F{sp_move}
  2554. {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
  2555. {% else %}
  2556. RESPOND TYPE=echo MSG='Printer not homed'
  2557. {% endif %}
  2558.  
  2559. [gcode_macro _CLIENT_EXTRUDE]
  2560. description = Extrudes, if the extruder is hot enough
  2561. gcode =
  2562.  
  2563. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2564. {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
  2565. {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
  2566. {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
  2567. {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
  2568.  
  2569. {% if printer.toolhead.extruder != '' %}
  2570. {% if printer[printer.toolhead.extruder].can_extrude %}
  2571. {% if use_fw_retract %}
  2572. {% if length < 0 %}
  2573. G10
  2574. {% else %}
  2575. G11
  2576. {% endif %}
  2577. {% else %}
  2578. M83
  2579. G1 E{length} F{(speed|float|abs) * 60}
  2580. {% if absolute_extrude %}
  2581. M82
  2582. {% endif %}
  2583. {% endif %}
  2584. {% else %}
  2585. RESPOND TYPE=echo MSG='Extruder not hot enough'
  2586. {% endif %}
  2587. {% endif %}
  2588.  
  2589. [gcode_macro _CLIENT_RETRACT]
  2590. description = Retracts, if the extruder is hot enough
  2591. gcode =
  2592. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2593. {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
  2594. {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
  2595.  
  2596. _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
  2597.  
  2598. [stepper_x]
  2599. microsteps = 16
  2600. step_pin = P2.2
  2601. dir_pin = P2.6
  2602. enable_pin = !P2.1
  2603. rotation_distance = 40
  2604. endstop_pin = tmc2209_stepper_x:virtual_endstop
  2605. position_endstop = 0
  2606. position_max = 300
  2607. homing_speed = 20
  2608. homing_retract_dist = 0
  2609.  
  2610. [tmc2209 stepper_x]
  2611. uart_pin = P1.10
  2612. interpolate = True
  2613. run_current = 0.800
  2614. stealthchop_threshold = 999999
  2615. diag_pin = 1.29
  2616. driver_sgthrs = 255
  2617.  
  2618. [stepper_y]
  2619. microsteps = 16
  2620. step_pin = P0.19
  2621. dir_pin = P0.20
  2622. enable_pin = !P2.8
  2623. rotation_distance = 40
  2624. endstop_pin = tmc2209_stepper_y:virtual_endstop
  2625. position_endstop = 0
  2626. position_max = 300
  2627. homing_speed = 20
  2628. homing_retract_dist = 0
  2629.  
  2630. [tmc2209 stepper_y]
  2631. uart_pin = P1.9
  2632. interpolate = True
  2633. run_current = 0.800
  2634. stealthchop_threshold = 999999
  2635. diag_pin = 1.28
  2636. driver_sgthrs = 255
  2637.  
  2638. [stepper_z]
  2639. microsteps = 16
  2640. step_pin = P0.22
  2641. dir_pin = !P2.11
  2642. enable_pin = !P0.21
  2643. rotation_distance = 8
  2644. endstop_pin = probe:z_virtual_endstop
  2645. position_endstop = 0
  2646. position_min = -3.5
  2647. position_max = 400
  2648.  
  2649. [tmc2209 stepper_z]
  2650. uart_pin = P1.8
  2651. interpolate = True
  2652. run_current = 0.750
  2653. hold_current = 0.450
  2654. stealthchop_threshold = 999999
  2655.  
  2656. [stepper_z1]
  2657. microsteps = 16
  2658. step_pin = P1.15
  2659. dir_pin = !P1.14
  2660. enable_pin = !P1.16
  2661. rotation_distance = 8
  2662.  
  2663. [tmc2209 stepper_z1]
  2664. uart_pin = P1.1
  2665. interpolate = True
  2666. run_current = 0.750
  2667. hold_current = 0.450
  2668. stealthchop_threshold = 999999
  2669.  
  2670. [extruder]
  2671. microsteps = 16
  2672. step_pin = P2.13
  2673. dir_pin = P0.11
  2674. enable_pin = !P2.12
  2675. rotation_distance = 33.683
  2676. nozzle_diameter = 0.400
  2677. filament_diameter = 1.750
  2678. heater_pin = P2.7
  2679. sensor_type = EPCOS 100K B57560G104F
  2680. sensor_pin = P0.24
  2681. control = pid
  2682. pid_kp = 22.2
  2683. pid_ki = 1.72
  2684. pid_kd = 73.96
  2685. min_temp = 0
  2686. max_temp = 260
  2687. pressure_advance = 0.0
  2688. pressure_advance_smooth_time = 0.040
  2689.  
  2690. [tmc2209 extruder]
  2691. uart_pin = P1.4
  2692. interpolate = True
  2693. run_current = 0.600
  2694. hold_current = 0.500
  2695. stealthchop_threshold = 999999
  2696.  
  2697. [heater_bed]
  2698. heater_pin = P2.5
  2699. sensor_type = EPCOS 100K B57560G104F
  2700. sensor_pin = P0.25
  2701. control = pid
  2702. pid_kp = 54.027
  2703. pid_ki = 0.770
  2704. pid_kd = 948.182
  2705. min_temp = 0
  2706. max_temp = 130
  2707.  
  2708. [fan]
  2709. pin = P2.3
  2710.  
  2711. [mcu]
  2712. serial = /dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00
  2713. method = command
  2714.  
  2715. [printer]
  2716. kinematics = cartesian
  2717. max_velocity = 400
  2718. max_accel = 3000
  2719. max_z_velocity = 10
  2720. max_z_accel = 100
  2721.  
  2722. [z_tilt]
  2723. z_positions = -32, 179
  2724. 332, 179
  2725. points = 40, 179
  2726. 295, 179
  2727. speed = 50
  2728. horizontal_move_z = 5
  2729. retries = 10
  2730. retry_tolerance = 0.01
  2731.  
  2732. [gcode_arcs]
  2733. resolution = 1.0
  2734.  
  2735. [board_pins]
  2736. aliases =
  2737.  
  2738. EXP1_1=P1.30, EXP1_3=P1.18, EXP1_5=P1.20, EXP1_7=P1.22, EXP1_9=<GND>,
  2739. EXP1_2=P0.28, EXP1_4=P1.19, EXP1_6=P1.21, EXP1_8=P1.23, EXP1_10=<5V>,
  2740.  
  2741. EXP2_1=P0.17, EXP2_3=P3.26, EXP2_5=P3.25, EXP2_7=P1.31, EXP2_9=<GND>,
  2742. EXP2_2=P0.15, EXP2_4=P0.16, EXP2_6=P0.18, EXP2_8=<RST>, EXP2_10=<NC>
  2743.  
  2744. [display]
  2745. lcd_type = st7920
  2746. cs_pin = EXP1_4
  2747. sclk_pin = EXP1_5
  2748. sid_pin = EXP1_3
  2749. encoder_pins = ^EXP2_3, ^EXP2_5
  2750. click_pin = ^!EXP1_2
  2751.  
  2752. [output_pin beeper]
  2753. pin = EXP1_1
  2754.  
  2755. [probe]
  2756. pin = 1.27
  2757. x_offset = 48
  2758. y_offset = -2
  2759. speed = 5
  2760. samples = 2
  2761. lift_speed = 8
  2762.  
  2763. [safe_z_home]
  2764. home_xy_position = 102, 152
  2765. speed = 50.0
  2766. z_hop = 5
  2767. z_hop_speed = 10.0
  2768.  
  2769. [bed_mesh]
  2770. speed = 50
  2771. mesh_min = 48, 20
  2772. mesh_max = 280, 280
  2773. probe_count = 5, 5
  2774. =======================
  2775. Config error
  2776. Traceback (most recent call last):
  2777. File "/home/pi/klipper/klippy/klippy.py", line 175, in _connect
  2778. self._read_config()
  2779. File "/home/pi/klipper/klippy/klippy.py", line 141, in _read_config
  2780. self.load_object(config, section_config.get_name(), None)
  2781. File "/home/pi/klipper/klippy/klippy.py", line 130, in load_object
  2782. self.objects[section] = init_func(config.getsection(section))
  2783. File "/home/pi/klipper/klippy/extras/probe.py", line 458, in load_config
  2784. return PrinterProbe(config, ProbeEndstopWrapper(config))
  2785. File "/home/pi/klipper/klippy/extras/probe.py", line 298, in __init__
  2786. self.position_endstop = config.getfloat('z_offset')
  2787. File "/home/pi/klipper/klippy/configfile.py", line 65, in getfloat
  2788. return self._get_wrapper(self.fileconfig.getfloat, option, default,
  2789. File "/home/pi/klipper/klippy/configfile.py", line 32, in _get_wrapper
  2790. raise error("Option '%s' in section '%s' must be specified"
  2791. configparser.Error: Option 'z_offset' in section 'probe' must be specified
  2792. webhooks client 1963821112: New connection
  2793. webhooks client 1963821112: Client info {'program': 'Moonraker', 'version': 'v0.8.0-138-gfe12095'}
  2794. Attempting MCU 'mcu' reset
  2795. Unhandled exception during post run
  2796. Traceback (most recent call last):
  2797. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 265, in open
  2798. self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
  2799. FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00'
  2800.  
  2801. During handling of the above exception, another exception occurred:
  2802.  
  2803. Traceback (most recent call last):
  2804. File "/home/pi/klipper/klippy/klippy.py", line 234, in run
  2805. self.send_event("klippy:firmware_restart")
  2806. File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event
  2807. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  2808. File "/home/pi/klipper/klippy/klippy.py", line 263, in <listcomp>
  2809. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  2810. File "/home/pi/klipper/klippy/mcu.py", line 949, in _firmware_restart
  2811. self._restart_arduino()
  2812. File "/home/pi/klipper/klippy/mcu.py", line 909, in _restart_arduino
  2813. serialhdl.arduino_reset(self._serialport, self._reactor)
  2814. File "/home/pi/klipper/klippy/serialhdl.py", line 379, in arduino_reset
  2815. ser = serial.Serial(serialport, 2400, timeout=0, exclusive=True)
  2816. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialutil.py", line 240, in __init__
  2817. self.open()
  2818. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 268, in open
  2819. raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
  2820. serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00'
  2821. Restarting printer
  2822. Start printer at Mon Sep 11 13:39:32 2023 (1694464772.3 8800.4)
  2823. ===== Config file =====
  2824. [virtual_sdcard]
  2825. path = ~/printer_data/gcodes
  2826. on_error_gcode = CANCEL_PRINT
  2827.  
  2828. [pause_resume]
  2829.  
  2830. [display_status]
  2831.  
  2832. [respond]
  2833.  
  2834. [gcode_macro CANCEL_PRINT]
  2835. description = Cancel the actual running print
  2836. rename_existing = CANCEL_PRINT_BASE
  2837. gcode =
  2838.  
  2839. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2840. {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
  2841. {% set retract = client.cancel_retract|default(5.0)|abs %}
  2842.  
  2843. {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
  2844. else "X=" ~ client.park_at_cancel_x %}
  2845. {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
  2846. else "Y=" ~ client.park_at_cancel_y %}
  2847. {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
  2848.  
  2849.  
  2850. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  2851. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  2852. {% endif %}
  2853. {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %}
  2854. _CLIENT_RETRACT LENGTH={retract}
  2855. TURN_OFF_HEATERS
  2856. M106 S0
  2857.  
  2858. SET_PAUSE_NEXT_LAYER ENABLE=0
  2859. SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0
  2860. CANCEL_PRINT_BASE
  2861.  
  2862. [gcode_macro PAUSE]
  2863. description = Pause the actual running print
  2864. rename_existing = PAUSE_BASE
  2865. variable_restore_idle_timeout = 0
  2866. gcode =
  2867.  
  2868. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2869. {% set idle_timeout = client.idle_timeout|default(0) %}
  2870. {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
  2871. {% set restore = False if printer.toolhead.extruder == ''
  2872. else True if params.RESTORE|default(1)|int == 1 else False %}
  2873.  
  2874. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
  2875.  
  2876. {% if idle_timeout > 0 %}
  2877. SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
  2878. SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
  2879. {% endif %}
  2880. PAUSE_BASE
  2881. _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}
  2882.  
  2883. [gcode_macro RESUME]
  2884. description = Resume the actual running print
  2885. rename_existing = RESUME_BASE
  2886. variable_last_extruder_temp = {'restore': False, 'temp': 0}
  2887. gcode =
  2888.  
  2889. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2890. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  2891. {% set sp_move = client.speed_move|default(velocity) %}
  2892.  
  2893.  
  2894. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  2895. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  2896. {% endif %}
  2897. {% if printer.idle_timeout.state|upper == "IDLE" %}
  2898. {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
  2899. {% endif %}
  2900. _CLIENT_EXTRUDE
  2901. RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)}
  2902.  
  2903. [gcode_macro SET_PAUSE_NEXT_LAYER]
  2904. description = Enable a pause if the next layer is reached
  2905. gcode =
  2906. {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %}
  2907. {% set ENABLE = params.ENABLE|default(1)|int != 0 %}
  2908. {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %}
  2909. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}"
  2910.  
  2911. [gcode_macro SET_PAUSE_AT_LAYER]
  2912. description = Enable/disable a pause if a given layer number is reached
  2913. gcode =
  2914. {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %}
  2915. {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined
  2916. else params.LAYER is defined %}
  2917. {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %}
  2918. {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %}
  2919. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}"
  2920.  
  2921. [gcode_macro SET_PRINT_STATS_INFO]
  2922. rename_existing = SET_PRINT_STATS_INFO_BASE
  2923. description = Overwrite, to get pause_next_layer and pause_at_layer feature
  2924. variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" }
  2925. variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" }
  2926. gcode =
  2927. {% if pause_next_layer.enable %}
  2928. RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
  2929. {pause_next_layer.call}
  2930. SET_PAUSE_NEXT_LAYER ENABLE=0
  2931. {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
  2932. RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
  2933. {pause_at_layer.call}
  2934. SET_PAUSE_AT_LAYER ENABLE=0
  2935. {% endif %}
  2936. SET_PRINT_STATS_INFO_BASE {rawparams}
  2937.  
  2938. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  2939. description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
  2940. gcode =
  2941.  
  2942. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2943. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  2944. {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %}
  2945. {% set custom_park_x = client.custom_park_x|default(0.0) %}
  2946. {% set custom_park_y = client.custom_park_y|default(0.0) %}
  2947. {% set park_dz = client.custom_park_dz|default(2.0)|abs %}
  2948. {% set sp_hop = client.speed_hop|default(15) * 60 %}
  2949. {% set sp_move = client.speed_move|default(velocity) * 60 %}
  2950.  
  2951. {% set origin = printer.gcode_move.homing_origin %}
  2952. {% set act = printer.gcode_move.gcode_position %}
  2953. {% set max = printer.toolhead.axis_maximum %}
  2954. {% set cone = printer.toolhead.cone_start_z|default(max.z) %}
  2955. {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
  2956. else False %}
  2957.  
  2958. {% set z_min = params.Z_MIN|default(0)|float %}
  2959. {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
  2960. {% set x_park = params.X if params.X is defined
  2961. else custom_park_x if use_custom
  2962. else 0.0 if round_bed
  2963. else (max.x - 5.0) %}
  2964. {% set y_park = params.Y if params.Y is defined
  2965. else custom_park_y if use_custom
  2966. else (max.y - 5.0) if round_bed and z_park < cone
  2967. else 0.0 if round_bed
  2968. else (max.y - 5.0) %}
  2969.  
  2970. _CLIENT_RETRACT
  2971. {% if "xyz" in printer.toolhead.homed_axes %}
  2972. G90
  2973. G1 Z{z_park} F{sp_hop}
  2974. G1 X{x_park} Y{y_park} F{sp_move}
  2975. {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
  2976. {% else %}
  2977. RESPOND TYPE=echo MSG='Printer not homed'
  2978. {% endif %}
  2979.  
  2980. [gcode_macro _CLIENT_EXTRUDE]
  2981. description = Extrudes, if the extruder is hot enough
  2982. gcode =
  2983.  
  2984. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  2985. {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
  2986. {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
  2987. {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
  2988. {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
  2989.  
  2990. {% if printer.toolhead.extruder != '' %}
  2991. {% if printer[printer.toolhead.extruder].can_extrude %}
  2992. {% if use_fw_retract %}
  2993. {% if length < 0 %}
  2994. G10
  2995. {% else %}
  2996. G11
  2997. {% endif %}
  2998. {% else %}
  2999. M83
  3000. G1 E{length} F{(speed|float|abs) * 60}
  3001. {% if absolute_extrude %}
  3002. M82
  3003. {% endif %}
  3004. {% endif %}
  3005. {% else %}
  3006. RESPOND TYPE=echo MSG='Extruder not hot enough'
  3007. {% endif %}
  3008. {% endif %}
  3009.  
  3010. [gcode_macro _CLIENT_RETRACT]
  3011. description = Retracts, if the extruder is hot enough
  3012. gcode =
  3013. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  3014. {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
  3015. {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
  3016.  
  3017. _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
  3018.  
  3019. [stepper_x]
  3020. microsteps = 16
  3021. step_pin = P2.2
  3022. dir_pin = P2.6
  3023. enable_pin = !P2.1
  3024. rotation_distance = 40
  3025. endstop_pin = tmc2209_stepper_x:virtual_endstop
  3026. position_endstop = 0
  3027. position_max = 300
  3028. homing_speed = 20
  3029. homing_retract_dist = 0
  3030.  
  3031. [tmc2209 stepper_x]
  3032. uart_pin = P1.10
  3033. interpolate = True
  3034. run_current = 0.800
  3035. stealthchop_threshold = 999999
  3036. diag_pin = 1.29
  3037. driver_sgthrs = 255
  3038.  
  3039. [stepper_y]
  3040. microsteps = 16
  3041. step_pin = P0.19
  3042. dir_pin = P0.20
  3043. enable_pin = !P2.8
  3044. rotation_distance = 40
  3045. endstop_pin = tmc2209_stepper_y:virtual_endstop
  3046. position_endstop = 0
  3047. position_max = 300
  3048. homing_speed = 20
  3049. homing_retract_dist = 0
  3050.  
  3051. [tmc2209 stepper_y]
  3052. uart_pin = P1.9
  3053. interpolate = True
  3054. run_current = 0.800
  3055. stealthchop_threshold = 999999
  3056. diag_pin = 1.28
  3057. driver_sgthrs = 255
  3058.  
  3059. [stepper_z]
  3060. microsteps = 16
  3061. step_pin = P0.22
  3062. dir_pin = !P2.11
  3063. enable_pin = !P0.21
  3064. rotation_distance = 8
  3065. endstop_pin = probe:z_virtual_endstop
  3066. position_endstop = 0
  3067. position_min = -3.5
  3068. position_max = 400
  3069.  
  3070. [tmc2209 stepper_z]
  3071. uart_pin = P1.8
  3072. interpolate = True
  3073. run_current = 0.750
  3074. hold_current = 0.450
  3075. stealthchop_threshold = 999999
  3076.  
  3077. [stepper_z1]
  3078. microsteps = 16
  3079. step_pin = P1.15
  3080. dir_pin = !P1.14
  3081. enable_pin = !P1.16
  3082. rotation_distance = 8
  3083.  
  3084. [tmc2209 stepper_z1]
  3085. uart_pin = P1.1
  3086. interpolate = True
  3087. run_current = 0.750
  3088. hold_current = 0.450
  3089. stealthchop_threshold = 999999
  3090.  
  3091. [extruder]
  3092. microsteps = 16
  3093. step_pin = P2.13
  3094. dir_pin = P0.11
  3095. enable_pin = !P2.12
  3096. rotation_distance = 33.683
  3097. nozzle_diameter = 0.400
  3098. filament_diameter = 1.750
  3099. heater_pin = P2.7
  3100. sensor_type = EPCOS 100K B57560G104F
  3101. sensor_pin = P0.24
  3102. control = pid
  3103. pid_kp = 22.2
  3104. pid_ki = 1.72
  3105. pid_kd = 73.96
  3106. min_temp = 0
  3107. max_temp = 260
  3108. pressure_advance = 0.0
  3109. pressure_advance_smooth_time = 0.040
  3110.  
  3111. [tmc2209 extruder]
  3112. uart_pin = P1.4
  3113. interpolate = True
  3114. run_current = 0.600
  3115. hold_current = 0.500
  3116. stealthchop_threshold = 999999
  3117.  
  3118. [heater_bed]
  3119. heater_pin = P2.5
  3120. sensor_type = EPCOS 100K B57560G104F
  3121. sensor_pin = P0.25
  3122. control = pid
  3123. pid_kp = 54.027
  3124. pid_ki = 0.770
  3125. pid_kd = 948.182
  3126. min_temp = 0
  3127. max_temp = 130
  3128.  
  3129. [fan]
  3130. pin = P2.3
  3131.  
  3132. [mcu]
  3133. serial = /dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00
  3134. method = command
  3135.  
  3136. [printer]
  3137. kinematics = cartesian
  3138. max_velocity = 400
  3139. max_accel = 3000
  3140. max_z_velocity = 10
  3141. max_z_accel = 100
  3142.  
  3143. [z_tilt]
  3144. z_positions = -32, 179
  3145. 332, 179
  3146. points = 40, 179
  3147. 295, 179
  3148. speed = 50
  3149. horizontal_move_z = 5
  3150. retries = 10
  3151. retry_tolerance = 0.01
  3152.  
  3153. [gcode_arcs]
  3154. resolution = 1.0
  3155.  
  3156. [board_pins]
  3157. aliases =
  3158.  
  3159. EXP1_1=P1.30, EXP1_3=P1.18, EXP1_5=P1.20, EXP1_7=P1.22, EXP1_9=<GND>,
  3160. EXP1_2=P0.28, EXP1_4=P1.19, EXP1_6=P1.21, EXP1_8=P1.23, EXP1_10=<5V>,
  3161.  
  3162. EXP2_1=P0.17, EXP2_3=P3.26, EXP2_5=P3.25, EXP2_7=P1.31, EXP2_9=<GND>,
  3163. EXP2_2=P0.15, EXP2_4=P0.16, EXP2_6=P0.18, EXP2_8=<RST>, EXP2_10=<NC>
  3164.  
  3165. [display]
  3166. lcd_type = st7920
  3167. cs_pin = EXP1_4
  3168. sclk_pin = EXP1_5
  3169. sid_pin = EXP1_3
  3170. encoder_pins = ^EXP2_3, ^EXP2_5
  3171. click_pin = ^!EXP1_2
  3172.  
  3173. [output_pin beeper]
  3174. pin = EXP1_1
  3175.  
  3176. [probe]
  3177. pin = 1.27
  3178. x_offset = 48
  3179. y_offset = -2
  3180. z_offset = 1
  3181. speed = 5
  3182. samples = 2
  3183. lift_speed = 8
  3184.  
  3185. [safe_z_home]
  3186. home_xy_position = 102, 152
  3187. speed = 50.0
  3188. z_hop = 5
  3189. z_hop_speed = 10.0
  3190.  
  3191. [bed_mesh]
  3192. speed = 50
  3193. mesh_min = 48, 20
  3194. mesh_max = 280, 280
  3195. probe_count = 5, 5
  3196. =======================
  3197. Extruder max_extrude_ratio=0.266081
  3198. Config error
  3199. Traceback (most recent call last):
  3200. File "/home/pi/klipper/klippy/klippy.py", line 175, in _connect
  3201. self._read_config()
  3202. File "/home/pi/klipper/klippy/klippy.py", line 145, in _read_config
  3203. pconfig.check_unused_options(config)
  3204. File "/home/pi/klipper/klippy/configfile.py", line 304, in check_unused_options
  3205. raise error("Option '%s' is not valid in section '%s'"
  3206. configparser.Error: Option 'position_endstop' is not valid in section 'stepper_z'
  3207. webhooks client 1964200024: New connection
  3208. webhooks client 1964200024: Client info {'program': 'Moonraker', 'version': 'v0.8.0-138-gfe12095'}
  3209. Attempting MCU 'mcu' reset
  3210. Unhandled exception during post run
  3211. Traceback (most recent call last):
  3212. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 265, in open
  3213. self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
  3214. FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00'
  3215.  
  3216. During handling of the above exception, another exception occurred:
  3217.  
  3218. Traceback (most recent call last):
  3219. File "/home/pi/klipper/klippy/klippy.py", line 234, in run
  3220. self.send_event("klippy:firmware_restart")
  3221. File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event
  3222. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  3223. File "/home/pi/klipper/klippy/klippy.py", line 263, in <listcomp>
  3224. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  3225. File "/home/pi/klipper/klippy/mcu.py", line 949, in _firmware_restart
  3226. self._restart_arduino()
  3227. File "/home/pi/klipper/klippy/mcu.py", line 909, in _restart_arduino
  3228. serialhdl.arduino_reset(self._serialport, self._reactor)
  3229. File "/home/pi/klipper/klippy/serialhdl.py", line 379, in arduino_reset
  3230. ser = serial.Serial(serialport, 2400, timeout=0, exclusive=True)
  3231. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialutil.py", line 240, in __init__
  3232. self.open()
  3233. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 268, in open
  3234. raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
  3235. serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00'
  3236. Restarting printer
  3237. Start printer at Mon Sep 11 13:41:17 2023 (1694464877.2 8905.4)
  3238. ===== Config file =====
  3239. [virtual_sdcard]
  3240. path = ~/printer_data/gcodes
  3241. on_error_gcode = CANCEL_PRINT
  3242.  
  3243. [pause_resume]
  3244.  
  3245. [display_status]
  3246.  
  3247. [respond]
  3248.  
  3249. [gcode_macro CANCEL_PRINT]
  3250. description = Cancel the actual running print
  3251. rename_existing = CANCEL_PRINT_BASE
  3252. gcode =
  3253.  
  3254. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  3255. {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
  3256. {% set retract = client.cancel_retract|default(5.0)|abs %}
  3257.  
  3258. {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
  3259. else "X=" ~ client.park_at_cancel_x %}
  3260. {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
  3261. else "Y=" ~ client.park_at_cancel_y %}
  3262. {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
  3263.  
  3264.  
  3265. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  3266. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  3267. {% endif %}
  3268. {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %}
  3269. _CLIENT_RETRACT LENGTH={retract}
  3270. TURN_OFF_HEATERS
  3271. M106 S0
  3272.  
  3273. SET_PAUSE_NEXT_LAYER ENABLE=0
  3274. SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0
  3275. CANCEL_PRINT_BASE
  3276.  
  3277. [gcode_macro PAUSE]
  3278. description = Pause the actual running print
  3279. rename_existing = PAUSE_BASE
  3280. variable_restore_idle_timeout = 0
  3281. gcode =
  3282.  
  3283. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  3284. {% set idle_timeout = client.idle_timeout|default(0) %}
  3285. {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
  3286. {% set restore = False if printer.toolhead.extruder == ''
  3287. else True if params.RESTORE|default(1)|int == 1 else False %}
  3288.  
  3289. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
  3290.  
  3291. {% if idle_timeout > 0 %}
  3292. SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
  3293. SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
  3294. {% endif %}
  3295. PAUSE_BASE
  3296. _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}
  3297.  
  3298. [gcode_macro RESUME]
  3299. description = Resume the actual running print
  3300. rename_existing = RESUME_BASE
  3301. variable_last_extruder_temp = {'restore': False, 'temp': 0}
  3302. gcode =
  3303.  
  3304. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  3305. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  3306. {% set sp_move = client.speed_move|default(velocity) %}
  3307.  
  3308.  
  3309. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  3310. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  3311. {% endif %}
  3312. {% if printer.idle_timeout.state|upper == "IDLE" %}
  3313. {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
  3314. {% endif %}
  3315. _CLIENT_EXTRUDE
  3316. RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)}
  3317.  
  3318. [gcode_macro SET_PAUSE_NEXT_LAYER]
  3319. description = Enable a pause if the next layer is reached
  3320. gcode =
  3321. {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %}
  3322. {% set ENABLE = params.ENABLE|default(1)|int != 0 %}
  3323. {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %}
  3324. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}"
  3325.  
  3326. [gcode_macro SET_PAUSE_AT_LAYER]
  3327. description = Enable/disable a pause if a given layer number is reached
  3328. gcode =
  3329. {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %}
  3330. {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined
  3331. else params.LAYER is defined %}
  3332. {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %}
  3333. {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %}
  3334. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}"
  3335.  
  3336. [gcode_macro SET_PRINT_STATS_INFO]
  3337. rename_existing = SET_PRINT_STATS_INFO_BASE
  3338. description = Overwrite, to get pause_next_layer and pause_at_layer feature
  3339. variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" }
  3340. variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" }
  3341. gcode =
  3342. {% if pause_next_layer.enable %}
  3343. RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
  3344. {pause_next_layer.call}
  3345. SET_PAUSE_NEXT_LAYER ENABLE=0
  3346. {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
  3347. RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
  3348. {pause_at_layer.call}
  3349. SET_PAUSE_AT_LAYER ENABLE=0
  3350. {% endif %}
  3351. SET_PRINT_STATS_INFO_BASE {rawparams}
  3352.  
  3353. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  3354. description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
  3355. gcode =
  3356.  
  3357. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  3358. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  3359. {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %}
  3360. {% set custom_park_x = client.custom_park_x|default(0.0) %}
  3361. {% set custom_park_y = client.custom_park_y|default(0.0) %}
  3362. {% set park_dz = client.custom_park_dz|default(2.0)|abs %}
  3363. {% set sp_hop = client.speed_hop|default(15) * 60 %}
  3364. {% set sp_move = client.speed_move|default(velocity) * 60 %}
  3365.  
  3366. {% set origin = printer.gcode_move.homing_origin %}
  3367. {% set act = printer.gcode_move.gcode_position %}
  3368. {% set max = printer.toolhead.axis_maximum %}
  3369. {% set cone = printer.toolhead.cone_start_z|default(max.z) %}
  3370. {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
  3371. else False %}
  3372.  
  3373. {% set z_min = params.Z_MIN|default(0)|float %}
  3374. {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
  3375. {% set x_park = params.X if params.X is defined
  3376. else custom_park_x if use_custom
  3377. else 0.0 if round_bed
  3378. else (max.x - 5.0) %}
  3379. {% set y_park = params.Y if params.Y is defined
  3380. else custom_park_y if use_custom
  3381. else (max.y - 5.0) if round_bed and z_park < cone
  3382. else 0.0 if round_bed
  3383. else (max.y - 5.0) %}
  3384.  
  3385. _CLIENT_RETRACT
  3386. {% if "xyz" in printer.toolhead.homed_axes %}
  3387. G90
  3388. G1 Z{z_park} F{sp_hop}
  3389. G1 X{x_park} Y{y_park} F{sp_move}
  3390. {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
  3391. {% else %}
  3392. RESPOND TYPE=echo MSG='Printer not homed'
  3393. {% endif %}
  3394.  
  3395. [gcode_macro _CLIENT_EXTRUDE]
  3396. description = Extrudes, if the extruder is hot enough
  3397. gcode =
  3398.  
  3399. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  3400. {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
  3401. {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
  3402. {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
  3403. {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
  3404.  
  3405. {% if printer.toolhead.extruder != '' %}
  3406. {% if printer[printer.toolhead.extruder].can_extrude %}
  3407. {% if use_fw_retract %}
  3408. {% if length < 0 %}
  3409. G10
  3410. {% else %}
  3411. G11
  3412. {% endif %}
  3413. {% else %}
  3414. M83
  3415. G1 E{length} F{(speed|float|abs) * 60}
  3416. {% if absolute_extrude %}
  3417. M82
  3418. {% endif %}
  3419. {% endif %}
  3420. {% else %}
  3421. RESPOND TYPE=echo MSG='Extruder not hot enough'
  3422. {% endif %}
  3423. {% endif %}
  3424.  
  3425. [gcode_macro _CLIENT_RETRACT]
  3426. description = Retracts, if the extruder is hot enough
  3427. gcode =
  3428. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  3429. {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
  3430. {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
  3431.  
  3432. _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
  3433.  
  3434. [stepper_x]
  3435. microsteps = 16
  3436. step_pin = P2.2
  3437. dir_pin = P2.6
  3438. enable_pin = !P2.1
  3439. rotation_distance = 40
  3440. endstop_pin = tmc2209_stepper_x:virtual_endstop
  3441. position_endstop = 0
  3442. position_max = 300
  3443. homing_speed = 20
  3444. homing_retract_dist = 0
  3445.  
  3446. [tmc2209 stepper_x]
  3447. uart_pin = P1.10
  3448. interpolate = True
  3449. run_current = 0.800
  3450. stealthchop_threshold = 999999
  3451. diag_pin = 1.29
  3452. driver_sgthrs = 255
  3453.  
  3454. [stepper_y]
  3455. microsteps = 16
  3456. step_pin = P0.19
  3457. dir_pin = P0.20
  3458. enable_pin = !P2.8
  3459. rotation_distance = 40
  3460. endstop_pin = tmc2209_stepper_y:virtual_endstop
  3461. position_endstop = 0
  3462. position_max = 300
  3463. homing_speed = 20
  3464. homing_retract_dist = 0
  3465.  
  3466. [tmc2209 stepper_y]
  3467. uart_pin = P1.9
  3468. interpolate = True
  3469. run_current = 0.800
  3470. stealthchop_threshold = 999999
  3471. diag_pin = 1.28
  3472. driver_sgthrs = 255
  3473.  
  3474. [stepper_z]
  3475. microsteps = 16
  3476. step_pin = P0.22
  3477. dir_pin = !P2.11
  3478. enable_pin = !P0.21
  3479. rotation_distance = 8
  3480. position_endstop = 0
  3481. position_min = -3.5
  3482. position_max = 400
  3483.  
  3484. [tmc2209 stepper_z]
  3485. uart_pin = P1.8
  3486. interpolate = True
  3487. run_current = 0.750
  3488. hold_current = 0.450
  3489. stealthchop_threshold = 999999
  3490.  
  3491. [stepper_z1]
  3492. microsteps = 16
  3493. step_pin = P1.15
  3494. dir_pin = !P1.14
  3495. enable_pin = !P1.16
  3496. rotation_distance = 8
  3497.  
  3498. [tmc2209 stepper_z1]
  3499. uart_pin = P1.1
  3500. interpolate = True
  3501. run_current = 0.750
  3502. hold_current = 0.450
  3503. stealthchop_threshold = 999999
  3504.  
  3505. [extruder]
  3506. microsteps = 16
  3507. step_pin = P2.13
  3508. dir_pin = P0.11
  3509. enable_pin = !P2.12
  3510. rotation_distance = 33.683
  3511. nozzle_diameter = 0.400
  3512. filament_diameter = 1.750
  3513. heater_pin = P2.7
  3514. sensor_type = EPCOS 100K B57560G104F
  3515. sensor_pin = P0.24
  3516. control = pid
  3517. pid_kp = 22.2
  3518. pid_ki = 1.72
  3519. pid_kd = 73.96
  3520. min_temp = 0
  3521. max_temp = 260
  3522. pressure_advance = 0.0
  3523. pressure_advance_smooth_time = 0.040
  3524.  
  3525. [tmc2209 extruder]
  3526. uart_pin = P1.4
  3527. interpolate = True
  3528. run_current = 0.600
  3529. hold_current = 0.500
  3530. stealthchop_threshold = 999999
  3531.  
  3532. [heater_bed]
  3533. heater_pin = P2.5
  3534. sensor_type = EPCOS 100K B57560G104F
  3535. sensor_pin = P0.25
  3536. control = pid
  3537. pid_kp = 54.027
  3538. pid_ki = 0.770
  3539. pid_kd = 948.182
  3540. min_temp = 0
  3541. max_temp = 130
  3542.  
  3543. [fan]
  3544. pin = P2.3
  3545.  
  3546. [mcu]
  3547. serial = /dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00
  3548. method = command
  3549.  
  3550. [printer]
  3551. kinematics = cartesian
  3552. max_velocity = 400
  3553. max_accel = 3000
  3554. max_z_velocity = 10
  3555. max_z_accel = 100
  3556.  
  3557. [z_tilt]
  3558. z_positions = -32, 179
  3559. 332, 179
  3560. points = 40, 179
  3561. 295, 179
  3562. speed = 50
  3563. horizontal_move_z = 5
  3564. retries = 10
  3565. retry_tolerance = 0.01
  3566.  
  3567. [gcode_arcs]
  3568. resolution = 1.0
  3569.  
  3570. [board_pins]
  3571. aliases =
  3572.  
  3573. EXP1_1=P1.30, EXP1_3=P1.18, EXP1_5=P1.20, EXP1_7=P1.22, EXP1_9=<GND>,
  3574. EXP1_2=P0.28, EXP1_4=P1.19, EXP1_6=P1.21, EXP1_8=P1.23, EXP1_10=<5V>,
  3575.  
  3576. EXP2_1=P0.17, EXP2_3=P3.26, EXP2_5=P3.25, EXP2_7=P1.31, EXP2_9=<GND>,
  3577. EXP2_2=P0.15, EXP2_4=P0.16, EXP2_6=P0.18, EXP2_8=<RST>, EXP2_10=<NC>
  3578.  
  3579. [display]
  3580. lcd_type = st7920
  3581. cs_pin = EXP1_4
  3582. sclk_pin = EXP1_5
  3583. sid_pin = EXP1_3
  3584. encoder_pins = ^EXP2_3, ^EXP2_5
  3585. click_pin = ^!EXP1_2
  3586.  
  3587. [output_pin beeper]
  3588. pin = EXP1_1
  3589.  
  3590. [probe]
  3591. pin = 1.27
  3592. x_offset = 48
  3593. y_offset = -2
  3594. z_offset = 1
  3595. speed = 5
  3596. samples = 2
  3597. lift_speed = 8
  3598.  
  3599. [safe_z_home]
  3600. home_xy_position = 102, 152
  3601. speed = 50.0
  3602. z_hop = 5
  3603. z_hop_speed = 10.0
  3604.  
  3605. [bed_mesh]
  3606. speed = 50
  3607. mesh_min = 48, 20
  3608. mesh_max = 280, 280
  3609. probe_count = 5, 5
  3610. =======================
  3611. Config error
  3612. Traceback (most recent call last):
  3613. File "/home/pi/klipper/klippy/klippy.py", line 175, in _connect
  3614. self._read_config()
  3615. File "/home/pi/klipper/klippy/klippy.py", line 143, in _read_config
  3616. m.add_printer_objects(config)
  3617. File "/home/pi/klipper/klippy/toolhead.py", line 606, in add_printer_objects
  3618. config.get_printer().add_object('toolhead', ToolHead(config))
  3619. File "/home/pi/klipper/klippy/toolhead.py", line 257, in __init__
  3620. self.kin = mod.load_kinematics(self, config)
  3621. File "/home/pi/klipper/klippy/kinematics/cartesian.py", line 126, in load_kinematics
  3622. return CartKinematics(toolhead, config)
  3623. File "/home/pi/klipper/klippy/kinematics/cartesian.py", line 16, in __init__
  3624. self.rails = [stepper.LookupMultiRail(config.getsection('stepper_' + n))
  3625. File "/home/pi/klipper/klippy/kinematics/cartesian.py", line 16, in <listcomp>
  3626. self.rails = [stepper.LookupMultiRail(config.getsection('stepper_' + n))
  3627. File "/home/pi/klipper/klippy/stepper.py", line 423, in LookupMultiRail
  3628. rail = PrinterRail(config, need_position_minmax,
  3629. File "/home/pi/klipper/klippy/stepper.py", line 304, in __init__
  3630. self.add_extra_stepper(config)
  3631. File "/home/pi/klipper/klippy/stepper.py", line 380, in add_extra_stepper
  3632. endstop_pin = config.get('endstop_pin')
  3633. File "/home/pi/klipper/klippy/configfile.py", line 57, in get
  3634. return self._get_wrapper(self.fileconfig.get, option, default,
  3635. File "/home/pi/klipper/klippy/configfile.py", line 32, in _get_wrapper
  3636. raise error("Option '%s' in section '%s' must be specified"
  3637. configparser.Error: Option 'endstop_pin' in section 'stepper_z' must be specified
  3638. webhooks client 1963819768: New connection
  3639. webhooks client 1963819768: Client info {'program': 'Moonraker', 'version': 'v0.8.0-138-gfe12095'}
  3640. Attempting MCU 'mcu' reset
  3641. Unhandled exception during post run
  3642. Traceback (most recent call last):
  3643. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 265, in open
  3644. self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
  3645. FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00'
  3646.  
  3647. During handling of the above exception, another exception occurred:
  3648.  
  3649. Traceback (most recent call last):
  3650. File "/home/pi/klipper/klippy/klippy.py", line 234, in run
  3651. self.send_event("klippy:firmware_restart")
  3652. File "/home/pi/klipper/klippy/klippy.py", line 263, in send_event
  3653. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  3654. File "/home/pi/klipper/klippy/klippy.py", line 263, in <listcomp>
  3655. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  3656. File "/home/pi/klipper/klippy/mcu.py", line 949, in _firmware_restart
  3657. self._restart_arduino()
  3658. File "/home/pi/klipper/klippy/mcu.py", line 909, in _restart_arduino
  3659. serialhdl.arduino_reset(self._serialport, self._reactor)
  3660. File "/home/pi/klipper/klippy/serialhdl.py", line 379, in arduino_reset
  3661. ser = serial.Serial(serialport, 2400, timeout=0, exclusive=True)
  3662. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialutil.py", line 240, in __init__
  3663. self.open()
  3664. File "/home/pi/klippy-env/lib/python3.9/site-packages/serial/serialposix.py", line 268, in open
  3665. raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
  3666. serial.serialutil.SerialException: [Errno 2] could not open port /dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-Klipper_lpc1769_0F000002C0846AAF31A7555EC72000F5-if00/dev/serial/by-id/usb-Klipper_lpc1769_1360000DA69869AF6441415EC52000F5-if00'
  3667. Restarting printer
  3668. Start printer at Mon Sep 11 13:42:31 2023 (1694464952.0 8980.1)
  3669. ===== Config file =====
  3670. [virtual_sdcard]
  3671. path = ~/printer_data/gcodes
  3672. on_error_gcode = CANCEL_PRINT
  3673.  
  3674. [pause_resume]
  3675.  
  3676. [display_status]
  3677.  
  3678. [respond]
  3679.  
  3680. [gcode_macro CANCEL_PRINT]
  3681. description = Cancel the actual running print
  3682. rename_existing = CANCEL_PRINT_BASE
  3683. gcode =
  3684.  
  3685. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  3686. {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
  3687. {% set retract = client.cancel_retract|default(5.0)|abs %}
  3688.  
  3689. {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
  3690. else "X=" ~ client.park_at_cancel_x %}
  3691. {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
  3692. else "Y=" ~ client.park_at_cancel_y %}
  3693. {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
  3694.  
  3695.  
  3696. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  3697. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  3698. {% endif %}
  3699. {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %}
  3700. _CLIENT_RETRACT LENGTH={retract}
  3701. TURN_OFF_HEATERS
  3702. M106 S0
  3703.  
  3704. SET_PAUSE_NEXT_LAYER ENABLE=0
  3705. SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0
  3706. CANCEL_PRINT_BASE
  3707.  
  3708. [gcode_macro PAUSE]
  3709. description = Pause the actual running print
  3710. rename_existing = PAUSE_BASE
  3711. variable_restore_idle_timeout = 0
  3712. gcode =
  3713.  
  3714. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  3715. {% set idle_timeout = client.idle_timeout|default(0) %}
  3716. {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0%}
  3717. {% set restore = False if printer.toolhead.extruder == ''
  3718. else True if params.RESTORE|default(1)|int == 1 else False %}
  3719.  
  3720. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
  3721.  
  3722. {% if idle_timeout > 0 %}
  3723. SET_GCODE_VARIABLE MACRO=PAUSE VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
  3724. SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
  3725. {% endif %}
  3726. PAUSE_BASE
  3727. _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}
  3728.  
  3729. [gcode_macro RESUME]
  3730. description = Resume the actual running print
  3731. rename_existing = RESUME_BASE
  3732. variable_last_extruder_temp = {'restore': False, 'temp': 0}
  3733. gcode =
  3734.  
  3735. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  3736. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  3737. {% set sp_move = client.speed_move|default(velocity) %}
  3738.  
  3739.  
  3740. {% if printer['gcode_macro PAUSE'].restore_idle_timeout > 0 %}
  3741. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro PAUSE'].restore_idle_timeout}
  3742. {% endif %}
  3743. {% if printer.idle_timeout.state|upper == "IDLE" %}
  3744. {% if last_extruder_temp.restore %} M109 S{last_extruder_temp.temp} {% endif %}
  3745. {% endif %}
  3746. _CLIENT_EXTRUDE
  3747. RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)}
  3748.  
  3749. [gcode_macro SET_PAUSE_NEXT_LAYER]
  3750. description = Enable a pause if the next layer is reached
  3751. gcode =
  3752. {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %}
  3753. {% set ENABLE = params.ENABLE|default(1)|int != 0 %}
  3754. {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %}
  3755. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}"
  3756.  
  3757. [gcode_macro SET_PAUSE_AT_LAYER]
  3758. description = Enable/disable a pause if a given layer number is reached
  3759. gcode =
  3760. {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %}
  3761. {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined
  3762. else params.LAYER is defined %}
  3763. {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %}
  3764. {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %}
  3765. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}"
  3766.  
  3767. [gcode_macro SET_PRINT_STATS_INFO]
  3768. rename_existing = SET_PRINT_STATS_INFO_BASE
  3769. description = Overwrite, to get pause_next_layer and pause_at_layer feature
  3770. variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" }
  3771. variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" }
  3772. gcode =
  3773. {% if pause_next_layer.enable %}
  3774. RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
  3775. {pause_next_layer.call}
  3776. SET_PAUSE_NEXT_LAYER ENABLE=0
  3777. {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
  3778. RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
  3779. {pause_at_layer.call}
  3780. SET_PAUSE_AT_LAYER ENABLE=0
  3781. {% endif %}
  3782. SET_PRINT_STATS_INFO_BASE {rawparams}
  3783.  
  3784. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  3785. description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
  3786. gcode =
  3787.  
  3788. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  3789. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  3790. {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %}
  3791. {% set custom_park_x = client.custom_park_x|default(0.0) %}
  3792. {% set custom_park_y = client.custom_park_y|default(0.0) %}
  3793. {% set park_dz = client.custom_park_dz|default(2.0)|abs %}
  3794. {% set sp_hop = client.speed_hop|default(15) * 60 %}
  3795. {% set sp_move = client.speed_move|default(velocity) * 60 %}
  3796.  
  3797. {% set origin = printer.gcode_move.homing_origin %}
  3798. {% set act = printer.gcode_move.gcode_position %}
  3799. {% set max = printer.toolhead.axis_maximum %}
  3800. {% set cone = printer.toolhead.cone_start_z|default(max.z) %}
  3801. {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
  3802. else False %}
  3803.  
  3804. {% set z_min = params.Z_MIN|default(0)|float %}
  3805. {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
  3806. {% set x_park = params.X if params.X is defined
  3807. else custom_park_x if use_custom
  3808. else 0.0 if round_bed
  3809. else (max.x - 5.0) %}
  3810. {% set y_park = params.Y if params.Y is defined
  3811. else custom_park_y if use_custom
  3812. else (max.y - 5.0) if round_bed and z_park < cone
  3813. else 0.0 if round_bed
  3814. else (max.y - 5.0) %}
  3815.  
  3816. _CLIENT_RETRACT
  3817. {% if "xyz" in printer.toolhead.homed_axes %}
  3818. G90
  3819. G1 Z{z_park} F{sp_hop}
  3820. G1 X{x_park} Y{y_park} F{sp_move}
  3821. {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
  3822. {% else %}
  3823. RESPOND TYPE=echo MSG='Printer not homed'
  3824. {% endif %}
  3825.  
  3826. [gcode_macro _CLIENT_EXTRUDE]
  3827. description = Extrudes, if the extruder is hot enough
  3828. gcode =
  3829.  
  3830. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  3831. {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
  3832. {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
  3833. {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
  3834. {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
  3835.  
  3836. {% if printer.toolhead.extruder != '' %}
  3837. {% if printer[printer.toolhead.extruder].can_extrude %}
  3838. {% if use_fw_retract %}
  3839. {% if length < 0 %}
  3840. G10
  3841. {% else %}
  3842. G11
  3843. {% endif %}
  3844. {% else %}
  3845. M83
  3846. G1 E{length} F{(speed|float|abs) * 60}
  3847. {% if absolute_extrude %}
  3848. M82
  3849. {% endif %}
  3850. {% endif %}
  3851. {% else %}
  3852. RESPOND TYPE=echo MSG='Extruder not hot enough'
  3853. {% endif %}
  3854. {% endif %}
  3855.  
  3856.  
  3857.  
Advertisement
Add Comment
Please, Sign In to add comment