Raspberry Pi — Klipper and Moonraker Quick Reference
raspberry piklippermoonraker3d printingconfigurationcommands1c3d
Markdown
Raspberry Pi — Klipper and Moonraker Quick Reference
Klipper is a 3D printer firmware that runs on a Raspberry Pi. Moonraker is the API server that bridges Klipper to web interfaces (Mainsail, Fluidd) and remote slicers.
Key File Paths
| File | Location | Purpose |
|---|---|---|
| printer.cfg | ~/printer_data/config/printer.cfg | Main printer configuration |
| moonraker.conf | ~/printer_data/config/moonraker.conf | Moonraker API settings |
| Klipper log | ~/printer_data/logs/klippy.log | Klipper error and debug log |
| Moonraker log | ~/printer_data/logs/moonraker.log | Moonraker API log |
Service Commands
# Restart Klipper (after config changes)
sudo systemctl restart klipper
# Restart Moonraker
sudo systemctl restart moonraker
# Check Klipper status
sudo systemctl status klipper
# Watch Klipper log live
tail -f ~/printer_data/logs/klippy.log
# Update Klipper
cd ~/klipper && git pull
sudo systemctl restart klipper
Klipper Console Commands (via Mainsail or Fluidd)
| Command | What it does |
|---|---|
FIRMWARE_RESTART | Restart Klipper firmware |
RESTART | Soft restart |
STATUS | Show printer status |
HOME | Home all axes |
G28 | Home all axes (GCode) |
G28 X Y | Home X and Y only |
G28 Z | Home Z only |
BED_MESH_CALIBRATE | Run bed mesh leveling |
BED_MESH_CLEAR | Clear active mesh |
SCREWS_TILT_CALCULATE | Calculate manual screw adjustments |
PID_CALIBRATE HEATER=extruder TARGET=220 | Run PID tuning |
SAVE_CONFIG | Save calibration results to printer.cfg |
SET_PRESSURE_ADVANCE ADVANCE=0.05 | Set pressure advance value |
TUNING_TOWER COMMAND=SET_PRESSURE_ADVANCE PARAMETER=ADVANCE START=0 STEP_DELTA=0.005 STEP_HEIGHT=5 | Pressure advance tuning tower |
Moonraker API Endpoints
GET http://printer-ip/printer/info — Printer info and state
GET http://printer-ip/printer/objects/list — All queryable objects
GET http://printer-ip/printer/objects/query?extruder&heater_bed — Temps
POST http://printer-ip/printer/gcode/script — Send GCode command
GET http://printer-ip/server/files/list — List files on printer
POST http://printer-ip/server/files/upload — Upload file to printer
Common printer.cfg Sections
[stepper_x]
step_pin: PC2
dir_pin: PB9
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA5
position_endstop: 0
position_max: 235
homing_speed: 50
[extruder]
step_pin: PB4
dir_pin: PB3
enable_pin: !PC3
microsteps: 16
rotation_distance: 33.500
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA1
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC5
control: pid
pid_kp: 21.527
pid_ki: 1.063
pid_kd: 108.982
min_temp: 0
max_temp: 260
[bed_mesh]
speed: 120
mesh_min: 10, 10
mesh_max: 225, 225
probe_count: 5, 5
algorithm: bicubic
Links
- Klipper docs
- Moonraker docs
- Mainsail UI
- KIAUH installer — easiest way to install Klipper stack