Added files for Klipper and Moonraker
This commit is contained in:
parent
77fffba94c
commit
7f813f5f99
@ -1,8 +1,18 @@
|
||||
# Klipper
|
||||
|
||||
Attempt at Klipper addon.
|
||||
|
||||
Need a frontend:
|
||||
- OctoPrint ( + OctoKlipper plugin)
|
||||
- Mainsail ( + Moonraker )
|
||||
- Fluidd ( + Moonraker )
|
||||
|
||||
Both Klipper and OctoPrint/Mainsail/Fluidd needs access to klipper_config printer.cfg folder.
|
||||
|
||||
## Ideas
|
||||
|
||||
Klipper container needs to communicate with one of:
|
||||
- OctoPrint ( + OctoKlipper plugin)
|
||||
- Moonraker
|
||||
- Fluidd
|
||||
> install git
|
||||
> add user, `useradd -ms /bin/bash docker && echo "docker:docker" | chpasswd && adduser docker sudo`
|
||||
> install sudo
|
||||
> set password, `passwd docker`
|
||||
> git clone https://github.com/th33xitus/kiauh.git
|
||||
|
||||
25
klipper/Dockerfile
Normal file
25
klipper/Dockerfile
Normal file
@ -0,0 +1,25 @@
|
||||
ARG BUILD_FROM="ghcr.io/home-assistant/amd64-base"
|
||||
|
||||
FROM ${BUILD_FROM}
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
RUN apk add --no-cache \
|
||||
git \
|
||||
py3-virtualenv \
|
||||
python3-dev \
|
||||
libffi-dev \
|
||||
build-base \
|
||||
curl-dev
|
||||
# && git clone https://github.com/KevinOConnor/klipper \
|
||||
# && git clone https://github.com/Arksine/moonraker.git
|
||||
|
||||
# RUN virtualenv klippy-env \
|
||||
# && ./klippy-env/bin/pip install -r ./klipper/scripts/klippy-requirements.txt
|
||||
|
||||
# RUN virtualenv moonraker-env \
|
||||
# && ./moonraker-env/bin/pip install -r ./moonraker/scripts/moonraker-requirements.txt
|
||||
|
||||
COPY rootfs /
|
||||
RUN chmod +x /etc/cont-init.d/*.sh
|
||||
RUN chmod +x /etc/services.d/*/*
|
||||
17
klipper/config.yaml
Normal file
17
klipper/config.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
name: "3DPrinter-Klipper"
|
||||
version: "2023.01.0"
|
||||
slug: "3dprinter-klipper"
|
||||
description: "Klipper as an addon."
|
||||
url: "https://github.com/fredrikbaberg/3dprinter-addons/tree/klipper/3dprinter-klipper"
|
||||
arch:
|
||||
- armv7
|
||||
- amd64
|
||||
- armhf
|
||||
- aarch64
|
||||
- i386
|
||||
stage: experimental
|
||||
init: false
|
||||
realtime: true
|
||||
gpio: true
|
||||
uart: true
|
||||
usb: true
|
||||
10
klipper/rootfs/etc/cont-init.d/klipper.sh
Normal file
10
klipper/rootfs/etc/cont-init.d/klipper.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
|
||||
if [ ! -d /data/klipper ]; then
|
||||
git clone https://github.com/KevinOConnor/klipper /data/klipper
|
||||
fi
|
||||
|
||||
if [ ! -d /data/klippy-env ]; then
|
||||
virtualenv /data/klippy-env
|
||||
/data/klippy-env/bin/pip install -r /data/klipper/scripts/klippy-requirements.txt
|
||||
fi
|
||||
10
klipper/rootfs/etc/cont-init.d/moonraker.sh
Normal file
10
klipper/rootfs/etc/cont-init.d/moonraker.sh
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
|
||||
if [ ! -d /data/klipper ]; then
|
||||
git clone https://github.com/Arksine/moonraker.git /data/moonraker
|
||||
fi
|
||||
|
||||
if [ ! -d /data/moonraker-env ]; then
|
||||
virtualenv /data/moonraker-env
|
||||
/data/moonraker-env/bin/pip install -r /data/moonraker/scripts/moonraker-requirements.txt
|
||||
fi
|
||||
14
klipper/rootfs/etc/services.d/klipper/run
Normal file
14
klipper/rootfs/etc/services.d/klipper/run
Normal file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
|
||||
bashio::log.info "Starting Klipper..."
|
||||
|
||||
KLIPPER_PYTHON=/data/python/klipper/bin/python
|
||||
KLIPPY=/data/src/klipper/klippy/klippy.py
|
||||
KLIPPER_CFG=/data/config/klipper/printer.cfg
|
||||
KLIPPY_LOGFILE=/tmp/klippy.log
|
||||
KLIPPY_UDS=/tmp/klippy_uds
|
||||
|
||||
touch ${KLIPPY_LOGFILE}
|
||||
touch ${KLIPPER_CFG}
|
||||
|
||||
exec ${KLIPPER_PYTHON} ${KLIPPY} ${KLIPPER_CFG} -l ${KLIPPY_LOGFILE} -a ${KLIPPY_UDS}
|
||||
19
klipper/rootfs/etc/services.d/moonraker/run
Normal file
19
klipper/rootfs/etc/services.d/moonraker/run
Normal file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
|
||||
bashio::log.info "Starting Moonraker..."
|
||||
|
||||
MOONRAKER_PYTHON=/data/python/moonraker/bin/python
|
||||
MOONRAKER=/data/src/moonraker/moonraker/moonraker.py
|
||||
if [ -f /data/config/klipper/moonraker.conf ]; then
|
||||
bashio::log.notice "Using custom moonraker.conf"
|
||||
MOONRAKER_CFG=/data/config/klipper/moonraker.conf
|
||||
else
|
||||
bashio::log.notice "Using default moonraker.conf"
|
||||
MOONRAKER_CFG=/root/config/moonraker/moonraker.conf
|
||||
fi
|
||||
MOONRAKER_LOGFILE=/tmp/moonraker.log
|
||||
|
||||
touch ${MOONRAKER_LOGFILE}
|
||||
touch ${MOONRAKER_CFG}
|
||||
|
||||
exec ${MOONRAKER_PYTHON} ${MOONRAKER} -c ${MOONRAKER_CFG} -l ${MOONRAKER_LOGFILE}
|
||||
Loading…
Reference in New Issue
Block a user