Emergency Stop
Moonriver provides quick access to emergency stop functionality for immediate printer shutdown.
M112 Command
Type M112 to immediately send an emergency stop signal:
> M112
🚨 EMERGENCY STOP TRIGGERED 🚨What Happens
When you execute M112:
- Command buffer is cleared - All queued commands are discarded
- Emergency stop signal sent - Klipper receives immediate stop command
- Motors disabled - All stepper motors are immediately disabled
- Heaters shut off - All heating elements are turned off
- Printer halted - Printer enters an error state
After Emergency Stop
After triggering M112, the printer must be reset:
Firmware Restart
> FIRMWARE_RESTARTThis resets Klipper and clears the emergency stop state.
Full Restart
Alternatively, restart the entire Klipper service:
# On the printer host (via SSH)
sudo systemctl restart klipperWhen to Use
Use emergency stop when:
- Collision imminent - Toolhead about to crash
- Fire hazard - Burning smell or visible smoke
- Runaway heating - Temperature rising uncontrollably
- Strange noises - Grinding, clicking, or unusual sounds
- Layer shift - Print visibly misaligned
- Spaghetti detected - Print has failed catastrophically
Alternative Methods
Web Interface
Most web interfaces (Mainsail, Fluidd) have an emergency stop button.
Physical Button
Some printers have a physical emergency stop button wired directly to the control board.
SSH
ssh pi@printer.local
moonriver --host localhost --port 7125 M112Response Time
Moonriver sends the M112 command immediately:
- No delay - Command sent as soon as you press Enter
- Priority handling - Bypasses command queue
- Direct WebSocket - No HTTP overhead
Typical response time: < 100ms
Prevention
While emergency stop is available, prevention is better:
Before Printing
> G28 # Home all axes
> QUERY_ENDSTOPS # Verify endstops working
> M105 # Check temperatures normalDuring Printing
Monitor:
- Temperature graphs
- Layer time estimates
- First layer adhesion
- Any unusual sounds
Regular Maintenance
> G28, BED_MESH_CALIBRATE, SAVE_CONFIGKeep printer well-maintained to reduce emergency stop needs.
Safety Tips
- Don't panic - Take a breath, then execute M112
- Stay nearby - Especially during first layer
- Monitor temperatures - Watch for thermal runaway
- Check belts - Loose belts cause layer shifts
- Verify paths - Preview G-code before printing
Recovery Procedure
After emergency stop:
Assess the situation
bash> FIRMWARE_RESTARTCheck for damage
- Inspect toolhead, bed, wiring
- Look for melted plastic
- Check belt tension
Test basic functions
bash> M105 # Check temperature reporting > QUERY_ENDSTOPS # Verify endstopsRe-home if safe
bash> G28Resume or restart print (if appropriate)
Scripting Safety
When using Moonriver in scripts, include error handling:
#!/bin/bash
trap 'moonriver --host printer.local --port 7125 M112' ERR
# Your commands here
moonriver --host printer.local --port 7125 G28This automatically triggers emergency stop if any command fails.
Multiple Printers
Emergency stop a specific printer:
# Stop printer1
moonriver --host printer1.local --port 7125 M112
# Stop all printers
for printer in printer{1..5}.local; do
moonriver --host $printer --port 7125 M112
doneNon-Emergency Stops
For non-emergency situations:
Pause Print
> PAUSEPauses the current print without stopping completely.
Cancel Print
> CANCEL_PRINTCancels the print but keeps printer operational.
Stop Heating
> M104 S0 # Turn off extruder
> M140 S0 # Turn off bedStops heating without emergency shutdown.
Remember
M112 is for emergencies only. For normal operations, use PAUSE, CANCEL_PRINT, or regular commands.
Next Steps
- Interactive Mode - Normal printer control
- Quick Start - Common commands
- Safety Best Practices - Klipper safety guide