3D printer G-code · Marlin and Klipper

M112: Emergency stop (Marlin & Klipper)

Emergency stop — Stops everything at once and turns heaters off. The printer needs a reset (Marlin) or FIRMWARE_RESTART (Klipper) afterwards. Host software sends it when the emergency…

By cnccode · Updated
On this page
  1. What does M112 do?
  2. Example
  3. Related commands
  4. More print control commands
  5. Frequently asked questions
PropertyValue
CommandM112
FunctionEmergency stop
FirmwareMarlin and Klipper
GroupPrint control
SyntaxM112

What does M112 do?

Stops everything at once and turns heaters off. The printer needs a reset (Marlin) or FIRMWARE_RESTART (Klipper) afterwards. Host software sends it when the emergency button is pressed.

Example

G-code
M112

The command works in Marlin and Klipper. Options can differ: Klipper accepts fewer parameters for some M-codes and ignores codes it does not know with an "Unknown command" error.

More print control commands

CommandFunctionFirmware
M220Speed factorMarlin and Klipper
M600Filament changeMarlin
M412Filament runout sensorMarlin
M413Power-loss recoveryMarlin
M84Disable motors (M84 / M18)Marlin and Klipper
M400Finish movesMarlin and Klipper
M25Pause SD print (M25 / M24)Marlin
EXCLUDE_OBJECTCancel one objectKlipper
PAUSEPause, resume, cancelKlipper

Test it before you print

Paste your start code or a whole file into the 3D printer simulator. It plans every move, shows the time and finds missing waits, cold extrusion and moves outside the bed.

Open the simulator

Frequently asked questions

What does M112 do on a 3D printer?
M112 is emergency stop. Stops everything at once and turns heaters off. The printer needs a reset (Marlin) or FIRMWARE_RESTART (Klipper) afterwards. Host software sends it when the emergency button is pressed.
Does M112 work in Klipper and Marlin?
Yes, both firmwares understand M112.
Was this page helpful?