How to install klipper - markniu/PandaPi GitHub Wiki

For PandaPI board(>=V2.8 2012/3),Schematic

Prepping an OS image

After Flashing OS image, it will be necessary to ssh into the target machine to run a handful of system commands. If using a Linux or MacOS desktop, then the “ssh” software should already be installed on the desktop. There are free ssh clients available for other desktops (eg,secureCRT, PuTTY). Use the ssh utility to connect to the Raspberry Pi (ssh pi@octopi – password is “raspberry”) and run the following commands:

git clone https://github.com/KevinOConnor/klipper

sudo nano ./klipper/scripts/install-octopi.sh

and comment the line # sudo apt-get update in the install-octopi.sh,and save.

./klipper/scripts/install-octopi.sh

The above will download Klipper, install some system dependencies, setup Klipper to run at system startup, and start the Klipper host software. It will require an internet connection and it may take a few minutes to complete.

if there is error like this:

dpkg: unrecoverable fatal error, aborting: files list file for package 'nodejs' is missing final newline

please run

sudo mv /var/lib/dpkg/info/nodejs.list .

and then try again.

Building and flashing the micro-controller

  • To compile the micro-controller code, start by running these commands on the Raspberry Pi:
cd ~/klipper/
make menuconfig

Select the appropriate micro-controller and review any other options provided. menuconfig

Once configured, run:

make

Flashing the micro-controller

Configure the hardware with jumppers and line (you can remove that yellow line after flashing which is only used for resetting mcu when flashing)

then open browser enter http://your_raspberryPI_IP:8181, click the "Run Klipper mode",it will flashing the MCU

Configuring OctoPrint to use Klipper

The OctoPrint web server needs to be configured to communicate with the Klipper host software. Using a web browser, login to the OctoPrint web page and then configure the following items:

Navigate to the Settings tab (the wrench icon at the top of the page). Under “Serial Connection” in “Additional serial ports” add “/tmp/printer”. Then click “Save”.

Enter the Settings tab again and under “Serial Connection” change the “Serial Port” setting to “/tmp/printer”.

In the Settings tab, navigate to the “Behavior” sub-tab and select the “Cancel any ongoing prints but stay connected to the printer” option. Click “Save”.

From the main page, under the “Connection” section (at the top left of the page) make sure the “Serial Port” is set to “/tmp/printer” and click “Connect”. (If “/tmp/printer” is not an available selection then try reloading the page.)

Once connected, navigate to the “Terminal” tab and type “status” (without the quotes) into the command entry box and click “Send”. The terminal window will likely report there is an error opening the config file - that means OctoPrint is successfully communicating with Klipper. Proceed to the next section.

Configuring Klipper

nano ~/printer.cfg

copy the following to the printer.cfg.
after that run sudo service klipper restart restart klipper

printer.cfg for PandaPiV2.8

[stepper_x]
step_pin: PB8
dir_pin: PB6
enable_pin: !PB9
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA3
position_endstop: 0
position_max: 235
homing_speed: 50

[stepper_y]
step_pin: PB5
dir_pin: PB4
enable_pin: !PB9
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA4
position_endstop: 0
position_max: 235
homing_speed: 50

[stepper_z]
step_pin: PB3
dir_pin: !PA15
enable_pin: !PB9
microsteps: 16
rotation_distance: 4
endstop_pin: ^PA1
position_endstop: 0.0
position_max: 250

[extruder]
step_pin: PB15
dir_pin: !PB14
enable_pin: !PB9
microsteps: 16
rotation_distance: 33.683
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB12
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PB0
control: pid
pid_Kp: 21.527
pid_Ki: 1.063
pid_Kd: 108.982
min_temp: 0
max_temp: 250

[heater_bed]
heater_pin: PB13
sensor_type: ATC Semitec 104GT-2
sensor_pin: PB1
control: pid
pid_Kp: 54.027
pid_Ki: 0.770
pid_Kd: 948.182
min_temp: 0
max_temp: 130

[fan]
pin: PA9

[heater_fan hotend_fan]
pin :PA8

[mcu]
serial:/dev/serial0
baud = 115200
#serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00

[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100

printer.cfg for PandaPi V2.9

[stepper_x]
step_pin: PC11
dir_pin: PB6
enable_pin: !PC12
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA3
position_endstop: 0
position_max: 235
homing_speed: 50

[stepper_y]
step_pin: PB5
dir_pin: PB4
enable_pin: !PC12
microsteps: 16
rotation_distance: 40
endstop_pin: ^PC9
position_endstop: 0
position_max: 235
homing_speed: 50

[stepper_z]
step_pin: PB3
dir_pin: !PA15
enable_pin: !PC12
microsteps: 16
rotation_distance: 4
endstop_pin: ^PA1
position_endstop: 0.0
position_max: 250

[extruder]
step_pin: PB15
dir_pin: !PB14
enable_pin: !PC12
microsteps: 16
rotation_distance: 33.683
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB12
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PB0
control: pid
pid_Kp: 21.527
pid_Ki: 1.063
pid_Kd: 108.982
min_temp: 0
max_temp: 250

[heater_bed]
heater_pin: PB13
sensor_type: ATC Semitec 104GT-2
sensor_pin: PB1
control: pid
pid_Kp: 54.027
pid_Ki: 0.770
pid_Kd: 948.182
min_temp: 0
max_temp: 130

[fan]
pin: PA9

[heater_fan hotend_fan]
pin :PA8

[mcu]
serial:/dev/serial0
baud = 115200
#serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00

[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5

Wiring:

put the jumpers on the H4 to Klipper printing mode.