<p>Marlin firmware has such a feature that can be enabled to resume printing after a power outage.</p>
<p>To enable power-loss recovery you should send</p>
<pre><code>M413 S1 
</code></pre>
<p>to the printer using a console (e.g. using Pronterface, OctoPrint, Repetier-host, etc.) or put commands in a text file with extension <code>.g</code> that can be printed from SD card. To disable power-loss recovery send/print:</p>
<pre><code>M413 S0 
</code></pre>
<p>To report the state of the power-loss recovery, send through a console:</p>
<pre><code>M413
</code></pre>
<p>This will result in a returning message in the console of e.g. <code>This Power-loss recovery ON</code>.</p>
<p>To retain the setting, you can use <code>M500</code> to store it in memory.</p>
<hr />
<p>If you enable <code>M413</code> in Marlin firmware, the printer will write a resume printing file to SD card e.g. every layer.</p>
<p>From <a href="http://marlinfw.org/docs/gcode/M413.html" rel="nofollow noreferrer">M413 - Power-loss Recovery documentation</a> I quote:</p>
<blockquote>
<p>Enable or disable the Power-loss Recovery feature. When this feature is enabled, the state of the current print job (SD card only) will be saved to a file on the SD card. If the machine crashes or a power outage occurs, the firmware will present an option to Resume the interrupted print job. In Marlin 2.0 the <code>POWER_LOSS_RECOVERY</code> option must be enabled.</p>
<p>This feature operates without a power-loss detection circuit by writing to the recovery file periodically (e.g., once per layer), or if a <code>POWER_LOSS_PIN</code> is configured then it will write the recovery info only when a power-loss is detected. The latter option is preferred, since constant writing to the SD card can shorten its life, and the print will be resumed where it was interrupted rather than repeating the last layer. (Future implementations may allow use of the EEPROM or the on-board SD card.)</p>
</blockquote>
<p>This means if you cut the power you can resume the print layer, the only problem is that the part must remain attached to the plate, if it comes loose it is hard to resume printing. This feature is now commonly found on printers these days.</p>
<p>The regular pause and resume functionality of the printer will not work when the power is cut over night, i.e. no recovery file is written in such a case.</p>

CC BY-SA 4.0
2019-07-13T14:45:21.060Z
2019-07-13T15:02:15.387Z
2020-06-18T08:29:41.667Z
0scar
<p>Standard Marlin has one problem: when the power suddenly is gone, the print is gone. Prusa and many china printers however come with "Power Loss Recovery" or "Power Out Protection" or similar. But especially China printers come without <a href="https://3dprinting.stackexchange.com/questions/8466/what-is-thermal-runaway-protection">Thermal Runaway Protection</a>, so in order to make the printer safe, one often has to get rid of TRP (in the basic shape it comes).</p>

<p><strong>How can the PLR be turned on?</strong></p>

<marlin><firmware><knowledgebase>
How to activate Power Loss Recovery in Marlin?
Trish
# How to activate Power Loss Recovery in Marlin?

(Asked by: username_0 on 2019-07-13)

Standard Marlin has one problem: when the power suddenly is gone, the print is gone. Prusa and many china printers however come with "Power Loss Recovery" or "Power Out Protection" or similar. But especially China printers come without [Thermal Runaway Protection](https://3dprinting.stackexchange.com/questions/8466/what-is-thermal-runaway-protection), so in order to make the printer safe, one often has to get rid of TRP (in the basic shape it comes).

**How can the PLR be turned on?**

**Tags:** marlin, firmware, knowledgebase

---

## 1 answers

### Answer by username_1 on 2019-07-13. Score: 3 | Accepted answer

Marlin firmware has such a feature that can be enabled to resume printing after a power outage.
To enable power-loss recovery you should send
M413 S1 

to the printer using a console (e.g. using Pronterface, OctoPrint, Repetier-host, etc.) or put commands in a text file with extension .g that can be printed from SD card. To disable power-loss recovery send/print:
M413 S0 

To report the state of the power-loss recovery, send through a console:
M413

This will result in a returning message in the console of e.g. This Power-loss recovery ON.
To retain the setting, you can use M500 to store it in memory.

If you enable M413 in Marlin firmware, the printer will write a resume printing file to SD card e.g. every layer.
From M413 - Power-loss Recovery documentation I quote:

Enable or disable the Power-loss Recovery feature. When this feature is enabled, the state of the current print job (SD card only) will be saved to a file on the SD card. If the machine crashes or a power outage occurs, the firmware will present an option to Resume the interrupted print job. In Marlin 2.0 the POWER_LOSS_RECOVERY option must be enabled.
This feature operates without a power-loss detection circuit by writing to the recovery file periodically (e.g., once per layer), or if a POWER_LOSS_PIN is configured then it will write the recovery info only when a power-loss is detected. The latter option is preferred, since constant writing to the SD card can shorten its life, and the print will be resumed where it was interrupted rather than repeating the last layer. (Future implementations may allow use of the EEPROM or the on-board SD card.)

This means if you cut the power you can resume the print layer, the only problem is that the part must remain attached to the plate, if it comes loose it is hard to resume printing. This feature is now commonly found on printers these days.
The regular pause and resume functionality of the printer will not work when the power is cut over night, i.e. no recovery file is written in such a case.


---

