安装必要软件
Klipper相关的软件需要Python等软件才能运行,且需要git来同步最新的Klipper等软件源代码,所以需要使用
sudo apt install build-essential python3 python3-pip git
来安装必要的软件。
更好pip源
安装好pip后,运行
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
更换pip的源。
也可以将链接替换为下列链接中的其中之一:
# 豆瓣源
https://pypi.doubanio.com/simple
# 腾讯源
https://mirrors.cloud.tencent.com/pypi/simple
# 阿里源
https://mirrors.aliyun.com/pypi/simple
如果使用树莓派,请删除
/etc/pip.conf
文件中的所有内容,否则可能会导致换源后下载依旧缓慢!
更新树莓派
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
Klipperscreen安装
执行以下命令:
cd ~/
git clone https://github.com/jordanruthe/KlipperScreen.git
cd ~/KlipperScreen
./scripts/KlipperScreen-install.sh
此脚本将安装手动安装下列出的软件包,在 创建 python 虚拟环境并安装 systemd 服务文件。
~/.KlipperScreen-env
如果需要配置文件的自定义位置,可以将 -c 或 –configfile 添加到 systemd 文件中并指定 配置文件的位置。
此时KlipperScreen应该可以工作
moonraker.conf 配置
在moonraker.conf中,确保设备的IP是受信任的客户端:
moonraker.conf
[authorization]
cors_domains:
https://my.mainsail.xyz
http://my.mainsail.xyz
http://*.local
http://*.lan
trusted_clients:
10.0.0.0/8
127.0.0.0/8
169.254.0.0/16
172.16.0.0/12
192.168.0.0/16
FE80::/10
::1/128
127.0.0.1
如果您希望使用moonraker for KlipperScreen的更新管理器功能,请将以下块添加到moonraker.conf:
[update_manager KlipperScreen]
type: git_repo
path: ~/KlipperScreen
origin: https://github.com/KlipperScreen/KlipperScreen.git
virtualenv: ~/.KlipperScreen-env
requirements: scripts/KlipperScreen-requirements.txt
system_dependencies: scripts/system-dependencies.json
managed_services: KlipperScreen
更新字体库
sudo apt-get install ttf-wqy-zenhei
或
sudo apt-get install fonts-wqy-zenhei