| 
									
										
										
										
											2017-04-24 09:17:35 -04:00
										 |  |  | These instructions assume the software will run on a Raspberry Pi | 
					
						
							| 
									
										
										
										
											2018-01-04 13:19:11 -05:00
										 |  |  | computer in conjunction with OctoPrint. It is recommended that a | 
					
						
							|  |  |  | Raspberry Pi 2 or Raspberry Pi 3 computer be used as the host machine | 
					
						
							|  |  |  | (see the | 
					
						
							|  |  |  | [FAQ](FAQ.md#can-i-run-klipper-on-something-other-than-a-raspberry-pi-3) | 
					
						
							|  |  |  | for other machines). | 
					
						
							| 
									
										
										
										
											2017-04-24 09:17:35 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-11 20:50:24 -04:00
										 |  |  | Klipper currently supports Atmel ATmega based micro-controllers, | 
					
						
							| 
									
										
										
										
											2018-07-08 11:01:54 -04:00
										 |  |  | Arduino Due (Atmel SAM3x8e ARM micro-controller), Smoothieboard (ARM | 
					
						
							|  |  |  | LPC176x), and [Beaglebone PRU](beaglebone.md) based printers. | 
					
						
							| 
									
										
										
										
											2016-05-25 11:37:40 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | Prepping an OS image | 
					
						
							|  |  |  | ==================== | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Start by installing [OctoPi](https://github.com/guysoft/OctoPi) on the | 
					
						
							| 
									
										
										
										
											2017-10-25 10:44:49 -04:00
										 |  |  | Raspberry Pi computer. Use OctoPi v0.14.0 or later - see the | 
					
						
							| 
									
										
										
										
											2016-05-25 11:37:40 -04:00
										 |  |  | [octopi releases](https://github.com/guysoft/OctoPi/releases) for | 
					
						
							| 
									
										
										
										
											2016-12-21 11:55:55 -05:00
										 |  |  | release information. One should verify that OctoPi boots and that the | 
					
						
							|  |  |  | OctoPrint web server works. After connecting to the OctoPrint web | 
					
						
							| 
									
										
										
										
											2018-04-09 11:39:36 -04:00
										 |  |  | page, follow the prompt to upgrade OctoPrint to v1.3.7 or later. | 
					
						
							| 
									
										
										
										
											2016-05-25 11:37:40 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-21 17:34:35 -05:00
										 |  |  | After installing OctoPi and upgrading OctoPrint, 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, | 
					
						
							|  |  |  | [PuTTY](https://www.chiark.greenend.org.uk/~sgtatham/putty/)). Use the | 
					
						
							|  |  |  | ssh utility to connect to the Raspberry Pi (ssh pi@octopi -- password | 
					
						
							|  |  |  | is "raspberry") and run the following commands: | 
					
						
							| 
									
										
										
										
											2016-05-25 11:37:40 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2017-04-20 12:30:15 -04:00
										 |  |  | git clone https://github.com/KevinOConnor/klipper | 
					
						
							|  |  |  | ./klipper/scripts/install-octopi.sh | 
					
						
							| 
									
										
										
										
											2016-05-25 11:37:40 -04:00
										 |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-20 12:30:15 -04:00
										 |  |  | 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. | 
					
						
							| 
									
										
										
										
											2016-05-25 11:37:40 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-24 09:17:35 -04:00
										 |  |  | Building and flashing the micro-controller | 
					
						
							|  |  |  | ========================================== | 
					
						
							| 
									
										
										
										
											2016-05-25 11:37:40 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-21 17:34:35 -05:00
										 |  |  | To compile the micro-controller code, start by running these commands | 
					
						
							|  |  |  | on the Raspberry Pi: | 
					
						
							| 
									
										
										
										
											2016-05-25 11:37:40 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2017-04-20 12:30:15 -04:00
										 |  |  | cd ~/klipper/ | 
					
						
							| 
									
										
										
										
											2016-05-25 11:37:40 -04:00
										 |  |  | make menuconfig | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-04 13:19:11 -05:00
										 |  |  | Select the appropriate micro-controller and review any other options | 
					
						
							| 
									
										
										
										
											2019-01-25 17:55:57 -05:00
										 |  |  | provided. Once configured, run: | 
					
						
							| 
									
										
										
										
											2016-05-25 11:37:40 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | make | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-24 09:17:35 -04:00
										 |  |  | Finally, for common micro-controllers, the code can be flashed with: | 
					
						
							| 
									
										
										
										
											2016-06-14 15:15:34 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							| 
									
										
										
										
											2017-05-01 12:08:45 -04:00
										 |  |  | sudo service klipper stop | 
					
						
							| 
									
										
										
										
											2017-04-24 09:17:35 -04:00
										 |  |  | make flash FLASH_DEVICE=/dev/ttyACM0 | 
					
						
							| 
									
										
										
										
											2017-05-01 12:08:45 -04:00
										 |  |  | sudo service klipper start | 
					
						
							| 
									
										
										
										
											2016-06-14 15:15:34 -04:00
										 |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-04 13:19:11 -05:00
										 |  |  | When flashing for the first time, make sure that OctoPrint is not | 
					
						
							|  |  |  | connected directly to the printer (from the OctoPrint web page, under | 
					
						
							|  |  |  | the "Connection" section, click "Disconnect"). The most common | 
					
						
							|  |  |  | communication device is **/dev/ttyACM0** - see the | 
					
						
							|  |  |  | [FAQ](FAQ.md#wheres-my-serial-port) for other possibilities. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-24 09:17:35 -04:00
										 |  |  | Configuring OctoPrint to use Klipper | 
					
						
							|  |  |  | ==================================== | 
					
						
							| 
									
										
										
										
											2016-05-25 11:37:40 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | The OctoPrint web server needs to be configured to communicate with | 
					
						
							| 
									
										
										
										
											2017-04-24 09:17:35 -04:00
										 |  |  | the Klipper host software. Using a web browser, login to the OctoPrint | 
					
						
							| 
									
										
										
										
											2016-05-25 11:37:40 -04:00
										 |  |  | web page, and navigate to the Settings tab. Then configure the | 
					
						
							|  |  |  | following items: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Under "Serial Connection" in "Additional serial ports" add | 
					
						
							|  |  |  | "/tmp/printer". Then click "Save". | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Enter the Settings tab again and under "Serial Connection" change the | 
					
						
							| 
									
										
										
										
											2018-04-09 11:39:36 -04:00
										 |  |  | "Serial Port" setting to "/tmp/printer". Navigate to the "Behavior" | 
					
						
							|  |  |  | sub-tab and select the "Cancel any ongoing prints but stay connected | 
					
						
							|  |  |  | to the printer" option. Click "Save". | 
					
						
							| 
									
										
										
										
											2016-05-25 11:37:40 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-24 09:17:35 -04:00
										 |  |  | From the main page, under the "Connection" section (at the top left of | 
					
						
							| 
									
										
										
										
											2017-04-20 12:30:15 -04:00
										 |  |  | the page) make sure the "Serial Port" is set to "/tmp/printer" and | 
					
						
							| 
									
										
										
										
											2016-12-21 11:55:55 -05:00
										 |  |  | 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" | 
					
						
							| 
									
										
										
										
											2017-05-03 11:14:23 -04:00
										 |  |  | (without the quotes) into the command entry box and click "Send". The | 
					
						
							|  |  |  | terminal window will likely report there is an error opening the | 
					
						
							| 
									
										
										
										
											2018-01-04 13:19:11 -05:00
										 |  |  | config file - that means OctoPrint is successfully communicating with | 
					
						
							| 
									
										
										
										
											2017-12-21 17:34:35 -05:00
										 |  |  | Klipper. Proceed to the next section. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Configuring Klipper | 
					
						
							|  |  |  | =================== | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The Klipper configuration is stored in a text file on the Raspberry | 
					
						
							|  |  |  | Pi. Take a look at the example config files in the | 
					
						
							|  |  |  | [config directory](../config/). The | 
					
						
							|  |  |  | [example.cfg](../config/example.cfg) file contains documentation on | 
					
						
							|  |  |  | command parameters and it can also be used as an initial config file | 
					
						
							|  |  |  | template. However, for most printers, one of the other config files | 
					
						
							|  |  |  | may be a more concise starting point. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Arguably the easiest way to update the Klipper configuration file is | 
					
						
							|  |  |  | to use a desktop editor that supports editing files over the "scp" | 
					
						
							|  |  |  | and/or "sftp" protocols. There are freely available tools that support | 
					
						
							|  |  |  | this (eg, Notepad++, WinSCP, and Cyberduck). Use one of the example | 
					
						
							|  |  |  | config files as a starting point and save it as a file named | 
					
						
							|  |  |  | "printer.cfg" in the home directory of the pi user (ie, | 
					
						
							|  |  |  | /home/pi/printer.cfg). | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Alternatively, one can also copy and edit the file directly on the | 
					
						
							|  |  |  | Raspberry Pi via ssh - for example: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | cp ~/klipper/config/example.cfg ~/printer.cfg | 
					
						
							|  |  |  | nano ~/printer.cfg | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Make sure to review and update each setting that is appropriate for | 
					
						
							|  |  |  | the hardware. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | After creating and editing the file it will be necessary to issue a | 
					
						
							|  |  |  | "restart" command in the OctoPrint web terminal to load the config. A | 
					
						
							|  |  |  | "status" command will report the printer is ready if the Klipper | 
					
						
							|  |  |  | config file is successfully read and the micro-controller is | 
					
						
							|  |  |  | successfully found and configured. It is not unusual to have | 
					
						
							|  |  |  | configuration errors during the initial setup - update the printer | 
					
						
							|  |  |  | config file and issue "restart" until "status" reports the printer is | 
					
						
							|  |  |  | ready. | 
					
						
							| 
									
										
										
										
											2017-04-24 09:17:35 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | Klipper reports error messages via the OctoPrint terminal tab. The | 
					
						
							|  |  |  | "status" command can be used to re-report error messages. The default | 
					
						
							|  |  |  | Klipper startup script also places a log in **/tmp/klippy.log** which | 
					
						
							|  |  |  | provides more detailed information. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | In addition to common g-code commands, Klipper supports a few extended | 
					
						
							|  |  |  | commands - "status" and "restart" are examples of these commands. Use | 
					
						
							|  |  |  | the "help" command to get a list of other extended commands. | 
					
						
							| 
									
										
										
										
											2017-10-10 12:39:06 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-12 18:46:25 -04:00
										 |  |  | After Klipper reports that the printer is ready go on to the | 
					
						
							| 
									
										
										
										
											2017-12-26 20:16:53 -05:00
										 |  |  | [config check document](Config_checks.md) to perform some basic checks | 
					
						
							|  |  |  | on the pin definitions in the config file. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-10 12:39:06 -04:00
										 |  |  | Contacting the developers | 
					
						
							|  |  |  | ========================= | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-30 15:00:00 -05:00
										 |  |  | Be sure to see the [FAQ](FAQ.md) for answers to some common questions. | 
					
						
							|  |  |  | See the [contact page](Contact.md) to report a bug or to contact the | 
					
						
							|  |  |  | developers. |