This is a guide for installing Klipper and Octoprint on Void Linux
I am assuming you have a printer.cfg
file in your home directory, your printer is connted via USB and you know kinda how to use a terminal.
I have made a new user pi
, to keep things as close to the raspberry-pi setup as I can. I recommend you do this as well.
To make a new user
# Login as root
su
# create the new user
useradd -m -G dialout,tty -s /bin/bash pi
Add this user to soders with visudo
command, google if you need help with vi or install nano and run EDITOR=nano visudo
form root.
You will need python2 for this to run and python3 to set it up. As of writing this python2 in Void Linux is called python
in xbps and python3 is python3
. I think they are working on making everything python3 and there is a python3 branch that I have tested and works without Python2 but I am not sure how complete that is.
- Install system dependencies
sudo xbps-install -S python python3 python3-pip python3-devel python3-setuptools git base-devel libffi-devel libyaml-devel avrdude avr-gcc avr-binutils avr-libc
- Clone Klipper Repo from github
cd ~/
git clone https://github.com/Klipper3d/klipper.git klipper
cd klipper
- Setup python-venv
python3 -m venv venv
source venv/bin/activate
- Install Dependencies
./venv/bin/python -m pip install --upgrade pip
./venv/bin/pip install -r scripts/klippy-requirements.txt
- Create runsv service(runit) direcotry and file
sudo mkdir /etc/sv/klipper
sudo touch /etc/sv/klipper/run
sudo chmod +x /etc/sv/klipper/run
- Edit the file
/etc/sv/klipper/run
#!/bin/bash
export USER=pi
export HOME=/home/pi
groups="$(id -Gn "$USER" | tr ' ' ':')"
exec chpst -u "$USER:$groups" "$HOME"/klipper/venv/bin/python "$HOME"/klipper/klippy/klippy.py "$HOME"/printer.cfg -l /tmp/klippy.log
- Enable klipper
sudo ln -srv /etc/sv/klipper /var/service
- It be a good idea to reboot too.