# Printing/resume doesnt work

**URL:** <https://klipper.discourse.group/t/printing-resume-doesnt-work/7669>\
**Category:** General Discussion\
**Created:** [April 6, 2023, 3:24am UTC](https://klipper.discourse.group/t/printing-resume-doesnt-work/7669 "2023-04-06T03:24:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ezrollin](https://avatars.discourse-cdn.com/v4/letter/e/9de0a6/32.png) [@ezrollin](https://klipper.discourse.group/u/ezrollin)\
**Post date:** [April 6, 2023, 3:24am UTC](https://klipper.discourse.group/t/printing-resume-doesnt-work/7669/1 "2023-04-06T03:24:31Z")

</div>

### Basic Information:

Printer Model: E3P fully upgraded  
 MCU / Printerboard: SKR mini 3v3.0  
[x klippy log is too big

{“code”:“key165”, “msg”: " **Error evaluating ‘gcode\_macro RESUME:gcode’: UndefinedError: ‘instance object’ has no attribute ‘gcode\_macro \_km\_globals’**  
**", “values”: [“gcode\_macro RESUME:gcode”, "UndefinedError: ‘instance object’ has no attribute ‘gcode\_macro \_km\_globals’**  
"]}

> > [gcode\_macro RESUME]  
> > description: Resumes the currently paused print.  
> > Usage: RESUME [E]  
> > rename\_existing: \_KM\_RESUME\_BASE  
> > variable\_saved\_extruder\_temp: 0  
> > variable\_saved\_x: 0.0  
> > variable\_saved\_y: 0.0  
> > variable\_saved\_z: 0.0  
> > variable\_saved\_e: 0.0  
> > gcode:  
> > {% if printer.pause\_resume.is\_paused %}  
> > {% set km = printer[“gcode\_macro \_km\_globals”] %}  
> > # Warm the extruder back up if needed.  
> > {% set extruder = printer[printer.toolhead.extruder] %}  
> > {% if extruder.target \<= printer.configfile.settings[  
> > printer.toolhead.extruder].min\_temp  
> > | float + 0.5 %}  
> > M109 S{saved\_extruder\_temp}  
> > {% endif %}
> > 
> > ```
> > # If there's no saved_e assume we're completing a filament change and
> > # retract enough to avoid drooling on the model.
> > {% if 'E' not in params and not saved_e %}
> > {% set saved_e = 5.0 %}
> > G1 E{'%.4f' % -saved_e } F{km.load_speed}
> > {% endif %}
> > 
> > SET_GCODE_VARIABLE MACRO=resume VARIABLE=saved_extruder_temp VALUE="{0}"
> > G90
> > # Move back to last position before unretracting.
> > G0 X{saved_x} Y{saved_y} F{km.travel_speed_xy}
> > G0 Z{saved_z} F{km.travel_speed_z}
> > G91
> > # Unretract
> > G1 E{'%.4f' % (params.E|default(saved_e))} F{km.load_speed}
> > RESTORE_GCODE_STATE NAME=_KM_PAUSE_OVERRIDE_STATE MOVE=1
> > _KM_RESUME_BASE
> > 
> > ```
> > 
> > {% else %}  
> > { action\_respond\_info(“Printer is not paused.”) }  
> > {% endif %}
> > 
> > [gcode\_macro CANCEL\_PRINT]  
> > description: Cancel the actual running print  
> > rename\_existing: CANCEL\_PRINT\_BASE  
> > variable\_park: True  
> > gcode:
> > 
> > ## Move head and retract only if not already in the pause state and park set to true
> > 
> > {% if printer.pause\_resume.is\_paused|lower == ‘false’ and park|lower == ‘true’%}  
> > \_TOOLHEAD\_PARK\_PAUSE\_CANCEL  
> > {% endif %}  
> > TURN\_OFF\_HEATERS  
> > CANCEL\_PRINT\_BASE
> > 
> > [gcode\_macro cancel\_print]  
> > description: Cancels the current print.  
> > Usage: CANCEL\_PRINT  
> > rename\_existing: \_KM\_CANCEL\_PRINT\_BASE  
> > gcode:  
> > {% set was\_paused = printer.pause\_resume.is\_paused %}  
> > {% if was\_paused or printer.idle\_timeout.state|string == “Printing” %}  
> > PRINT\_END  
> > SDCARD\_RESET\_FILE  
> > {% else %}  
> > { action\_respond\_info(“No print from SD card in progress.”) }  
> > {% endif %}  
> > \_KM\_CANCEL\_PRINT\_BASE  
> > {% if was\_paused %}  
> > RESTORE\_GCODE\_STATE NAME=\_KM\_PAUSE\_OVERRIDE\_STATE MOVE=0  
> > {% endif %}  
> > CLEAR\_PAUSE
> > 
> > [gcode\_macro TOOLHEAD\_PARK\_PAUSE\_CANCEL]  
> > description: Helper: park toolhead used in PAUSE and CANCEL\_PRINT  
> > variable\_extrude: 1.0  
> > gcode:
> > 
> > ##### set park positon for x and y
> > 
> > # default is your max posion from your printer.cfg
> > 
> > {% set x\_park = printer.toolhead.axis\_maximum.x|float - 5.0 %}  
> > {% set y\_park = printer.toolhead.axis\_maximum.y|float - 5.0 %}  
> > {% set z\_park\_delta = 2.0 %}
> > 
> > ##### calculate save lift position
> > 
> > {% set max\_z = printer.toolhead.axis\_maximum.z|float %}  
> > {% set act\_z = printer.toolhead.position.z|float %}  
> > {% if act\_z \< (max\_z - z\_park\_delta) %}  
> > {% set z\_safe = z\_park\_delta %}  
> > {% else %}  
> > {% set z\_safe = max\_z - act\_z %}  
> > {% endif %}
> > 
> > ##### end of definitions
> > 
> > {% if printer.extruder.can\_extrude|lower == ‘true’ %}  
> > M83  
> > G1 E-{extrude} F2100  
> > {% if printer.gcode\_move.absolute\_extrude |lower == ‘true’ %} M82 {% endif %}  
> > {% else %}  
> > {action\_respond\_info(“Extruder not hot enough”)}  
> > {% endif %}  
> > {% if “xyz” in printer.toolhead.homed\_axes %}  
> > G91  
> > G1 Z{z\_safe} F900  
> > G90  
> > G1 X{x\_park} Y{y\_park} F6000  
> > {% if printer.gcode\_move.absolute\_coordinates|lower == ‘false’ %} G91 {% endif %}  
> > {% else %}  
> > {action\_respond\_info(“Printer not homed”)}  
> > {% endif %}
> > 
> > [gcode\_macro CLEAR\_PAUSE]  
> > description: Clears the current pause state.  
> > Usage: CLEAR\_PAUSE  
> > rename\_existing: \_KM\_CLEAR\_PAUSE  
> > gcode:  
> > SET\_GCODE\_VARIABLE MACRO=resume VARIABLE=saved\_e VALUE=“{0.0}”  
> > SET\_GCODE\_VARIABLE MACRO=resume VARIABLE=saved\_extruder\_temp VALUE=“{0}”  
> > \_KM\_CLEAR\_PAUSE
> > 
> > [gcode\_macro PAUSE]  
> > rename\_existing: PAUSE\_BASE  
> > gcode:  
> > PAUSE\_BASE  
> > \_TOOLHEAD\_PARK\_PAUSE\_CANCEL

---

<div class="post-metadata">

**Author:** ![ezrollin](https://avatars.discourse-cdn.com/v4/letter/e/9de0a6/32.png) [@ezrollin](https://klipper.discourse.group/u/ezrollin)\
**Post date:** [April 6, 2023, 3:29am UTC](https://klipper.discourse.group/t/printing-resume-doesnt-work/7669/2 "2023-04-06T03:29:39Z")

</div>

[klippy.log](https://klipper.discourse.group/uploads/short-url/rrnnsyT3ZYS73SyjJegu0SrY0RM.log) (221.3 KB)

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [April 6, 2023, 1:19pm UTC](https://klipper.discourse.group/t/printing-resume-doesnt-work/7669/3 "2023-04-06T13:19:41Z")

</div>

> [@Creality Sonic Pad and Alternatives](https://klipper.discourse.group/t/creality-sonic-pad/6324):
>
> Creality Sonic Padexclamation Update Since July 11, 2023, Creality seems to have [released a firmware](https://www.creality.com/pages/download-creality-sonic-pad?spm=..page_1934481.products_display_1.1&spm_prev=..product_afecb672-1369-4c48-ba2d-f0cd762126a6.header_1.1) with a newer Klipper version. Again, they have not released the sources for this and the other components as required by the GPL license. Again, they are violating the OSS license and making money off the work of others. Background The Creality Sonic Pad is intended to be a “one-stop” solution for Klipper. A SBC running Klipper along with Moonraker, Fluidd, Mainsail and KlipperScreen A …

Your best bet is to contact Creality support

---

<div class="post-metadata">

**Author:** ![theophile](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/theophile/32/31_2.png) [@theophile](https://klipper.discourse.group/u/theophile)\
**Post date:** [April 6, 2023, 1:56pm UTC](https://klipper.discourse.group/t/printing-resume-doesnt-work/7669/4 "2023-04-06T13:56:03Z")

</div>

This looks like someone tried to install @jschuh macros but didn’t do it correctly.

> **[GitHub - jschuh/klipper-macros: A collection of useful macros for the Klipper...](https://github.com/jschuh/klipper-macros)**
>
> A collection of useful macros for the Klipper 3D printer firmware - GitHub - jschuh/klipper-macros: A collection of useful macros for the Klipper 3D printer firmware

---

<div class="post-metadata">

**Author:** ![ezrollin](https://avatars.discourse-cdn.com/v4/letter/e/9de0a6/32.png) [@ezrollin](https://klipper.discourse.group/u/ezrollin)\
**Post date:** [April 6, 2023, 2:16pm UTC](https://klipper.discourse.group/t/printing-resume-doesnt-work/7669/5 "2023-04-06T14:16:46Z")

</div>

> [@Creality Sonic Pad and Alternatives](https://klipper.discourse.group/t/creality-sonic-pad-and-alternatives/6324/1):
>

> **[Configuration](https://docs.mainsail.xyz/setup/configuration)**
>
> Mainsail requires a minimum configuration to function properly and will display a warning at startup if the required parts are not found in your configuration file(s).

Nah, it came from:  
But I think I got it working with someone else’s code instead  
thanks

---

<div class="post-metadata">

**Author:** ![jschuh](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jschuh](https://klipper.discourse.group/u/jschuh)\
**Post date:** [April 6, 2023, 2:43pm UTC](https://klipper.discourse.group/t/printing-resume-doesnt-work/7669/6 "2023-04-06T14:43:01Z")

</div>

I’m pretty certain those `_km_globals` errors were somehow copied from my macros, but either way glad you got something working.

FWIW, I’ve already gotten reports that my macros break on the Sonic Pad. Turns out the Klipper fork is too old to support `SET_PRINT_STATS_INFO`.

---

<div class="post-metadata">

**Author:** ![karatsu](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/karatsu/32/5069_2.png) [@karatsu](https://klipper.discourse.group/u/karatsu)\
**Post date:** [April 17, 2023, 12:38pm UTC](https://klipper.discourse.group/t/printing-resume-doesnt-work/7669/7 "2023-04-17T12:38:37Z")

</div>

FYI the macros of jschuh are working ok on sonic pad using version 0.5.3 except the layer that is from version 0.4.8 and also need to remove M600 macro else duplicate

if there’s a mailing or a place to request Creality to update Klipper on sonic pad i would be happy to +1

---

<div class="post-metadata">

**Author:** ![EddyMI3D](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/eddymi3d/32/1981_2.png) [@EddyMI3D](https://klipper.discourse.group/u/EddyMI3D)\
**Post date:** [August 5, 2024, 10:26am UTC](https://klipper.discourse.group/t/printing-resume-doesnt-work/7669/8 "2024-08-05T10:26:24Z")

</div>


