# How to edit scripts that turn off klipper?

**URL:** <https://klipper.discourse.group/t/how-to-edit-scripts-that-turn-off-klipper/19422>\
**Category:** General Discussion\
**Created:** [October 15, 2024, 5:35pm UTC](https://klipper.discourse.group/t/how-to-edit-scripts-that-turn-off-klipper/19422 "2024-10-15T17:35:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![JuanR3D](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@JuanR3D](https://klipper.discourse.group/u/JuanR3D)\
**Post date:** [October 15, 2024, 5:35pm UTC](https://klipper.discourse.group/t/how-to-edit-scripts-that-turn-off-klipper/19422/1 "2024-10-15T17:35:38Z")

</div>

### Basic Information:

Printer Model: Custom  
 MCU / Printerboard: Manta M8P v2.0  
 Host / SBC CB1  
 klippy.log

### Describe your issue:

Hi, is there a way to edit the scripts that turn off klipper, for example, when a heater is not heating as spected?  
I mean, where are these scripts located?

I’d like, under my responsability, to edit these scripts in order that my prints don’t stop under a emergency stop or a shutdown as klipper does, but just simply pause my print or something else. Is this possible?  
…

---

<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:** [October 15, 2024, 5:38pm UTC](https://klipper.discourse.group/t/how-to-edit-scripts-that-turn-off-klipper/19422/2 "2024-10-15T17:38:27Z")

</div>

> [@JuanR3D](#):
>
> for example, when a heater is not heating as spected?

You won’t do that. It’s a safety measure.

> [@JuanR3D](#):
>
> but just simply pause my print or something else.

And see your house burn down because you have not been there when the issue occurred?

---

<div class="post-metadata">

**Author:** ![JuanR3D](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@JuanR3D](https://klipper.discourse.group/u/JuanR3D)\
**Post date:** [October 15, 2024, 6:35pm UTC](https://klipper.discourse.group/t/how-to-edit-scripts-that-turn-off-klipper/19422/3 "2024-10-15T18:35:37Z")

</div>

Hi @EddyMI3D thanks for response.

Obiously, i would add the necessary procedures for this to be a safe option.  
The heating problem was just an example.

In my case, i have a large format printer and sometimes my prints can be around a week. Let’s suposse that the cable of a thermal sensor just drops, in the 6th, day so klipper turns off.  
I agree with you that safety will always be the priority, but i’d like just to add some procedure that allows me to save the print.

I have also thought about trying to include some recovery mode that just lets me resume the print, in the same point where, when restarting the machine, like when a power loss… But i think that isn’t implemented already in klipper, isn’t it?

Anyways, thanks a lot!

---

<div class="post-metadata">

**Author:** ![mykepredko](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/mykepredko/32/2085_2.png) [@mykepredko](https://klipper.discourse.group/u/mykepredko)\
**Post date:** [October 15, 2024, 7:25pm UTC](https://klipper.discourse.group/t/how-to-edit-scripts-that-turn-off-klipper/19422/4 "2024-10-15T19:25:56Z")

</div>

> [@JuanR3D](#):
>
> Let’s suposse that the cable of a thermal sensor just drops, in the 6th, day so klipper turns off.

Disclaimer: In this reply, I’m not trying to be argumentative, I’m genuinely curious about your thought process here.

Can you explain why losing a thermal sensor and not shutting down is not a problem?

There are three cases here that need to be considered:

1. The connection to the thermistor breaks and the readings are invalid.
2. The relevant heater is stuck on and the monitored temperature goes high with the thermistor indicating what you would consider an invalid reading. If this is ignored then you risk damage to the heater element and the model being printed is ruined as well as a fire.
3. The relevant heater fails and the monitored temperature drops which indicates what you would consider an invalid reading. This causes the model to be ruined. There’s also risk of damage to the hot end and its drive mechanism when the model is displaced off the cold build surface or it collides with a solid mass of plastic.

I would think that the appropriate solution, rather than disable to heater safety checks, is to make sure that your thermistor wiring is properly routed and protected against pinches, snags, mechanical fatigue and abrasive wear. I don’t see why this is a problem as I’ve run my printers for tens of thousands of hours without ever having a thermistor (or, honestly any other wire) failure.

---

<div class="post-metadata">

**Author:** ![JuanR3D](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@JuanR3D](https://klipper.discourse.group/u/JuanR3D)\
**Post date:** [October 15, 2024, 8:59pm UTC](https://klipper.discourse.group/t/how-to-edit-scripts-that-turn-off-klipper/19422/5 "2024-10-15T20:59:10Z")

</div>

Hi @mykepredko .

Losing a thermal sensor is a problem, and as you say, it’s weird that this happens if wiring is properly routed.

What i want to do is to modify it so it doesn’t shut down klipper, but yes it pauses my print, shuts down any heater, and activates a liquid cooling system i have integrated in my printer. (btw i have this component defined as a temperature\_fan and shutdown\_speed: 1.0 but it doesn’t activate in shutdown state, i dunno why, but this is another discourse).

I have come to this discourse because when using a PT1000 with MAX 31865, sometimes when doing some restart, i had spikes in the thermal value, as mentioned in this discourse [Ebb36 Temp sensor spikes on Klipper restart](https://klipper.discourse.group/t/ebb36-temp-sensor-spikes-on-klipper-restart/11601/1)

This was very anoying as sometimes i just couldn’t start my machine as it was doing spikes all time and sending klipper to shut down state.

For now i have modified the way i read those pt1000, so i dont have that problem, but i’d like to modify the scripts for my machine anyways.

---

<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:** [October 15, 2024, 9:05pm UTC](https://klipper.discourse.group/t/how-to-edit-scripts-that-turn-off-klipper/19422/6 "2024-10-15T21:05:19Z")

</div>

> [@JuanR3D](#):
>
> shuts down any heater,

You know that a lot of filament detaches from the print bed when it gets cold?

---

<div class="post-metadata">

**Author:** ![JuanR3D](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@JuanR3D](https://klipper.discourse.group/u/JuanR3D)\
**Post date:** [October 15, 2024, 9:09pm UTC](https://klipper.discourse.group/t/how-to-edit-scripts-that-turn-off-klipper/19422/7 "2024-10-15T21:09:41Z")

</div>

Hi, yes. That was just a fast response for the example.

I have to define very well which things must shut down when this happens and any actions i command, etc. Also, a lot of testing after all.

---

<div class="post-metadata">

**Author:** ![JuanR3D](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@JuanR3D](https://klipper.discourse.group/u/JuanR3D)\
**Post date:** [October 15, 2024, 9:58pm UTC](https://klipper.discourse.group/t/how-to-edit-scripts-that-turn-off-klipper/19422/8 "2024-10-15T21:58:28Z")

</div>

Also, mention that my machine is not a basic and dumb printer as many desktop printers. It is a industrial printer, so it includes a lot of additional safety components (hardware, electromechanical, thermocontact, relays, closed loop motors, and all kind of elements) that control in a safer and faster way some possible faults, so, essentially, the most important parts are protected by these elements.

---

<div class="post-metadata">

**Author:** ![JuanR3D](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@JuanR3D](https://klipper.discourse.group/u/JuanR3D)\
**Post date:** [October 17, 2024, 6:31am UTC](https://klipper.discourse.group/t/how-to-edit-scripts-that-turn-off-klipper/19422/9 "2024-10-17T06:31:24Z")

</div>

So…Do you know where are these files located, or even more, what are their names? @EddyMI3D @mykepredko

---

<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:** [October 17, 2024, 6:33am UTC](https://klipper.discourse.group/t/how-to-edit-scripts-that-turn-off-klipper/19422/10 "2024-10-17T06:33:46Z")

</div>

It is that deep in the code, only the Devs can know.

---

<div class="post-metadata">

**Author:** ![JuanR3D](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@JuanR3D](https://klipper.discourse.group/u/JuanR3D)\
**Post date:** [October 17, 2024, 6:57am UTC](https://klipper.discourse.group/t/how-to-edit-scripts-that-turn-off-klipper/19422/11 "2024-10-17T06:57:51Z")

</div>

Ok, i’ll continue my search 😅

Thanks again.

---

<div class="post-metadata">

**Author:** ![Escrich](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/escrich/32/4603_2.png) [@Escrich](https://klipper.discourse.group/u/Escrich)\
**Post date:** [October 21, 2024, 10:36pm UTC](https://klipper.discourse.group/t/how-to-edit-scripts-that-turn-off-klipper/19422/12 "2024-10-21T22:36:21Z")

</div>

Look at my GitHub, at Cuore, or at Phoenix X86 repositories, I switch off all my printers from Klipper, via M18 gcode, once I finish print, or after 30 minutes of inactivity switches off, if the nozzle is hot, always cool it down before to switch off, or in case of a thermal malfunction or alarm.  
There are, in most of the cases some hardware, not only software, the most complex is the case of my Phoenix printer, there is a transmitter inside the printer, and a receiver outside, in order to completely cut the power, you’re invited to have a look:

> **[Escrich - Overview](https://github.com/escrich)**
>
> Working in robotics and electronics last 34 years, now using microcontrollers, and dedicated to design and build RC boats, and 3D printers - Escrich

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/klipper/original/1X/64419bf2aac6639e6ef5cef200dcd456b0a01ac3.png) [@system](https://klipper.discourse.group/u/system)\
**Post date:** [December 20, 2024, 10:37pm UTC](https://klipper.discourse.group/t/how-to-edit-scripts-that-turn-off-klipper/19422/13 "2024-12-20T22:37:05Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
