# Installing Klipper with KIAUH

**URL:** <https://klipper.discourse.group/t/installing-klipper-with-kiauh/10734>\
**Category:** Knowledge Base\
**Created:** [September 29, 2023, 9:44am UTC](https://klipper.discourse.group/t/installing-klipper-with-kiauh/10734 "2023-09-29T09:44:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [September 29, 2023, 9:44am UTC](https://klipper.discourse.group/t/installing-klipper-with-kiauh/10734/1 "2023-09-29T09:44:27Z")

</div>

# Preface

The official installation instructions use Octoprint as a control interface. Nowadays, most setups involve Moonraker and fluidd / Mainsail as the primary ways to interact and control a Klipper printer.  
The manual configuration of these components is quite involved, so this article will employ [KIAUH](https://github.com/dw-0/kiauh), a superb shell script that conveniently handles the initial setup process.  
This guide will only cover the basic setup, but there is a lot more to discover.

# Content

1. [Preface](https://klipper.discourse.group/t/installing-klipper-with-kiauh/10734#preface-1)

2. [Initial Considerations](https://klipper.discourse.group/t/installing-klipper-with-kiauh/10734#initial-considerations-3)

3. [Prepare the Host](https://klipper.discourse.group/t/installing-klipper-with-kiauh/10734#prepare-the-host-4)

4. [Install the Klipper Ecosystem](https://klipper.discourse.group/t/installing-klipper-with-kiauh/10734#install-the-klipper-ecosystem-9)

5. [Configuring Klipper](https://klipper.discourse.group/t/installing-klipper-with-kiauh/10734#configuring-klipper-13)

6. [Troubleshooting](https://klipper.discourse.group/t/installing-klipper-with-kiauh/10734#troubleshooting-16)

7. [Fine Tuning and Finishing Touches](https://klipper.discourse.group/t/installing-klipper-with-kiauh/10734#fine-tuning-and-finishing-touches-17)

# Initial Considerations

For better understanding, some background information:

- Klipper requires a constant and stable connection between a host process running on a personal computer and the printer board. It is common to use Single Board Computers (SBC) such as the Raspberry Pi, but any current SBC will do the job. See [Other Single Board Computers (SBC) apart from Raspberry Pis](https://klipper.discourse.group/t/other-single-board-computers-sbc-apart-from-raspberry-pis/6323) for more details.

- The Klipper concept includes several interdependent and interacting products. To gain an understanding of the system, refer to [Klipper Architecture / Ecosystem](https://klipper.discourse.group/t/klipper-architecture-ecosystem/6313).

- Some hardware, especially displays, may not have full support from Klipper. It is advisable to carefully examine the configuration files for a particular printer model to ensure that all hardware is compatible. For instance, the absence of a `[display]` section in a file strongly suggests that the printer’s stock display is not currently supported.

# Prepare The Host

On the host computer, a Linux operating system must be running.

- This guide will assume the use of a Raspberry Pi (RPi).

- If setting up a different SBC, the approach must be tailored accordingly.

- For Raspberry Pi it might be preferable to use 32bit versions, especially when using CAN setups (there are reports of issues with CAN and 64bit Kernels).

## Setting up the SD Card

1. Get, install and run the [Raspberry Pi Imager](https://www.raspberrypi.com/software/)

2. Choose the proper OS you want to use. Popular choices are

3. With the ![Pi_Img_Settings](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/f/f103d00ea58380fefc62bc7116a08c2a18da4558.png) symbol, some settings can be baked into the image that can make the setup easier:

4. Prepare the SD card and proceed to boot the RPi with it. It is advisable to connect the RPi to a monitor and keyboard. Some distributions require manual intervention to complete the setup process.

## Completing the RPi OS Setup

1. Run `sudo raspi-config`

2. Get the IP address of the RPi and write it down. To accomplish this, execute the following command:

3. Make sure your Linux is updated to the current state. Run

4. Reboot via

## OS Sanity Checks and Fixes

This is applicable not only to RPi, but to any Linux OS:

- Fix a Debian Bullseye bug leading to lost MCU serials: [Debian 11 (Bullseye) udev bug - No board or serial found](https://klipper.discourse.group/t/debian-11-bullseye-udev-bug-no-board-or-serial-found/10711)
- Disable certain unwanted Linux services that can interfere with Klipper’s operation: [BRLtty / ModemManager - Services Interfering with Klipper](https://klipper.discourse.group/t/brltty-modemmanager-services-interfering-with-klipper/10611)

## Accessing the RPi via SSH

Usually, a monitor is not connected to the RPi and administration is executed “headless” using SSH. In the previous step, the SSH server was enabled, so this access should now work with either the configured or default username, password, and IP address.  
After the initial setup is completed, most tasks can get done using the web-based interfaces. Familiarity with these tools, especially when troubleshooting, is strongly recommended.

Common tools to work with SSH are:

- Windows

- macOS

- Linux typically has the options on board already, e.g. in Nautilus, Thunar, Konqueror and the Terminal app.

# Install the Klipper Ecosystem

This chapter outlines the steps necessary to perform a basic setup of Klipper with KIAUH.

## Install and Run KIAUH

Run the following commands:

```auto
sudo apt-get install git -y
cd ~ 
git clone https://github.com/dw-0/kiauh.git
./kiauh/kiauh.sh

```

## Install Klipper and Associated Products

In KIAUH follow this simple sequence:

1. Choose `1) [Install]`

2. Choose `1) [Klipper]`

3. Followed by `2) [Moonraker]`

4. Install the web-interface of your choice: `3) [Mainsail]` and / or `4) [Fluidd]`

5. Hit `B` to go back to main menu

6. On your main personal computer, use your browser to navigate to

7. Download the appropriate configuration file for your printer / printer-board (screenshots from fluidd)

8. Open the downloaded file in a proper editor, e.g. [Notepad++](https://notepad-plus-plus.org/downloads/) (Windows only) or [Sublime Text](https://www.sublimetext.com/) (also macOS)

## Build and Flash the Firmware

In the previous step, the installation of the host components on the SBC was completed. The next task is to build and flash the firmware component on the printer-boards.

1. Carefully review the initial lines of the configuration file downloaded in the preceding step, as it contains important information.

2. To build the firmware, select _4) [Advanced]_ and then _2) [Build only]_ in KIAUH.

3. Enter the information from the configuration file in the screen that appears. To establish a connection to the board later on, it is crucial to adhere to all settings.

4. The firmware file will be generated at `~/klipper/out/klipper.bin`. Flash the board based on the instructions provided in the configuration file.

# Configuring Klipper

## Initial Configuration

1. In KIAUH call _4) [Advanced]_ and then _5) [Get MCU ID]_ or run the command

2. Copy the complete path as displayed, e.g.

3. Paste the copied address into the configuration file that has been downloaded and opened in a editor above. It should then look like:

4. Also add the web interface specific macro to the configuration file. This can either be `fluidd.cfg` or `mainsail.cfg` depending on the web interface that is used. The config shall then include a section like

5. Save the adapted configuration as `printer.cfg`

6. Upload the `printer.cfg` via the Configuration section in the web interface (Mainsail dropdown → _config_). The default path on OS level is `~/printer_data/config`  

7. Restart Klipper either via the web interface or via issuing the command `sudo systemctl restart klipper`

## Verify Basic Functionality

With the above steps, the basic setup is completed and the web interface should show the temperatures of the bed and extruder and not display any errors.

The following step should now be performed to ensure a proper basic functionality: [Configuration Checks](https://www.klipper3d.org/Config_checks.html) and, if using a BLTouch (or clone), its [Initial Tests](https://www.klipper3d.org/BLTouch.html#initial-tests).

# Troubleshooting

If there are any problems or error messages at the end of this simple installation process, it is time to troubleshoot your installation.

- Carefully work through [How-To Trouble-Shoot](https://klipper.discourse.group/t/how-to-trouble-shoot/6326/1) and check [About the Knowledge Base category / Table of Contents](https://klipper.discourse.group/t/about-the-knowledge-base-category-table-of-contents/6228/1). Almost all typical errors are covered there

- Reviewing the `klippy.log` file is necessary for all troubleshooting purposes. On the web interfaces, it’s easy to access or download and is prominently displayed on the home or dashboard page if there are any errors.

- If you encounter unanticipated or irregular behavior, the `klippy.log` can also be a helpful resource. It is always accessible via the navigation bar on the left side of the screen under _Configuration_ (fluidd) or _Machine_ (Mainsail).

- If you require aid, attach the `klippy.log` to your post at all times. Posts without the log will not receive a response. Use any compression tool like zip if the file is too big to attach.

# Fine Tuning and Finishing Touches

The following steps are optional but will enhance the printing experience and quality:

1. Check and adjust potentially [twisted X axis](https://www.klipper3d.org/Axis_Twist_Compensation.html) (requires a probe)

2. Perform [bed\_leveling](https://www.klipper3d.org/Bed_Level.html)

3. Create a [bed\_mesh](https://www.klipper3d.org/Bed_Mesh.html) (requires a probe)

4. Compensate for [detrimental resonances](https://www.klipper3d.org/Resonance_Compensation.html) (requires an Inertial Measurement Unit for the [automatic process](https://www.klipper3d.org/Measuring_Resonances.html))

5. Calibrate the [extruder’s rotation\_distance](https://www.klipper3d.org/Rotation_Distance.html#calibrating-rotation_distance-on-extruders)

6. Dial in [Pressure Advance](https://www.klipper3d.org/Pressure_Advance.html) for your filaments
