Klipper Installation¶
Welcome to the complete guide for installing and configuring Klipper.
This manual was created to help you set up a dedicated Klipper machine from scratch, using the command line. Each part of the guide is designed to be as clear and simple as possible, with practical examples and all necessary commands.
Prerequisites¶
Before you start, make sure you have the following:
- The Debian Netinstall image with non-free firmware.
- A USB stick with at least 4GB capacity.
- The machine where you will install Debian and its USB Wi-Fi adapter.
Part 1: Install Debian (OS)¶
-
Prepare the USB Stick:
- Use a program like BalenaEtcher or Rufus to write the Debian image to the USB stick.
-
Start the Installation:
- Plug the USB stick into the computer and boot from it (you may need to change the boot order in BIOS/UEFI).
-
Set User and Password:
- Follow the installer instructions. When prompted to set the
rootpassword, usemachines. - When creating a user, set the username as
mymachinesand the password asmachines. - (Note: During installation, when asked about the network, choose "Do not configure the network now." We'll do this later to avoid conflicts.)
- Follow the installer instructions. When prompted to set the
-
Software Selection:
- When you reach the "Software selection" screen, it is crucial to deselect all desktop environment options (like GNOME, KDE Plasma, etc.).
- For a command-line-only installation, make sure only the following options are selected:
- SSH server
- Standard system utilities
Part 2: Configure Superuser Access¶
After installation, your user (mymachines) does not have permissions to run administrator commands. Let's fix that.
-
Log in as
root:- Open the Terminal.
- Switch to the
rootuser with the following command and use the password you set forroot(machines).
-
Install
sudo:- Now that you have administrator permissions, install the
sudopackage.
- Now that you have administrator permissions, install the
-
Add User to
sudoGroup:- Add your user
mymachinesto the administrators group.
- Add your user
-
Exit
rootand Reboot:- For the changes to take effect, exit the
rootsession and reboot the machine.
- For the changes to take effect, exit the
Part 3: Configure Wi-Fi Connection¶
After the machine has rebooted, log in with your user (mymachines). Do not plug in the network cable!
-
Find the Wi-Fi Interface Name:
- Open the Terminal and run the following command:
- Look for an interface that starts with
wl. The name of your interface iswlxc4e984ddf898.
-
Install Essential Packages:
- For Wi-Fi to work, we need
wpa_supplicantand the DHCP client. - You also need to create the
wpa_supplicantconfiguration directory.
- For Wi-Fi to work, we need
-
Generate the Wi-Fi Configuration File:
- This command generates a secure configuration file with your encrypted password. Replace
"YourSSID"and"YourPASSWORD"with your details.
- This command generates a secure configuration file with your encrypted password. Replace
-
Configure
interfacesfor Automatic Connection:- Open the network configuration file.
- At the end of the file, add these lines to ensure the connection is established automatically at boot.
- Save (
Ctrl + O,Enter) and exit (Ctrl + X).
-
Restart the Networking Service:
- For the changes to take effect.
-
Check the Connection:
- Use the
ip acommand again. Your interfacewlxc4e984ddf898should have an IP address.
- Use the
Part 4: Access the Machine Remotely (SSH)¶
Since you selected the option to install the SSH server during OS installation, you don't need to install it manually. Just connect.
- Access the Machine Remotely:
- From another computer, use the Terminal, PowerShell, or
cmdto connect. Replace the IP address with the one your Debian machine obtained in the previous step. - Enter the password for user
mymachines(machines) when prompted. - (Note: If the connection fails, the SSH server may not have been installed correctly. In that case, you can install it manually with
sudo apt install openssh-server -y.)
- From another computer, use the Terminal, PowerShell, or
Part 5: Install Klipper and Its Components¶
-
Install
git:gitis essential. If it is not installed, usesudoto install it.
-
Run the Automatic Installer:
- Navigate to your home folder and download the
kiauhscript.
- Navigate to your home folder and download the
-
Install the Components:
- In the
kiauhmenu, select1(Install) and choose the components in the following order:- Klipper
- Moonraker
- Mainsail (or Fluidd, as you prefer)
- In the
-
Install the Firmware on the Printer Board:
- Go back to the main menu and select
4(Build/Flash Firmware).kiauhwill guide the process. This step is crucial and varies depending on your controller board.
- Go back to the main menu and select
Part 6: Configure and Access Klipper¶
-
Access the Web Interface:
- Open your favorite web browser and, in the address bar, type the IP address of your Debian machine.
- The Mainsail interface should load.
-
Final Configuration:
- In the Mainsail interface, the last step is to upload your configuration file (
printer.cfg) in the "Configuration" section.
- In the Mainsail interface, the last step is to upload your configuration file (
Part 7: Install Firmware on MCUs and Configure in Mainsail¶
-
Install Firmware on MCUs
- For Klipper to communicate with your boards, you need to flash the firmware. Even if you have already done this, it is a crucial step in the process.
- Make sure your MCUs are connected to the Debian computer via USB.
- Open the terminal, navigate to the
kiauhfolder, and start the script: - In the
kiauhmenu, select option4(Build/Flash Firmware) and follow the on-screen instructions to compile and install the firmware on each of your boards (the main and the heated bed).
-
Find the MCU Address
- After the firmware is installed, you need to find the correct USB ports. Run the following command in the Terminal to list the devices.
- The command should return the path for your MCUs. You will see a path for each board. Example:
/dev/serial/by-id/usb-Klipper_lpc1768_123456789ABC-if00(for the main MCU)/dev/serial/by-id/usb-Klipper_lpc1768_987654321DEF-if00(for the heated bed MCU)
-
Add the Addresses to the
printer.cfgFile (in Mainsail)- In the Mainsail web interface, click the "Configuration" icon (usually a screwdriver).
- In the left menu, select the
printer.cfgfile. - Edit the MCUs section in the file, inserting the following lines. Replace the example addresses with those you found in the previous step.
- Configure Pins (Example)
- From here, you can continue configuring your printer's components. For example, when configuring the heated bed, refer to the second MCU.
Part 8: Configure Hostname for Local Access¶
-
Change the Machine Name
- Open the
/etc/hostnamefile withnanoandsudo: - Delete what is there and write only the new name:
- Save (
Ctrl + O,Enter) and exit (Ctrl + X).
- Open the
-
Edit the
hostsFile- Open the
/etc/hostsfile withnanoandsudo: - Look for the line that starts with
127.0.1.1and make sure the namemy-giga1m3is at the end of the line, or add the following line if it does not exist. - Save (
Ctrl + O,Enter) and exit (Ctrl + X).
- Open the
-
Install the
AvahiService (mDNS)- This is the crucial step for the
.localname to work.Avahiis the service that enables name resolution on your local network. - The service will be activated automatically after installation.
- This is the crucial step for the
-
Reboot Your Machine
- For all changes to take effect, you need to reboot the system.