Advertisement
Guest User

Klippy log

a guest
Jan 27th, 2025
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 61.30 KB | None | 0 0
  1. Starting Klippy...
  2. Args: ['/home/sasi/klipper/klippy/klippy.py', '/home/sasi/printer_data/config/printer.cfg', '-I', '/home/sasi/printer_data/comms/klippy.serial', '-l', '/home/sasi/printer_data/logs/klippy.log', '-a', '/home/sasi/printer_data/comms/klippy.sock']
  3. Git version: 'v0.12.0-418-g0114d72a6'
  4. Branch: master
  5. Remote: origin
  6. Tracked URL: https://github.com/Klipper3d/klipper
  7. CPU: 4 core ?
  8. Python: '3.11.2 (main, Nov 30 2024, 21:22:50) [GCC 12.2.0]'
  9. Start printer at Mon Jan 27 08:01:34 2025 (1737957694.7 222.3)
  10. ===== Config file =====
  11. [virtual_sdcard]
  12. path = ~/printer_data/gcodes
  13. on_error_gcode = CANCEL_PRINT
  14.  
  15. [pause_resume]
  16.  
  17. [display_status]
  18.  
  19. [respond]
  20.  
  21. [gcode_macro CANCEL_PRINT]
  22. description = Cancel the actual running print
  23. rename_existing = CANCEL_PRINT_BASE
  24. gcode =
  25.  
  26. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  27. {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
  28. {% set retract = client.cancel_retract|default(5.0)|abs %}
  29.  
  30. {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
  31. else "X=" ~ client.park_at_cancel_x %}
  32. {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
  33. else "Y=" ~ client.park_at_cancel_y %}
  34. {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
  35.  
  36.  
  37. {% if printer['gcode_macro RESUME'].restore_idle_timeout > 0 %}
  38. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro RESUME'].restore_idle_timeout}
  39. {% endif %}
  40. {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %}
  41. _CLIENT_RETRACT LENGTH={retract}
  42. TURN_OFF_HEATERS
  43. M106 S0
  44. {client.user_cancel_macro|default("")}
  45. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=idle_state VALUE=False
  46.  
  47. SET_PAUSE_NEXT_LAYER ENABLE=0
  48. SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0
  49. CANCEL_PRINT_BASE
  50.  
  51. [gcode_macro PAUSE]
  52. description = Pause the actual running print
  53. rename_existing = PAUSE_BASE
  54. gcode =
  55.  
  56. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  57. {% set idle_timeout = client.idle_timeout|default(0) %}
  58. {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0 %}
  59. {% set restore = False if printer.toolhead.extruder == ''
  60. else True if params.RESTORE|default(1)|int == 1 else False %}
  61.  
  62. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
  63.  
  64. {% if idle_timeout > 0 %}
  65. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
  66. SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
  67. {% endif %}
  68. PAUSE_BASE
  69. {client.user_pause_macro|default("")}
  70. _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}
  71.  
  72. [gcode_macro RESUME]
  73. description = Resume the actual running print
  74. rename_existing = RESUME_BASE
  75. variable_last_extruder_temp = {'restore': False, 'temp': 0}
  76. variable_restore_idle_timeout = 0
  77. variable_idle_state = False
  78. gcode =
  79.  
  80. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  81. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  82. {% set sp_move = client.speed_move|default(velocity) %}
  83. {% set runout_resume = True if client.runout_sensor|default("") == ""
  84. else True if not printer[client.runout_sensor].enabled
  85. else printer[client.runout_sensor].filament_detected %}
  86. {% set can_extrude = True if printer.toolhead.extruder == ''
  87. else printer[printer.toolhead.extruder].can_extrude %}
  88. {% set do_resume = False %}
  89. {% set prompt_txt = [] %}
  90.  
  91.  
  92. {% if printer.idle_timeout.state|upper == "IDLE" or idle_state %}
  93. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=idle_state VALUE=False
  94. {% if last_extruder_temp.restore %}
  95.  
  96. RESPOND TYPE=echo MSG='{"Restoring \"%s\" temperature to %3.1f\u00B0C, this may take some time" % (printer.toolhead.extruder, last_extruder_temp.temp) }'
  97. M109 S{last_extruder_temp.temp}
  98. {% set do_resume = True %}
  99. {% elif can_extrude %}
  100. {% set do_resume = True %}
  101. {% else %}
  102. RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}'
  103. {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %}
  104. {% endif %}
  105.  
  106. {% elif can_extrude %}
  107. {% set do_resume = True %}
  108. {% else %}
  109. RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}'
  110. {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %}
  111. {% endif %}
  112. {% if runout_resume %}
  113. {% if do_resume %}
  114. {% if restore_idle_timeout > 0 %} SET_IDLE_TIMEOUT TIMEOUT={restore_idle_timeout} {% endif %}
  115. {client.user_resume_macro|default("")}
  116. _CLIENT_EXTRUDE
  117. RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)}
  118. {% endif %}
  119. {% else %}
  120. RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]}'
  121. {% set _d = prompt_txt.append("\"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]) %}
  122. {% endif %}
  123.  
  124. {% if not (runout_resume and do_resume) %}
  125. RESPOND TYPE=command MSG="action:prompt_begin RESUME aborted !!!"
  126. {% for element in prompt_txt %}
  127. RESPOND TYPE=command MSG='{"action:prompt_text %s" % element}'
  128. {% endfor %}
  129. RESPOND TYPE=command MSG="action:prompt_footer_button Ok|RESPOND TYPE=command MSG=action:prompt_end|info"
  130. RESPOND TYPE=command MSG="action:prompt_show"
  131. {% endif %}
  132.  
  133. [gcode_macro SET_PAUSE_NEXT_LAYER]
  134. description = Enable a pause if the next layer is reached
  135. gcode =
  136. {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %}
  137. {% set ENABLE = params.ENABLE|default(1)|int != 0 %}
  138. {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %}
  139. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}"
  140.  
  141. [gcode_macro SET_PAUSE_AT_LAYER]
  142. description = Enable/disable a pause if a given layer number is reached
  143. gcode =
  144. {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %}
  145. {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined
  146. else params.LAYER is defined %}
  147. {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %}
  148. {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %}
  149. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}"
  150.  
  151. [gcode_macro SET_PRINT_STATS_INFO]
  152. rename_existing = SET_PRINT_STATS_INFO_BASE
  153. description = Overwrite, to get pause_next_layer and pause_at_layer feature
  154. variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" }
  155. variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" }
  156. gcode =
  157. {% if pause_next_layer.enable %}
  158. RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
  159. {pause_next_layer.call}
  160. SET_PAUSE_NEXT_LAYER ENABLE=0
  161. {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
  162. RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
  163. {pause_at_layer.call}
  164. SET_PAUSE_AT_LAYER ENABLE=0
  165. {% endif %}
  166. SET_PRINT_STATS_INFO_BASE {rawparams}
  167.  
  168. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  169. description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
  170. gcode =
  171.  
  172. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  173. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  174. {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %}
  175. {% set custom_park_x = client.custom_park_x|default(0.0) %}
  176. {% set custom_park_y = client.custom_park_y|default(0.0) %}
  177. {% set park_dz = client.custom_park_dz|default(2.0)|abs %}
  178. {% set sp_hop = client.speed_hop|default(15) * 60 %}
  179. {% set sp_move = client.speed_move|default(velocity) * 60 %}
  180.  
  181. {% set origin = printer.gcode_move.homing_origin %}
  182. {% set act = printer.gcode_move.gcode_position %}
  183. {% set max = printer.toolhead.axis_maximum %}
  184. {% set cone = printer.toolhead.cone_start_z|default(max.z) %}
  185. {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
  186. else False %}
  187.  
  188. {% set z_min = params.Z_MIN|default(0)|float %}
  189. {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
  190. {% set x_park = params.X if params.X is defined
  191. else custom_park_x if use_custom
  192. else 0.0 if round_bed
  193. else (max.x - 5.0) %}
  194. {% set y_park = params.Y if params.Y is defined
  195. else custom_park_y if use_custom
  196. else (max.y - 5.0) if round_bed and z_park < cone
  197. else 0.0 if round_bed
  198. else (max.y - 5.0) %}
  199.  
  200. _CLIENT_RETRACT
  201. {% if "xyz" in printer.toolhead.homed_axes %}
  202. G90
  203. G1 Z{z_park} F{sp_hop}
  204. G1 X{x_park} Y{y_park} F{sp_move}
  205. {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
  206. {% else %}
  207. RESPOND TYPE=echo MSG='Printer not homed'
  208. {% endif %}
  209.  
  210. [gcode_macro _CLIENT_EXTRUDE]
  211. description = Extrudes, if the extruder is hot enough
  212. gcode =
  213.  
  214. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  215. {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
  216. {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
  217. {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
  218. {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
  219.  
  220. {% if printer.toolhead.extruder != '' %}
  221. {% if printer[printer.toolhead.extruder].can_extrude %}
  222. {% if use_fw_retract %}
  223. {% if length < 0 %}
  224. G10
  225. {% else %}
  226. G11
  227. {% endif %}
  228. {% else %}
  229. M83
  230. G1 E{length} F{(speed|float|abs) * 60}
  231. {% if absolute_extrude %}
  232. M82
  233. {% endif %}
  234. {% endif %}
  235. {% else %}
  236. RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}'
  237. {% endif %}
  238. {% endif %}
  239.  
  240. [gcode_macro _CLIENT_RETRACT]
  241. description = Retracts, if the extruder is hot enough
  242. gcode =
  243. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  244. {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
  245. {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
  246.  
  247. _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
  248.  
  249. [gcode_macro _CLIENT_LINEAR_MOVE]
  250. description = Linear move with save and restore of the gcode state
  251. gcode =
  252. {% set x_move = "X" ~ params.X if params.X is defined else "" %}
  253. {% set y_move = "Y" ~ params.Y if params.Y is defined else "" %}
  254. {% set z_move = "Z" ~ params.Z if params.Z is defined else "" %}
  255. {% set e_move = "E" ~ params.E if params.E is defined else "" %}
  256. {% set rate = "F" ~ params.F if params.F is defined else "" %}
  257. {% set ABSOLUTE = params.ABSOLUTE | default(0) | int != 0 %}
  258. {% set ABSOLUTE_E = params.ABSOLUTE_E | default(0) | int != 0 %}
  259. SAVE_GCODE_STATE NAME=_client_movement
  260. {% if x_move or y_move or z_move %}
  261. G9{ 0 if ABSOLUTE else 1 }
  262. {% endif %}
  263. {% if e_move %}
  264. M8{ 2 if ABSOLUTE_E else 3 }
  265. {% endif %}
  266. G1 { x_move } { y_move } { z_move } { e_move } { rate }
  267. RESTORE_GCODE_STATE NAME=_client_movement
  268.  
  269. [gcode_macro PRINT_START]
  270. gcode =
  271. {% set bed_temp = params.BED | default(60) | float %}
  272. {% set extruder_temp = params.EXTRUDER | default(220) | float %}
  273.  
  274. CLEAR_PAUSE
  275. M190 S{bed_temp}
  276. M104 S150
  277. G28
  278. M104 S{extruder_temp}
  279. BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5
  280. G0 X1 Y1 Z1 F5000
  281. M109 S{extruder_temp}
  282. ADAPTIVE_LINE_PURGE
  283.  
  284. [gcode_macro PRINT_END]
  285. gcode =
  286. G91
  287. G1 E-2 F2700
  288. G1 E-2 Z0.2 F2400
  289. G0 X5 Y5 F3000
  290. G0 Z10
  291. G90
  292. G0 X0 Y220
  293. M106 S0
  294. M104 S0
  295. M140 S0
  296. M84
  297.  
  298. [gcode_macro LINE_PURGE]
  299. gcode =
  300. G92 E0
  301. G1 Z2 F3000
  302. G1 X1 Y20 Z0.4 F5000
  303. G1 X1 Y145 Z0.4 E15 F1500
  304. G1 X1.3 Y145 Z0.4 F5000
  305. G1 X1.3 Y20 Z0.4 E30 F1500
  306. G92 E0
  307. G1 E-1 F1800
  308. G0 Z2 F3000
  309. G1 E0 F1800
  310.  
  311. [gcode_macro ADAPTIVE_LINE_PURGE]
  312. variable_purge_height = 0.8
  313. variable_tip_distance = 4
  314. variable_purge_margin = 10
  315. variable_purge_amount = 20
  316. variable_flow_rate = 12
  317. gcode =
  318. {% set travel_speed = printer.toolhead.max_velocity * 60 %}
  319. {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %}
  320.  
  321. {% set RETRACT = 'G10' if printer.firmware_retraction is defined else 'G1 E-0.5 F2100' %}
  322. {% set UNRETRACT = 'G11' if printer.firmware_retraction is defined else 'G1 E0.5 F2100' %}
  323.  
  324. {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %}
  325. {% set x_min = (all_points | map(attribute=0) | min | default(0)) %}
  326. {% set x_max = (all_points | map(attribute=0) | max | default(0)) %}
  327. {% set y_min = (all_points | map(attribute=1) | min | default(0)) %}
  328. {% set y_max = (all_points | map(attribute=1) | max | default(0)) %}
  329.  
  330. {% set x_center = ([((x_max + x_min) / 2) - (purge_amount / 2), 0] | max) %}
  331. {% set y_center = ([((y_max + y_min) / 2) - (purge_amount / 2), 0] | max) %}
  332.  
  333. {% set x_origin = ([x_min - purge_margin, 0] | max) %}
  334. {% set y_origin = ([y_min - purge_margin, 0] | max) %}
  335.  
  336.  
  337. {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %}
  338.  
  339. {% if cross_section < 5 %}
  340. {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge. Set it to 5 or greater. Purge skipped.")}
  341. {% else %}
  342. SAVE_GCODE_STATE NAME=prepurge_state
  343.  
  344. G92 E0
  345. G0 F{travel_speed}
  346. G90
  347. G0 X{x_center if y_origin > 0 else x_origin} Y{y_origin if y_origin > 0 else y_center}
  348. G0 Z{purge_height}
  349. M83
  350. G1 E{tip_distance} F{purge_move_speed}
  351.  
  352. {% if y_origin > 0 %}
  353. G1 X{x_center + purge_amount} E{purge_amount} F{purge_move_speed}
  354. {RETRACT}
  355. G0 X{x_center + purge_amount + 10} F{travel_speed}
  356. {% else %}
  357. G1 Y{y_center + purge_amount} E{purge_amount} F{purge_move_speed}
  358. {RETRACT}
  359. G0 Y{y_center + purge_amount + 10} F{travel_speed}
  360. {% endif %}
  361.  
  362. G0 Z{purge_height * 2} F{travel_speed}
  363. {UNRETRACT}
  364. G92 E0
  365. M82
  366.  
  367. RESTORE_GCODE_STATE NAME=prepurge_state
  368. {% endif %}
  369.  
  370. [gcode_macro LOAD_FILAMENT]
  371. variable_load_distance = 40
  372. variable_purge_distance = 30
  373. gcode =
  374. {% set load_speed = params.LOAD_SPEED | default(1500) | float %}
  375. {% set purge_speed = params.PURGE_SPEED | default(300) | float %}
  376. {% set min_temp = params.MIN_TEMP | default(220) | float %}
  377. {% set turn_off_extruder = params.TURN_OFF_EXTRUDER | default(1) | int %}
  378.  
  379. SAVE_GCODE_STATE NAME=load_state
  380.  
  381.  
  382. {% if printer.extruder.temperature < min_temp %}
  383. M109 S{min_temp}
  384. {% endif %}
  385.  
  386. G91
  387. G92 E0
  388. G1 E{load_distance} F{load_speed}
  389. G1 E{purge_distance} F{purge_speed}
  390.  
  391.  
  392. {% if turn_off_extruder %}
  393. M104 S0
  394. {% endif %}
  395.  
  396. RESTORE_GCODE_STATE NAME=load_state
  397. M118 Filament Loaded
  398.  
  399. [gcode_macro UNLOAD_FILAMENT]
  400. variable_unload_distance = 80
  401. variable_purge_distance = 20
  402. gcode =
  403. {% set unload_speed = params.UNLOAD_SPEED | default(1500) | float %}
  404. {% set purge_speed = params.PURGE_SPEED | default(300) | float %}
  405. {% set min_temp = params.MIN_TEMP | default(220) | float %}
  406. {% set turn_off_extruder = params.TURN_OFF_EXTRUDER | default(1) | int %}
  407.  
  408. SAVE_GCODE_STATE NAME=unload_state
  409.  
  410.  
  411. {% if printer.extruder.temperature < min_temp %}
  412. M109 S{min_temp}
  413. {% endif %}
  414.  
  415. G91
  416. G92 E0
  417. G1 E{purge_distance} F{purge_speed}
  418. G1 E-{unload_distance} F{unload_speed}
  419.  
  420.  
  421. {% if turn_off_extruder %}
  422. M104 S0
  423. {% endif %}
  424.  
  425. RESTORE_GCODE_STATE NAME=unload_state
  426. M118 Filament Unloaded
  427.  
  428. [gcode_macro BEEP]
  429. gcode =
  430. {% set duration = params.P | default(100) | float %}
  431. SET_PIN PIN=beeper VALUE=1
  432. G4 P{duration}
  433. SET_PIN PIN=beeper VALUE=0
  434.  
  435. [gcode_macro OFF]
  436. gcode =
  437. M84
  438. TURN_OFF_HEATERS
  439. M107
  440.  
  441. [gcode_macro PID_EXTRUDER]
  442. gcode =
  443. {% set target = params.TARGET | default(220) | float %}
  444. PID_CALIBRATE HEATER=extruder TARGET={target}
  445. SAVE_CONFIG
  446.  
  447. [gcode_macro PID_BED]
  448. gcode =
  449. {% set target = params.TARGET | default(60) | float %}
  450. PID_CALIBRATE HEATER=heater_bed TARGET={target}
  451. SAVE_CONFIG
  452.  
  453. [gcode_macro M109]
  454. rename_existing = M99109
  455. gcode =
  456. {% set s = params.S | float %}
  457.  
  458. M104 {% for p in params %} {'%s%s' % (p, params[p])} {% endfor %}
  459. {% if s != 0 %}
  460. TEMPERATURE_WAIT SENSOR=extruder MINIMUM={s} MAXIMUM={s+1}
  461. {% endif %}
  462.  
  463. [gcode_macro M190]
  464. rename_existing = M99190
  465. gcode =
  466. {% set s = params.S | float %}
  467.  
  468. M140 {% for p in params %} {'%s%s' % (p, params[p])} {% endfor %}
  469. {% if s != 0 %}
  470. TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={s} MAXIMUM={s+1}
  471. {% endif %}
  472.  
  473. [mcu]
  474. baud = 115200
  475. serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
  476. restart_method = command
  477.  
  478. [temperature_sensor mcu_temp]
  479. sensor_type = temperature_mcu
  480. min_temp = 0
  481. max_temp = 100
  482.  
  483. [temperature_sensor raspberry_pi]
  484. sensor_type = temperature_host
  485. min_temp = 10
  486. max_temp = 100
  487.  
  488. [printer]
  489. kinematics = cartesian
  490. max_velocity = 250
  491. max_accel = 2500
  492. minimum_cruise_ratio = 0.5
  493. square_corner_velocity = 5.0
  494. max_z_velocity = 100
  495. max_z_accel = 500
  496.  
  497. [stepper_x]
  498. step_pin = PC2
  499. dir_pin = !PB9
  500. enable_pin = !PC3
  501. microsteps = 16
  502. rotation_distance = 40
  503. endstop_pin = !PA5
  504. position_endstop = -6
  505. position_min = -6
  506. position_max = 230
  507. homing_speed = 60
  508.  
  509. [tmc2209 stepper_x]
  510. uart_pin = PB12
  511. run_current = 0.6
  512. sense_resistor = 0.150
  513. stealthchop_threshold = 0
  514. interpolate = True
  515.  
  516. [stepper_y]
  517. step_pin = PB8
  518. dir_pin = PB7
  519. enable_pin = !PC3
  520. microsteps = 16
  521. rotation_distance = 40
  522. endstop_pin = !PA6
  523. position_endstop = -14
  524. position_min = -14
  525. position_max = 225
  526. homing_speed = 60
  527.  
  528. [tmc2209 stepper_y]
  529. uart_pin = PB13
  530. run_current = 0.6
  531. sense_resistor = 0.150
  532. stealthchop_threshold = 0
  533. interpolate = True
  534.  
  535. [stepper_z]
  536. step_pin = PB6
  537. dir_pin = !PB5
  538. enable_pin = !PC3
  539. microsteps = 16
  540. rotation_distance = 8
  541. endstop_pin = probe:z_virtual_endstop
  542. position_min = -3
  543. position_max = 250
  544. homing_speed = 5
  545. second_homing_speed = 1
  546. homing_retract_dist = 2.5
  547.  
  548. [tmc2209 stepper_z]
  549. uart_pin = PB14
  550. run_current = 0.8
  551. sense_resistor = 0.150
  552. stealthchop_threshold = 0
  553. interpolate = True
  554.  
  555. [extruder]
  556. step_pin = PB4
  557. dir_pin = PB3
  558. enable_pin = !PC3
  559. microsteps = 16
  560. rotation_distance = 7.663
  561. nozzle_diameter = 0.400
  562. filament_diameter = 1.750
  563. max_extrude_cross_section = 5
  564. max_extrude_only_distance = 500
  565. pressure_advance = 0.04
  566. heater_pin = PA1
  567. sensor_type = EPCOS 100K B57560G104F
  568. sensor_pin = PC5
  569. control = pid
  570. pid_kp = 27.142
  571. pid_ki = 1.371
  572. pid_kd = 134.351
  573. min_temp = 0
  574. max_temp = 260
  575.  
  576. [heater_bed]
  577. heater_pin = PB2
  578. sensor_type = EPCOS 100K B57560G104F
  579. sensor_pin = PC4
  580. control = pid
  581. pid_kp = 66.371
  582. pid_ki = 0.846
  583. pid_kd = 1301.702
  584. min_temp = 0
  585. max_temp = 100
  586.  
  587. [bed_mesh]
  588. speed = 150
  589. mesh_min = 10,10
  590. mesh_max = 206,210.5
  591. probe_count = 5, 5
  592. algorithm = bicubic
  593.  
  594. [bltouch]
  595. sensor_pin = ^PC14
  596. control_pin = PC13
  597. stow_on_each_sample = False
  598. probe_with_touch_mode = True
  599. x_offset = -24.0
  600. y_offset = -14.5
  601. z_offset = 0
  602. speed = 5
  603. samples = 2
  604.  
  605. [heater_fan hotend_fan]
  606. pin = PC1
  607.  
  608. [fan]
  609. pin = PA0
  610.  
  611. [idle_timeout]
  612. gcode =
  613. OFF
  614. timeout = 600
  615.  
  616. [safe_z_home]
  617. home_xy_position = 139, 127
  618. speed = 60
  619. z_hop = 10
  620. z_hop_speed = 5
  621.  
  622. [output_pin beeper]
  623. pin = PB0
  624.  
  625. [gcode_arcs]
  626.  
  627. [exclude_object]
  628. =======================
  629. Extruder max_extrude_ratio=2.078758
  630. mcu 'mcu': Starting serial connect
  631. webhooks client 548029372560: New connection
  632. webhooks client 548029372560: Client info {'program': 'Moonraker', 'version': 'v0.9.3-19-gd4d2074'}
  633. Unable to issue reset command on MCU 'mcu'
  634. webhooks client 548029372560: Disconnected
  635. Restarting printer
  636. Start printer at Mon Jan 27 08:01:41 2025 (1737957701.3 228.9)
  637. ===== Config file =====
  638. [virtual_sdcard]
  639. path = ~/printer_data/gcodes
  640. on_error_gcode = CANCEL_PRINT
  641.  
  642. [pause_resume]
  643.  
  644. [display_status]
  645.  
  646. [respond]
  647.  
  648. [gcode_macro CANCEL_PRINT]
  649. description = Cancel the actual running print
  650. rename_existing = CANCEL_PRINT_BASE
  651. gcode =
  652.  
  653. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  654. {% set allow_park = client.park_at_cancel|default(false)|lower == 'true' %}
  655. {% set retract = client.cancel_retract|default(5.0)|abs %}
  656.  
  657. {% set park_x = "" if (client.park_at_cancel_x|default(none) is none)
  658. else "X=" ~ client.park_at_cancel_x %}
  659. {% set park_y = "" if (client.park_at_cancel_y|default(none) is none)
  660. else "Y=" ~ client.park_at_cancel_y %}
  661. {% set custom_park = park_x|length > 0 or park_y|length > 0 %}
  662.  
  663.  
  664. {% if printer['gcode_macro RESUME'].restore_idle_timeout > 0 %}
  665. SET_IDLE_TIMEOUT TIMEOUT={printer['gcode_macro RESUME'].restore_idle_timeout}
  666. {% endif %}
  667. {% if (custom_park or not printer.pause_resume.is_paused) and allow_park %} _TOOLHEAD_PARK_PAUSE_CANCEL {park_x} {park_y} {% endif %}
  668. _CLIENT_RETRACT LENGTH={retract}
  669. TURN_OFF_HEATERS
  670. M106 S0
  671. {client.user_cancel_macro|default("")}
  672. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=idle_state VALUE=False
  673.  
  674. SET_PAUSE_NEXT_LAYER ENABLE=0
  675. SET_PAUSE_AT_LAYER ENABLE=0 LAYER=0
  676. CANCEL_PRINT_BASE
  677.  
  678. [gcode_macro PAUSE]
  679. description = Pause the actual running print
  680. rename_existing = PAUSE_BASE
  681. gcode =
  682.  
  683. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  684. {% set idle_timeout = client.idle_timeout|default(0) %}
  685. {% set temp = printer[printer.toolhead.extruder].target if printer.toolhead.extruder != '' else 0 %}
  686. {% set restore = False if printer.toolhead.extruder == ''
  687. else True if params.RESTORE|default(1)|int == 1 else False %}
  688.  
  689. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=last_extruder_temp VALUE="{{'restore': restore, 'temp': temp}}"
  690.  
  691. {% if idle_timeout > 0 %}
  692. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=restore_idle_timeout VALUE={printer.configfile.settings.idle_timeout.timeout}
  693. SET_IDLE_TIMEOUT TIMEOUT={idle_timeout}
  694. {% endif %}
  695. PAUSE_BASE
  696. {client.user_pause_macro|default("")}
  697. _TOOLHEAD_PARK_PAUSE_CANCEL {rawparams}
  698.  
  699. [gcode_macro RESUME]
  700. description = Resume the actual running print
  701. rename_existing = RESUME_BASE
  702. variable_last_extruder_temp = {'restore': False, 'temp': 0}
  703. variable_restore_idle_timeout = 0
  704. variable_idle_state = False
  705. gcode =
  706.  
  707. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  708. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  709. {% set sp_move = client.speed_move|default(velocity) %}
  710. {% set runout_resume = True if client.runout_sensor|default("") == ""
  711. else True if not printer[client.runout_sensor].enabled
  712. else printer[client.runout_sensor].filament_detected %}
  713. {% set can_extrude = True if printer.toolhead.extruder == ''
  714. else printer[printer.toolhead.extruder].can_extrude %}
  715. {% set do_resume = False %}
  716. {% set prompt_txt = [] %}
  717.  
  718.  
  719. {% if printer.idle_timeout.state|upper == "IDLE" or idle_state %}
  720. SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=idle_state VALUE=False
  721. {% if last_extruder_temp.restore %}
  722.  
  723. RESPOND TYPE=echo MSG='{"Restoring \"%s\" temperature to %3.1f\u00B0C, this may take some time" % (printer.toolhead.extruder, last_extruder_temp.temp) }'
  724. M109 S{last_extruder_temp.temp}
  725. {% set do_resume = True %}
  726. {% elif can_extrude %}
  727. {% set do_resume = True %}
  728. {% else %}
  729. RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}'
  730. {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %}
  731. {% endif %}
  732.  
  733. {% elif can_extrude %}
  734. {% set do_resume = True %}
  735. {% else %}
  736. RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder}'
  737. {% set _d = prompt_txt.append("\"%s\" not hot enough, please heat up again and press RESUME" % printer.toolhead.extruder) %}
  738. {% endif %}
  739. {% if runout_resume %}
  740. {% if do_resume %}
  741. {% if restore_idle_timeout > 0 %} SET_IDLE_TIMEOUT TIMEOUT={restore_idle_timeout} {% endif %}
  742. {client.user_resume_macro|default("")}
  743. _CLIENT_EXTRUDE
  744. RESUME_BASE VELOCITY={params.VELOCITY|default(sp_move)}
  745. {% endif %}
  746. {% else %}
  747. RESPOND TYPE=error MSG='{"Resume aborted !!! \"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]}'
  748. {% set _d = prompt_txt.append("\"%s\" detects no filament, please load filament and press RESUME" % (client.runout_sensor.split(" "))[1]) %}
  749. {% endif %}
  750.  
  751. {% if not (runout_resume and do_resume) %}
  752. RESPOND TYPE=command MSG="action:prompt_begin RESUME aborted !!!"
  753. {% for element in prompt_txt %}
  754. RESPOND TYPE=command MSG='{"action:prompt_text %s" % element}'
  755. {% endfor %}
  756. RESPOND TYPE=command MSG="action:prompt_footer_button Ok|RESPOND TYPE=command MSG=action:prompt_end|info"
  757. RESPOND TYPE=command MSG="action:prompt_show"
  758. {% endif %}
  759.  
  760. [gcode_macro SET_PAUSE_NEXT_LAYER]
  761. description = Enable a pause if the next layer is reached
  762. gcode =
  763. {% set pause_next_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_next_layer %}
  764. {% set ENABLE = params.ENABLE|default(1)|int != 0 %}
  765. {% set MACRO = params.MACRO|default(pause_next_layer.call, True) %}
  766. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_next_layer VALUE="{{ 'enable': ENABLE, 'call': MACRO }}"
  767.  
  768. [gcode_macro SET_PAUSE_AT_LAYER]
  769. description = Enable/disable a pause if a given layer number is reached
  770. gcode =
  771. {% set pause_at_layer = printer['gcode_macro SET_PRINT_STATS_INFO'].pause_at_layer %}
  772. {% set ENABLE = params.ENABLE|int != 0 if params.ENABLE is defined
  773. else params.LAYER is defined %}
  774. {% set LAYER = params.LAYER|default(pause_at_layer.layer)|int %}
  775. {% set MACRO = params.MACRO|default(pause_at_layer.call, True) %}
  776. SET_GCODE_VARIABLE MACRO=SET_PRINT_STATS_INFO VARIABLE=pause_at_layer VALUE="{{ 'enable': ENABLE, 'layer': LAYER, 'call': MACRO }}"
  777.  
  778. [gcode_macro SET_PRINT_STATS_INFO]
  779. rename_existing = SET_PRINT_STATS_INFO_BASE
  780. description = Overwrite, to get pause_next_layer and pause_at_layer feature
  781. variable_pause_next_layer = { 'enable': False, 'call': "PAUSE" }
  782. variable_pause_at_layer = { 'enable': False, 'layer': 0, 'call': "PAUSE" }
  783. gcode =
  784. {% if pause_next_layer.enable %}
  785. RESPOND TYPE=echo MSG='{"%s, forced by pause_next_layer" % pause_next_layer.call}'
  786. {pause_next_layer.call}
  787. SET_PAUSE_NEXT_LAYER ENABLE=0
  788. {% elif pause_at_layer.enable and params.CURRENT_LAYER is defined and params.CURRENT_LAYER|int == pause_at_layer.layer %}
  789. RESPOND TYPE=echo MSG='{"%s, forced by pause_at_layer [%d]" % (pause_at_layer.call, pause_at_layer.layer)}'
  790. {pause_at_layer.call}
  791. SET_PAUSE_AT_LAYER ENABLE=0
  792. {% endif %}
  793. SET_PRINT_STATS_INFO_BASE {rawparams}
  794.  
  795. [gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
  796. description = Helper: park toolhead used in PAUSE and CANCEL_PRINT
  797. gcode =
  798.  
  799. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  800. {% set velocity = printer.configfile.settings.pause_resume.recover_velocity %}
  801. {% set use_custom = client.use_custom_pos|default(false)|lower == 'true' %}
  802. {% set custom_park_x = client.custom_park_x|default(0.0) %}
  803. {% set custom_park_y = client.custom_park_y|default(0.0) %}
  804. {% set park_dz = client.custom_park_dz|default(2.0)|abs %}
  805. {% set sp_hop = client.speed_hop|default(15) * 60 %}
  806. {% set sp_move = client.speed_move|default(velocity) * 60 %}
  807.  
  808. {% set origin = printer.gcode_move.homing_origin %}
  809. {% set act = printer.gcode_move.gcode_position %}
  810. {% set max = printer.toolhead.axis_maximum %}
  811. {% set cone = printer.toolhead.cone_start_z|default(max.z) %}
  812. {% set round_bed = True if printer.configfile.settings.printer.kinematics is in ['delta','polar','rotary_delta','winch']
  813. else False %}
  814.  
  815. {% set z_min = params.Z_MIN|default(0)|float %}
  816. {% set z_park = [[(act.z + park_dz), z_min]|max, (max.z - origin.z)]|min %}
  817. {% set x_park = params.X if params.X is defined
  818. else custom_park_x if use_custom
  819. else 0.0 if round_bed
  820. else (max.x - 5.0) %}
  821. {% set y_park = params.Y if params.Y is defined
  822. else custom_park_y if use_custom
  823. else (max.y - 5.0) if round_bed and z_park < cone
  824. else 0.0 if round_bed
  825. else (max.y - 5.0) %}
  826.  
  827. _CLIENT_RETRACT
  828. {% if "xyz" in printer.toolhead.homed_axes %}
  829. G90
  830. G1 Z{z_park} F{sp_hop}
  831. G1 X{x_park} Y{y_park} F{sp_move}
  832. {% if not printer.gcode_move.absolute_coordinates %} G91 {% endif %}
  833. {% else %}
  834. RESPOND TYPE=echo MSG='Printer not homed'
  835. {% endif %}
  836.  
  837. [gcode_macro _CLIENT_EXTRUDE]
  838. description = Extrudes, if the extruder is hot enough
  839. gcode =
  840.  
  841. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  842. {% set use_fw_retract = (client.use_fw_retract|default(false)|lower == 'true') and (printer.firmware_retraction is defined) %}
  843. {% set length = params.LENGTH|default(client.unretract)|default(1.0)|float %}
  844. {% set speed = params.SPEED|default(client.speed_unretract)|default(35) %}
  845. {% set absolute_extrude = printer.gcode_move.absolute_extrude %}
  846.  
  847. {% if printer.toolhead.extruder != '' %}
  848. {% if printer[printer.toolhead.extruder].can_extrude %}
  849. {% if use_fw_retract %}
  850. {% if length < 0 %}
  851. G10
  852. {% else %}
  853. G11
  854. {% endif %}
  855. {% else %}
  856. M83
  857. G1 E{length} F{(speed|float|abs) * 60}
  858. {% if absolute_extrude %}
  859. M82
  860. {% endif %}
  861. {% endif %}
  862. {% else %}
  863. RESPOND TYPE=echo MSG='{"\"%s\" not hot enough" % printer.toolhead.extruder}'
  864. {% endif %}
  865. {% endif %}
  866.  
  867. [gcode_macro _CLIENT_RETRACT]
  868. description = Retracts, if the extruder is hot enough
  869. gcode =
  870. {% set client = printer['gcode_macro _CLIENT_VARIABLE']|default({}) %}
  871. {% set length = params.LENGTH|default(client.retract)|default(1.0)|float %}
  872. {% set speed = params.SPEED|default(client.speed_retract)|default(35) %}
  873.  
  874. _CLIENT_EXTRUDE LENGTH=-{length|float|abs} SPEED={speed|float|abs}
  875.  
  876. [gcode_macro _CLIENT_LINEAR_MOVE]
  877. description = Linear move with save and restore of the gcode state
  878. gcode =
  879. {% set x_move = "X" ~ params.X if params.X is defined else "" %}
  880. {% set y_move = "Y" ~ params.Y if params.Y is defined else "" %}
  881. {% set z_move = "Z" ~ params.Z if params.Z is defined else "" %}
  882. {% set e_move = "E" ~ params.E if params.E is defined else "" %}
  883. {% set rate = "F" ~ params.F if params.F is defined else "" %}
  884. {% set ABSOLUTE = params.ABSOLUTE | default(0) | int != 0 %}
  885. {% set ABSOLUTE_E = params.ABSOLUTE_E | default(0) | int != 0 %}
  886. SAVE_GCODE_STATE NAME=_client_movement
  887. {% if x_move or y_move or z_move %}
  888. G9{ 0 if ABSOLUTE else 1 }
  889. {% endif %}
  890. {% if e_move %}
  891. M8{ 2 if ABSOLUTE_E else 3 }
  892. {% endif %}
  893. G1 { x_move } { y_move } { z_move } { e_move } { rate }
  894. RESTORE_GCODE_STATE NAME=_client_movement
  895.  
  896. [gcode_macro PRINT_START]
  897. gcode =
  898. {% set bed_temp = params.BED | default(60) | float %}
  899. {% set extruder_temp = params.EXTRUDER | default(220) | float %}
  900.  
  901. CLEAR_PAUSE
  902. M190 S{bed_temp}
  903. M104 S150
  904. G28
  905. M104 S{extruder_temp}
  906. BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=5
  907. G0 X1 Y1 Z1 F5000
  908. M109 S{extruder_temp}
  909. ADAPTIVE_LINE_PURGE
  910.  
  911. [gcode_macro PRINT_END]
  912. gcode =
  913. G91
  914. G1 E-2 F2700
  915. G1 E-2 Z0.2 F2400
  916. G0 X5 Y5 F3000
  917. G0 Z10
  918. G90
  919. G0 X0 Y220
  920. M106 S0
  921. M104 S0
  922. M140 S0
  923. M84
  924.  
  925. [gcode_macro LINE_PURGE]
  926. gcode =
  927. G92 E0
  928. G1 Z2 F3000
  929. G1 X1 Y20 Z0.4 F5000
  930. G1 X1 Y145 Z0.4 E15 F1500
  931. G1 X1.3 Y145 Z0.4 F5000
  932. G1 X1.3 Y20 Z0.4 E30 F1500
  933. G92 E0
  934. G1 E-1 F1800
  935. G0 Z2 F3000
  936. G1 E0 F1800
  937.  
  938. [gcode_macro ADAPTIVE_LINE_PURGE]
  939. variable_purge_height = 0.8
  940. variable_tip_distance = 4
  941. variable_purge_margin = 10
  942. variable_purge_amount = 20
  943. variable_flow_rate = 12
  944. gcode =
  945. {% set travel_speed = printer.toolhead.max_velocity * 60 %}
  946. {% set cross_section = printer.configfile.settings.extruder.max_extrude_cross_section | float %}
  947.  
  948. {% set RETRACT = 'G10' if printer.firmware_retraction is defined else 'G1 E-0.5 F2100' %}
  949. {% set UNRETRACT = 'G11' if printer.firmware_retraction is defined else 'G1 E0.5 F2100' %}
  950.  
  951. {% set all_points = printer.exclude_object.objects | map(attribute='polygon') | sum(start=[]) %}
  952. {% set x_min = (all_points | map(attribute=0) | min | default(0)) %}
  953. {% set x_max = (all_points | map(attribute=0) | max | default(0)) %}
  954. {% set y_min = (all_points | map(attribute=1) | min | default(0)) %}
  955. {% set y_max = (all_points | map(attribute=1) | max | default(0)) %}
  956.  
  957. {% set x_center = ([((x_max + x_min) / 2) - (purge_amount / 2), 0] | max) %}
  958. {% set y_center = ([((y_max + y_min) / 2) - (purge_amount / 2), 0] | max) %}
  959.  
  960. {% set x_origin = ([x_min - purge_margin, 0] | max) %}
  961. {% set y_origin = ([y_min - purge_margin, 0] | max) %}
  962.  
  963.  
  964. {% set purge_move_speed = (flow_rate / 5.0) * 60 | float %}
  965.  
  966. {% if cross_section < 5 %}
  967. {action_respond_info("[Extruder] max_extrude_cross_section is insufficient for purge. Set it to 5 or greater. Purge skipped.")}
  968. {% else %}
  969. SAVE_GCODE_STATE NAME=prepurge_state
  970.  
  971. G92 E0
  972. G0 F{travel_speed}
  973. G90
  974. G0 X{x_center if y_origin > 0 else x_origin} Y{y_origin if y_origin > 0 else y_center}
  975. G0 Z{purge_height}
  976. M83
  977. G1 E{tip_distance} F{purge_move_speed}
  978.  
  979. {% if y_origin > 0 %}
  980. G1 X{x_center + purge_amount} E{purge_amount} F{purge_move_speed}
  981. {RETRACT}
  982. G0 X{x_center + purge_amount + 10} F{travel_speed}
  983. {% else %}
  984. G1 Y{y_center + purge_amount} E{purge_amount} F{purge_move_speed}
  985. {RETRACT}
  986. G0 Y{y_center + purge_amount + 10} F{travel_speed}
  987. {% endif %}
  988.  
  989. G0 Z{purge_height * 2} F{travel_speed}
  990. {UNRETRACT}
  991. G92 E0
  992. M82
  993.  
  994. RESTORE_GCODE_STATE NAME=prepurge_state
  995. {% endif %}
  996.  
  997. [gcode_macro LOAD_FILAMENT]
  998. variable_load_distance = 40
  999. variable_purge_distance = 30
  1000. gcode =
  1001. {% set load_speed = params.LOAD_SPEED | default(1500) | float %}
  1002. {% set purge_speed = params.PURGE_SPEED | default(300) | float %}
  1003. {% set min_temp = params.MIN_TEMP | default(220) | float %}
  1004. {% set turn_off_extruder = params.TURN_OFF_EXTRUDER | default(1) | int %}
  1005.  
  1006. SAVE_GCODE_STATE NAME=load_state
  1007.  
  1008.  
  1009. {% if printer.extruder.temperature < min_temp %}
  1010. M109 S{min_temp}
  1011. {% endif %}
  1012.  
  1013. G91
  1014. G92 E0
  1015. G1 E{load_distance} F{load_speed}
  1016. G1 E{purge_distance} F{purge_speed}
  1017.  
  1018.  
  1019. {% if turn_off_extruder %}
  1020. M104 S0
  1021. {% endif %}
  1022.  
  1023. RESTORE_GCODE_STATE NAME=load_state
  1024. M118 Filament Loaded
  1025.  
  1026. [gcode_macro UNLOAD_FILAMENT]
  1027. variable_unload_distance = 80
  1028. variable_purge_distance = 20
  1029. gcode =
  1030. {% set unload_speed = params.UNLOAD_SPEED | default(1500) | float %}
  1031. {% set purge_speed = params.PURGE_SPEED | default(300) | float %}
  1032. {% set min_temp = params.MIN_TEMP | default(220) | float %}
  1033. {% set turn_off_extruder = params.TURN_OFF_EXTRUDER | default(1) | int %}
  1034.  
  1035. SAVE_GCODE_STATE NAME=unload_state
  1036.  
  1037.  
  1038. {% if printer.extruder.temperature < min_temp %}
  1039. M109 S{min_temp}
  1040. {% endif %}
  1041.  
  1042. G91
  1043. G92 E0
  1044. G1 E{purge_distance} F{purge_speed}
  1045. G1 E-{unload_distance} F{unload_speed}
  1046.  
  1047.  
  1048. {% if turn_off_extruder %}
  1049. M104 S0
  1050. {% endif %}
  1051.  
  1052. RESTORE_GCODE_STATE NAME=unload_state
  1053. M118 Filament Unloaded
  1054.  
  1055. [gcode_macro BEEP]
  1056. gcode =
  1057. {% set duration = params.P | default(100) | float %}
  1058. SET_PIN PIN=beeper VALUE=1
  1059. G4 P{duration}
  1060. SET_PIN PIN=beeper VALUE=0
  1061.  
  1062. [gcode_macro OFF]
  1063. gcode =
  1064. M84
  1065. TURN_OFF_HEATERS
  1066. M107
  1067.  
  1068. [gcode_macro PID_EXTRUDER]
  1069. gcode =
  1070. {% set target = params.TARGET | default(220) | float %}
  1071. PID_CALIBRATE HEATER=extruder TARGET={target}
  1072. SAVE_CONFIG
  1073.  
  1074. [gcode_macro PID_BED]
  1075. gcode =
  1076. {% set target = params.TARGET | default(60) | float %}
  1077. PID_CALIBRATE HEATER=heater_bed TARGET={target}
  1078. SAVE_CONFIG
  1079.  
  1080. [gcode_macro M109]
  1081. rename_existing = M99109
  1082. gcode =
  1083. {% set s = params.S | float %}
  1084.  
  1085. M104 {% for p in params %} {'%s%s' % (p, params[p])} {% endfor %}
  1086. {% if s != 0 %}
  1087. TEMPERATURE_WAIT SENSOR=extruder MINIMUM={s} MAXIMUM={s+1}
  1088. {% endif %}
  1089.  
  1090. [gcode_macro M190]
  1091. rename_existing = M99190
  1092. gcode =
  1093. {% set s = params.S | float %}
  1094.  
  1095. M140 {% for p in params %} {'%s%s' % (p, params[p])} {% endfor %}
  1096. {% if s != 0 %}
  1097. TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={s} MAXIMUM={s+1}
  1098. {% endif %}
  1099.  
  1100. [mcu]
  1101. baud = 115200
  1102. serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
  1103. restart_method = command
  1104.  
  1105. [temperature_sensor mcu_temp]
  1106. sensor_type = temperature_mcu
  1107. min_temp = 0
  1108. max_temp = 100
  1109.  
  1110. [temperature_sensor raspberry_pi]
  1111. sensor_type = temperature_host
  1112. min_temp = 10
  1113. max_temp = 100
  1114.  
  1115. [printer]
  1116. kinematics = cartesian
  1117. max_velocity = 250
  1118. max_accel = 2500
  1119. minimum_cruise_ratio = 0.5
  1120. square_corner_velocity = 5.0
  1121. max_z_velocity = 100
  1122. max_z_accel = 500
  1123.  
  1124. [stepper_x]
  1125. step_pin = PC2
  1126. dir_pin = !PB9
  1127. enable_pin = !PC3
  1128. microsteps = 16
  1129. rotation_distance = 40
  1130. endstop_pin = !PA5
  1131. position_endstop = -6
  1132. position_min = -6
  1133. position_max = 230
  1134. homing_speed = 60
  1135.  
  1136. [tmc2209 stepper_x]
  1137. uart_pin = PB12
  1138. run_current = 0.6
  1139. sense_resistor = 0.150
  1140. stealthchop_threshold = 0
  1141. interpolate = True
  1142.  
  1143. [stepper_y]
  1144. step_pin = PB8
  1145. dir_pin = PB7
  1146. enable_pin = !PC3
  1147. microsteps = 16
  1148. rotation_distance = 40
  1149. endstop_pin = !PA6
  1150. position_endstop = -14
  1151. position_min = -14
  1152. position_max = 225
  1153. homing_speed = 60
  1154.  
  1155. [tmc2209 stepper_y]
  1156. uart_pin = PB13
  1157. run_current = 0.6
  1158. sense_resistor = 0.150
  1159. stealthchop_threshold = 0
  1160. interpolate = True
  1161.  
  1162. [stepper_z]
  1163. step_pin = PB6
  1164. dir_pin = !PB5
  1165. enable_pin = !PC3
  1166. microsteps = 16
  1167. rotation_distance = 8
  1168. endstop_pin = probe:z_virtual_endstop
  1169. position_min = -3
  1170. position_max = 250
  1171. homing_speed = 5
  1172. second_homing_speed = 1
  1173. homing_retract_dist = 2.5
  1174.  
  1175. [tmc2209 stepper_z]
  1176. uart_pin = PB14
  1177. run_current = 0.8
  1178. sense_resistor = 0.150
  1179. stealthchop_threshold = 0
  1180. interpolate = True
  1181.  
  1182. [extruder]
  1183. step_pin = PB4
  1184. dir_pin = PB3
  1185. enable_pin = !PC3
  1186. microsteps = 16
  1187. rotation_distance = 7.663
  1188. nozzle_diameter = 0.400
  1189. filament_diameter = 1.750
  1190. max_extrude_cross_section = 5
  1191. max_extrude_only_distance = 500
  1192. pressure_advance = 0.04
  1193. heater_pin = PA1
  1194. sensor_type = EPCOS 100K B57560G104F
  1195. sensor_pin = PC5
  1196. control = pid
  1197. pid_kp = 27.142
  1198. pid_ki = 1.371
  1199. pid_kd = 134.351
  1200. min_temp = 0
  1201. max_temp = 260
  1202.  
  1203. [heater_bed]
  1204. heater_pin = PB2
  1205. sensor_type = EPCOS 100K B57560G104F
  1206. sensor_pin = PC4
  1207. control = pid
  1208. pid_kp = 66.371
  1209. pid_ki = 0.846
  1210. pid_kd = 1301.702
  1211. min_temp = 0
  1212. max_temp = 100
  1213.  
  1214. [bed_mesh]
  1215. speed = 150
  1216. mesh_min = 10,10
  1217. mesh_max = 206,210.5
  1218. probe_count = 5, 5
  1219. algorithm = bicubic
  1220.  
  1221. [bltouch]
  1222. sensor_pin = ^PC14
  1223. control_pin = PC13
  1224. stow_on_each_sample = False
  1225. probe_with_touch_mode = True
  1226. x_offset = -24.0
  1227. y_offset = -14.5
  1228. z_offset = 0
  1229. speed = 5
  1230. samples = 2
  1231.  
  1232. [heater_fan hotend_fan]
  1233. pin = PC1
  1234.  
  1235. [fan]
  1236. pin = PA0
  1237.  
  1238. [idle_timeout]
  1239. gcode =
  1240. OFF
  1241. timeout = 600
  1242.  
  1243. [safe_z_home]
  1244. home_xy_position = 139, 127
  1245. speed = 60
  1246. z_hop = 10
  1247. z_hop_speed = 5
  1248.  
  1249. [output_pin beeper]
  1250. pin = PB0
  1251.  
  1252. [gcode_arcs]
  1253.  
  1254. [exclude_object]
  1255. =======================
  1256. Extruder max_extrude_ratio=2.078758
  1257. mcu 'mcu': Starting serial connect
  1258. webhooks client 547808712080: New connection
  1259. webhooks client 547808712080: Client info {'program': 'Moonraker', 'version': 'v0.9.3-19-gd4d2074'}
  1260. mcu 'mcu': Timeout on connect
  1261. mcu 'mcu': Wait for identify_response
  1262. Traceback (most recent call last):
  1263. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1264. params = self.send_with_response(msg, 'identify_response')
  1265. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1266. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1267. return src.get_response([cmd], self.default_cmd_queue)
  1268. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1269. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1270. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1271. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1272. self._error("Serial connection closed")
  1273. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1274. raise error(self.warn_prefix + (msg % params))
  1275. serialhdl.error: mcu 'mcu': Serial connection closed
  1276. mcu 'mcu': Timeout on connect
  1277. mcu 'mcu': Wait for identify_response
  1278. Traceback (most recent call last):
  1279. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1280. params = self.send_with_response(msg, 'identify_response')
  1281. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1282. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1283. return src.get_response([cmd], self.default_cmd_queue)
  1284. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1285. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1286. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1287. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1288. self._error("Serial connection closed")
  1289. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1290. raise error(self.warn_prefix + (msg % params))
  1291. serialhdl.error: mcu 'mcu': Serial connection closed
  1292. mcu 'mcu': Timeout on connect
  1293. mcu 'mcu': Wait for identify_response
  1294. Traceback (most recent call last):
  1295. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1296. params = self.send_with_response(msg, 'identify_response')
  1297. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1298. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1299. return src.get_response([cmd], self.default_cmd_queue)
  1300. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1301. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1302. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1303. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1304. self._error("Serial connection closed")
  1305. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1306. raise error(self.warn_prefix + (msg % params))
  1307. serialhdl.error: mcu 'mcu': Serial connection closed
  1308. mcu 'mcu': Timeout on connect
  1309. mcu 'mcu': Wait for identify_response
  1310. Traceback (most recent call last):
  1311. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1312. params = self.send_with_response(msg, 'identify_response')
  1313. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1314. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1315. return src.get_response([cmd], self.default_cmd_queue)
  1316. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1317. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1318. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1319. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1320. self._error("Serial connection closed")
  1321. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1322. raise error(self.warn_prefix + (msg % params))
  1323. serialhdl.error: mcu 'mcu': Serial connection closed
  1324. mcu 'mcu': Timeout on connect
  1325. mcu 'mcu': Wait for identify_response
  1326. Traceback (most recent call last):
  1327. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1328. params = self.send_with_response(msg, 'identify_response')
  1329. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1330. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1331. return src.get_response([cmd], self.default_cmd_queue)
  1332. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1333. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1334. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1335. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1336. self._error("Serial connection closed")
  1337. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1338. raise error(self.warn_prefix + (msg % params))
  1339. serialhdl.error: mcu 'mcu': Serial connection closed
  1340. mcu 'mcu': Timeout on connect
  1341. mcu 'mcu': Wait for identify_response
  1342. Traceback (most recent call last):
  1343. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1344. params = self.send_with_response(msg, 'identify_response')
  1345. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1346. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1347. return src.get_response([cmd], self.default_cmd_queue)
  1348. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1349. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1350. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1351. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1352. self._error("Serial connection closed")
  1353. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1354. raise error(self.warn_prefix + (msg % params))
  1355. serialhdl.error: mcu 'mcu': Serial connection closed
  1356. mcu 'mcu': Timeout on connect
  1357. mcu 'mcu': Wait for identify_response
  1358. Traceback (most recent call last):
  1359. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1360. params = self.send_with_response(msg, 'identify_response')
  1361. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1362. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1363. return src.get_response([cmd], self.default_cmd_queue)
  1364. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1365. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1366. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1367. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1368. self._error("Serial connection closed")
  1369. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1370. raise error(self.warn_prefix + (msg % params))
  1371. serialhdl.error: mcu 'mcu': Serial connection closed
  1372. mcu 'mcu': Timeout on connect
  1373. mcu 'mcu': Wait for identify_response
  1374. Traceback (most recent call last):
  1375. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1376. params = self.send_with_response(msg, 'identify_response')
  1377. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1378. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1379. return src.get_response([cmd], self.default_cmd_queue)
  1380. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1381. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1382. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1383. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1384. self._error("Serial connection closed")
  1385. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1386. raise error(self.warn_prefix + (msg % params))
  1387. serialhdl.error: mcu 'mcu': Serial connection closed
  1388. mcu 'mcu': Timeout on connect
  1389. mcu 'mcu': Wait for identify_response
  1390. Traceback (most recent call last):
  1391. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1392. params = self.send_with_response(msg, 'identify_response')
  1393. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1394. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1395. return src.get_response([cmd], self.default_cmd_queue)
  1396. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1397. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1398. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1399. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1400. self._error("Serial connection closed")
  1401. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1402. raise error(self.warn_prefix + (msg % params))
  1403. serialhdl.error: mcu 'mcu': Serial connection closed
  1404. mcu 'mcu': Timeout on connect
  1405. mcu 'mcu': Wait for identify_response
  1406. Traceback (most recent call last):
  1407. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1408. params = self.send_with_response(msg, 'identify_response')
  1409. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1410. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1411. return src.get_response([cmd], self.default_cmd_queue)
  1412. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1413. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1414. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1415. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1416. self._error("Serial connection closed")
  1417. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1418. raise error(self.warn_prefix + (msg % params))
  1419. serialhdl.error: mcu 'mcu': Serial connection closed
  1420. mcu 'mcu': Timeout on connect
  1421. mcu 'mcu': Wait for identify_response
  1422. Traceback (most recent call last):
  1423. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1424. params = self.send_with_response(msg, 'identify_response')
  1425. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1426. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1427. return src.get_response([cmd], self.default_cmd_queue)
  1428. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1429. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1430. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1431. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1432. self._error("Serial connection closed")
  1433. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1434. raise error(self.warn_prefix + (msg % params))
  1435. serialhdl.error: mcu 'mcu': Serial connection closed
  1436. mcu 'mcu': Timeout on connect
  1437. mcu 'mcu': Wait for identify_response
  1438. Traceback (most recent call last):
  1439. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1440. params = self.send_with_response(msg, 'identify_response')
  1441. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1442. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1443. return src.get_response([cmd], self.default_cmd_queue)
  1444. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1445. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1446. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1447. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1448. self._error("Serial connection closed")
  1449. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1450. raise error(self.warn_prefix + (msg % params))
  1451. serialhdl.error: mcu 'mcu': Serial connection closed
  1452. mcu 'mcu': Timeout on connect
  1453. mcu 'mcu': Wait for identify_response
  1454. Traceback (most recent call last):
  1455. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1456. params = self.send_with_response(msg, 'identify_response')
  1457. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1458. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1459. return src.get_response([cmd], self.default_cmd_queue)
  1460. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1461. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1462. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1463. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1464. self._error("Serial connection closed")
  1465. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1466. raise error(self.warn_prefix + (msg % params))
  1467. serialhdl.error: mcu 'mcu': Serial connection closed
  1468. mcu 'mcu': Timeout on connect
  1469. mcu 'mcu': Wait for identify_response
  1470. Traceback (most recent call last):
  1471. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1472. params = self.send_with_response(msg, 'identify_response')
  1473. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1474. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1475. return src.get_response([cmd], self.default_cmd_queue)
  1476. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1477. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1478. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1479. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1480. self._error("Serial connection closed")
  1481. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1482. raise error(self.warn_prefix + (msg % params))
  1483. serialhdl.error: mcu 'mcu': Serial connection closed
  1484. mcu 'mcu': Timeout on connect
  1485. mcu 'mcu': Wait for identify_response
  1486. Traceback (most recent call last):
  1487. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1488. params = self.send_with_response(msg, 'identify_response')
  1489. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1490. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1491. return src.get_response([cmd], self.default_cmd_queue)
  1492. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1493. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1494. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1495. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1496. self._error("Serial connection closed")
  1497. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1498. raise error(self.warn_prefix + (msg % params))
  1499. serialhdl.error: mcu 'mcu': Serial connection closed
  1500. mcu 'mcu': Timeout on connect
  1501. mcu 'mcu': Wait for identify_response
  1502. Traceback (most recent call last):
  1503. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1504. params = self.send_with_response(msg, 'identify_response')
  1505. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1506. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1507. return src.get_response([cmd], self.default_cmd_queue)
  1508. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1509. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1510. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1511. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1512. self._error("Serial connection closed")
  1513. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1514. raise error(self.warn_prefix + (msg % params))
  1515. serialhdl.error: mcu 'mcu': Serial connection closed
  1516. mcu 'mcu': Timeout on connect
  1517. mcu 'mcu': Wait for identify_response
  1518. Traceback (most recent call last):
  1519. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1520. params = self.send_with_response(msg, 'identify_response')
  1521. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1522. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1523. return src.get_response([cmd], self.default_cmd_queue)
  1524. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1525. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1526. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1527. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1528. self._error("Serial connection closed")
  1529. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1530. raise error(self.warn_prefix + (msg % params))
  1531. serialhdl.error: mcu 'mcu': Serial connection closed
  1532. mcu 'mcu': Timeout on connect
  1533. MCU error during connect
  1534. Traceback (most recent call last):
  1535. File "/home/sasi/klipper/klippy/mcu.py", line 793, in _mcu_identify
  1536. self._serial.connect_uart(self._serialport, self._baud, rts)
  1537. File "/home/sasi/klipper/klippy/serialhdl.py", line 183, in connect_uart
  1538. self._error("Unable to connect")
  1539. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1540. raise error(self.warn_prefix + (msg % params))
  1541. serialhdl.error: mcu 'mcu': Unable to connect
  1542.  
  1543. During handling of the above exception, another exception occurred:
  1544.  
  1545. Traceback (most recent call last):
  1546. File "/home/sasi/klipper/klippy/klippy.py", line 131, in _connect
  1547. self.send_event("klippy:mcu_identify")
  1548. File "/home/sasi/klipper/klippy/klippy.py", line 223, in send_event
  1549. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  1550. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1551. File "/home/sasi/klipper/klippy/klippy.py", line 223, in <listcomp>
  1552. return [cb(*params) for cb in self.event_handlers.get(event, [])]
  1553. ^^^^^^^^^^^
  1554. File "/home/sasi/klipper/klippy/mcu.py", line 798, in _mcu_identify
  1555. raise error(str(e))
  1556. mcu.error: mcu 'mcu': Unable to connect
  1557. mcu 'mcu': Unable to connect
  1558. Once the underlying issue is corrected, use the
  1559. "FIRMWARE_RESTART" command to reset the firmware, reload the
  1560. config, and restart the host software.
  1561. Error configuring printer
  1562.  
  1563. Build file /home/sasi/klipper/klippy/../.config(3687): Sun Jan 26 20:24:23 2025
  1564. ========= Last MCU build config =========
  1565. CONFIG_LOW_LEVEL_OPTIONS=y
  1566. # CONFIG_MACH_AVR is not set
  1567. # CONFIG_MACH_ATSAM is not set
  1568. # CONFIG_MACH_ATSAMD is not set
  1569. # CONFIG_MACH_LPC176X is not set
  1570. CONFIG_MACH_STM32=y
  1571. # CONFIG_MACH_HC32F460 is not set
  1572. # CONFIG_MACH_RPXXXX is not set
  1573. # CONFIG_MACH_PRU is not set
  1574. # CONFIG_MACH_AR100 is not set
  1575. # CONFIG_MACH_LINUX is not set
  1576. # CONFIG_MACH_SIMU is not set
  1577. CONFIG_BOARD_DIRECTORY="stm32"
  1578. CONFIG_MCU="stm32f103xe"
  1579. CONFIG_CLOCK_FREQ=72000000
  1580. CONFIG_SERIAL=y
  1581. CONFIG_FLASH_SIZE=0x10000
  1582. CONFIG_FLASH_BOOT_ADDRESS=0x8000000
  1583. CONFIG_RAM_START=0x20000000
  1584. CONFIG_RAM_SIZE=0x5000
  1585. CONFIG_STACK_SIZE=512
  1586. CONFIG_FLASH_APPLICATION_ADDRESS=0x8007000
  1587. CONFIG_STM32_SELECT=y
  1588. CONFIG_MACH_STM32F103=y
  1589. # CONFIG_MACH_STM32F207 is not set
  1590. # CONFIG_MACH_STM32F401 is not set
  1591. # CONFIG_MACH_STM32F405 is not set
  1592. # CONFIG_MACH_STM32F407 is not set
  1593. # CONFIG_MACH_STM32F429 is not set
  1594. # CONFIG_MACH_STM32F446 is not set
  1595. # CONFIG_MACH_STM32F765 is not set
  1596. # CONFIG_MACH_STM32F031 is not set
  1597. # CONFIG_MACH_STM32F042 is not set
  1598. # CONFIG_MACH_STM32F070 is not set
  1599. # CONFIG_MACH_STM32F072 is not set
  1600. # CONFIG_MACH_STM32G070 is not set
  1601. # CONFIG_MACH_STM32G071 is not set
  1602. # CONFIG_MACH_STM32G0B0 is not set
  1603. # CONFIG_MACH_STM32G0B1 is not set
  1604. # CONFIG_MACH_STM32G431 is not set
  1605. # CONFIG_MACH_STM32G474 is not set
  1606. # CONFIG_MACH_STM32H723 is not set
  1607. # CONFIG_MACH_STM32H743 is not set
  1608. # CONFIG_MACH_STM32H750 is not set
  1609. # CONFIG_MACH_STM32L412 is not set
  1610. # CONFIG_MACH_N32G452 is not set
  1611. # CONFIG_MACH_N32G455 is not set
  1612. # CONFIG_MACH_STM32F103x6 is not set
  1613. CONFIG_MACH_STM32F1=y
  1614. CONFIG_HAVE_STM32_USBFS=y
  1615. CONFIG_HAVE_STM32_CANBUS=y
  1616. # CONFIG_STM32F103GD_DISABLE_SWD is not set
  1617. CONFIG_STM32_DFU_ROM_ADDRESS=0
  1618. # CONFIG_STM32_FLASH_START_2000 is not set
  1619. # CONFIG_STM32_FLASH_START_5000 is not set
  1620. CONFIG_STM32_FLASH_START_7000=y
  1621. # CONFIG_STM32_FLASH_START_8000 is not set
  1622. # CONFIG_STM32_FLASH_START_8800 is not set
  1623. # CONFIG_STM32_FLASH_START_9000 is not set
  1624. # CONFIG_STM32_FLASH_START_10000 is not set
  1625. # CONFIG_STM32_FLASH_START_800 is not set
  1626. # CONFIG_STM32_FLASH_START_1000 is not set
  1627. # CONFIG_STM32_FLASH_START_4000 is not set
  1628. # CONFIG_STM32_FLASH_START_0000 is not set
  1629. CONFIG_STM32_CLOCK_REF_8M=y
  1630. # CONFIG_STM32_CLOCK_REF_12M is not set
  1631. # CONFIG_STM32_CLOCK_REF_16M is not set
  1632. # CONFIG_STM32_CLOCK_REF_20M is not set
  1633. # CONFIG_STM32_CLOCK_REF_24M is not set
  1634. # CONFIG_STM32_CLOCK_REF_25M is not set
  1635. # CONFIG_STM32_CLOCK_REF_INTERNAL is not set
  1636. CONFIG_CLOCK_REF_FREQ=8000000
  1637. CONFIG_STM32F0_TRIM=16
  1638. # CONFIG_STM32_USB_PA11_PA12 is not set
  1639. CONFIG_STM32_SERIAL_USART1=y
  1640. # CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set
  1641. # CONFIG_STM32_SERIAL_USART2 is not set
  1642. # CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set
  1643. # CONFIG_STM32_SERIAL_USART3 is not set
  1644. # CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set
  1645. # CONFIG_STM32_CANBUS_PA11_PA12 is not set
  1646. # CONFIG_STM32_CANBUS_PA11_PB9 is not set
  1647. # CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set
  1648. # CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set
  1649. CONFIG_SERIAL_BAUD=115200
  1650. CONFIG_USB_VENDOR_ID=0x1d50
  1651. CONFIG_USB_DEVICE_ID=0x614e
  1652. CONFIG_USB_SERIAL_NUMBER="12345"
  1653. CONFIG_WANT_GPIO_BITBANGING=y
  1654. CONFIG_WANT_DISPLAYS=y
  1655. CONFIG_WANT_THERMOCOUPLE=y
  1656. CONFIG_WANT_ADXL345=y
  1657. CONFIG_WANT_LIS2DW=y
  1658. CONFIG_WANT_MPU9250=y
  1659. CONFIG_WANT_HX71X=y
  1660. CONFIG_WANT_ADS1220=y
  1661. CONFIG_WANT_LDC1612=y
  1662. CONFIG_WANT_SENSOR_ANGLE=y
  1663. CONFIG_WANT_SOFTWARE_I2C=y
  1664. CONFIG_WANT_SOFTWARE_SPI=y
  1665. CONFIG_NEED_SENSOR_BULK=y
  1666. CONFIG_CANBUS_FREQUENCY=1000000
  1667. CONFIG_INITIAL_PINS=""
  1668. CONFIG_HAVE_GPIO=y
  1669. CONFIG_HAVE_GPIO_ADC=y
  1670. CONFIG_HAVE_GPIO_SPI=y
  1671. CONFIG_HAVE_GPIO_I2C=y
  1672. CONFIG_HAVE_GPIO_HARD_PWM=y
  1673. CONFIG_HAVE_STRICT_TIMING=y
  1674. CONFIG_HAVE_CHIPID=y
  1675. CONFIG_HAVE_STEPPER_BOTH_EDGE=y
  1676. CONFIG_HAVE_BOOTLOADER_REQUEST=y
  1677. CONFIG_INLINE_STEPPER_HACK=y
  1678. =======================
  1679. Build file /home/sasi/klipper/klippy/../out/klipper.dict(8423): Sun Jan 26 20:24:51 2025
  1680. Last MCU build version: v0.12.0-418-g0114d72a6
  1681. Last MCU build tools: gcc: (15:12.2.rel1-1) 12.2.1 20221205 binutils: (2.40-2+18+b1) 2.40
  1682. Last MCU build config: ADC_MAX=4095 BUS_PINS_i2c1=PB6,PB7 BUS_PINS_i2c1a=PB8,PB9 BUS_PINS_i2c2=PB10,PB11 BUS_PINS_spi1=PA6,PA7,PA5 BUS_PINS_spi1a=PB4,PB5,PB3 BUS_PINS_spi2=PB14,PB15,PB13 BUS_PINS_spi3=PB4,PB5,PB3 CLOCK_FREQ=72000000 MCU=stm32f103xe PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PA10,PA9 SERIAL_BAUD=115200 STATS_SUMSQ_BASE=256 STEPPER_BOTH_EDGE=1
  1683. Build file /home/sasi/klipper/klippy/../out/klipper.elf(987408): Sun Jan 26 20:24:55 2025
  1684. mcu 'mcu': Wait for identify_response
  1685. Traceback (most recent call last):
  1686. File "/home/sasi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
  1687. params = self.send_with_response(msg, 'identify_response')
  1688. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1689. File "/home/sasi/klipper/klippy/serialhdl.py", line 262, in send_with_response
  1690. return src.get_response([cmd], self.default_cmd_queue)
  1691. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1692. File "/home/sasi/klipper/klippy/serialhdl.py", line 319, in get_response
  1693. self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  1694. File "/home/sasi/klipper/klippy/serialhdl.py", line 254, in raw_send_wait_ack
  1695. self._error("Serial connection closed")
  1696. File "/home/sasi/klipper/klippy/serialhdl.py", line 61, in _error
  1697. raise error(self.warn_prefix + (msg % params))
  1698. serialhdl.error: mcu 'mcu': Serial connection closed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement