Skip to content

Commit 28f5746

Browse files
authored
Merge pull request #39 from dimalo/develop
Develop
2 parents cc3894e + 59b1be7 commit 28f5746

20 files changed

+449
-59
lines changed

.github/workflows/klipper_moonraker_multiarch.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@ on:
66
- main
77
- develop
88
schedule:
9-
- cron: "42 13 * * 0,2,5"
9+
- cron: "42 13 * * 0"
1010

1111
jobs:
12+
consecutiveness:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: mktcode/consecutive-workflow-action@e2e008186aa210faacd68ec30f6ac236f7e2f435
16+
with:
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
1219
docker:
1320
runs-on: ubuntu-latest
21+
needs: [ consecutiveness ]
1422
steps:
1523
- name: Checkout
1624
uses: actions/checkout@v2

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
printer.cfg
22
!config/printer.cfg
3-
.config
3+
.config
4+
build

.vscode/tasks.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "Build Klipper Image",
8+
"type": "shell",
9+
"command": "docker build --pull --rm -f '${workspaceFolder}/klipper/Dockerfile' -t dimalo/klipper-moonraker:next ${workspaceFolder}",
10+
"group": {
11+
"kind": "build",
12+
"isDefault": true
13+
}
14+
},
15+
{
16+
"label": "Run Klipper Image",
17+
"type": "shell",
18+
"command": "docker run -it --rm --cap-add SYS_NICE dimalo/klipper-moonraker:next",
19+
"group": {
20+
"kind": "none",
21+
"isDefault": true
22+
}
23+
}
24+
]
25+
}

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
![Mainsail Multiarch Image CI](https://github.com/dimalo/klipper-web-control-docker/workflows/Mainsail%20Multiarch%20Image%20CI/badge.svg)
22
![Klipper Moonraker Multiarch Image CI](https://github.com/dimalo/klipper-web-control-docker/workflows/Klipper%20Moonraker%20Multiarch%20Image%20CI/badge.svg)
33

4+
- [klipper-web-control-docker](#klipper-web-control-docker)
5+
- [Features](#features)
6+
- [Getting started](#getting-started)
7+
- [Install the services](#install-the-services)
8+
- [If things are running fine now...](#if-things-are-running-fine-now)
9+
- [If things are not running...](#if-things-are-not-running)
10+
- [Features not implemented or not tested (yet)](#features-not-implemented-or-not-tested-yet)
11+
- [Credits](#credits)
412
# klipper-web-control-docker
513
__Klipper with Moonraker shipped with Fluidd and/or Mainsail__
614

@@ -14,6 +22,7 @@ __Klipper with Moonraker shipped with Fluidd and/or Mainsail__
1422
- Docker multistage builds for optimized image sizes
1523
- fully integrated klipper image with moonraker enabled
1624
- startup management with supervisord & dependent startup (klipper starts first, then only if klipper is running moonraker is started)
25+
- Optionally use the klipper_z_calibration-extension
1726
- collection of useful klipper macros [see client_macros.cfg](./config/client_macros.cfg)
1827
- Nozzle prime line with random Y starting point
1928

@@ -47,7 +56,7 @@ __Klipper with Moonraker shipped with Fluidd and/or Mainsail__
4756
- supports [Fluidd](https://github.com/cadriel/fluidd)
4857
- supports [Mainsail](https://github.com/meteyou/mainsail)
4958
- you can even run both in parallel!
50-
- only your printer.cfg is required!
59+
- only your printer.cfg is required
5160
- the services start without it, so you can supply your config through the web UI
5261
- you can mount your config file to /home/klippy/.config/printer.cfg, and klipper will pick it up after a restart
5362
@@ -99,6 +108,19 @@ Run ```docker-compose build```
99108
100109
After build run ```docker-compose up -d``` and see if it works.
101110
111+
__Klipper is crashing:__
112+
113+
(from [#25](https://github.com/dimalo/klipper-web-control-docker/issues/25))
114+
115+
_Klipper crashes with log similar to:_
116+
```log
117+
klipper Fatal Python error: pyinit_main: can't initialize time
118+
klipper | Python runtime state: core initialized
119+
klipper | PermissionError: [Errno 1] Operation not permitted
120+
```
121+
122+
123+
check your libseccomp version and update if needed (see [https://docs.linuxserver.io/faq#libseccomp](https://docs.linuxserver.io/faq#libseccomp))
102124
## Features not implemented or not tested (yet)
103125
- compiling klipper.bin for your printer (will need compile tools which bloat the image so this will likely not be implemented)
104126
- automatic updates for klipper/moonraker (partly working as repos are getting updated but no dependency installs happen - update the container with ```docker-compose pull``` instead)
@@ -112,4 +134,5 @@ After build run ```docker-compose up -d``` and see if it works.
112134
- [Moonraker](https://github.com/Arksine/moonraker)
113135
- [Fluidd](https://github.com/cadriel/fluidd)
114136
- [Mainsail](https://github.com/meteyou/mainsail)
137+
- [klipper_z_calibration](https://github.com/protoloft/klipper_z_calibration)
115138
- awesome global RepRap open source community!

build_firmware.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!zsh
2+
3+
BASE=$(pwd)
4+
echo $BASE
5+
TARGET=cheetah
6+
BUILD_DIR=${BASE}/build
7+
CONFIG_NAME=".config_${TARGET}"
8+
CONFIG_PATH=${BUILD_DIR}/${CONFIG_NAME}
9+
touch ${CONFIG_PATH}
10+
OUT_DIR=${BUILD_DIR}/klipper_build_${TARGET}
11+
mkdir -p ${BUILD_DIR}
12+
CONTAINER=$(docker run -d -v ${CONFIG_PATH}:/home/klippy/klipper/.config -v ${BUILD_DIR}:/home/klippy/klipper/out klipper-builder sleep infinity)
13+
docker exec -it ${CONTAINER} make menuconfig
14+
docker exec ${CONTAINER} make
15+
#docker exec ${CONTAINER} make flash
16+
docker stop ${CONTAINER}
17+
docker rm ${CONTAINER}

config/client_macros.cfg

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,15 @@ gcode:
159159
# load filament
160160
[gcode_macro LOAD_FILAMENT]
161161
gcode:
162+
{% set E = params.E|default(400) %}
163+
162164
SAVE_GCODE_STATE NAME=loading_filament
163165
M117 Loading Filament
164166
G91 # set relative
165167
G92 E0.0
166168
LOW_TEMP_CHECK
167-
G1 E15 F120 # some extra to prime the nozzle --> slower
168-
G1 E395 F1500 # length of bowden tube till cold-end (~420mm)
169+
G1 E15 F120 # pull filament slowly into extruder
170+
G1 E{E} F1500 # length of bowden tube till cold-end (~420mm)
169171
G1 E25 F120 # some extra to prime the nozzle --> slower
170172
G92 E0.0
171173
RESTORE_GCODE_STATE NAME=loading_filament
@@ -179,14 +181,16 @@ gcode:
179181
# unload filament
180182
[gcode_macro UNLOAD_FILAMENT]
181183
gcode:
184+
{% set E = params.E|default(420) %}
185+
182186
SAVE_GCODE_STATE NAME=unloading_filament
183187
M117 Unloading Filament
184188
LOW_TEMP_CHECK
185189
G91 # set relative
186190
G1 E8 F100
187191
G1 E2 F300
188192
G1 E-10 F1800
189-
G1 E-420 F1500 # the E is the length of the bowden tube (420mm)
193+
G1 E-{E} F1500 # the E is the length of the bowden tube (420mm)
190194
G92 E0.0
191195
RESTORE_GCODE_STATE NAME=unloading_filament
192196

config/host_mcu.cfg

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# https://github.com/Klipper3d/klipper/blob/master/config/sample-raspberry-pi.cfg
2+
# This file contains an example configuration with RPi as secondary mcu
3+
4+
# See docs/Config_Reference.md for a description of parameters.
5+
6+
# The rpi microcontroller is used as secondary.
7+
# Typically, both the X and Y axes
8+
# are connected to the main micro-controller. The rpi microcontroller is used
9+
# on non time-critical functions such as enclosure sensors, additional fan or
10+
# light sources
11+
[mcu host]
12+
serial: /tmp/klipper_host_mcu

config/klipper.cfg

Lines changed: 0 additions & 4 deletions
This file was deleted.

config/moonraker.conf

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@
22
host: 0.0.0.0
33
port: 7125
44
enable_debug_logging: False
5+
6+
[file_manager]
57
config_path: /home/klippy/.config
6-
database_path: /home/klippy/.moonraker_database
8+
queue_gcode_uploads: True
9+
enable_object_processing: True
10+
11+
[job_queue]
12+
load_on_startup: True
13+
14+
[data_store]
715
temperature_store_size: 1800
816
gcode_store_size: 1000
917

18+
[database]
19+
database_path: /home/klippy/.moonraker_database
20+
1021
[authorization]
1122
cors_domains:
1223
http://*.local
@@ -26,3 +37,11 @@ trusted_clients:
2637
[update_manager]
2738
enable_repo_debug: True
2839
enable_system_updates: False
40+
41+
[machine]
42+
provider: none
43+
44+
[update_manager client z_calibration]
45+
type: git_repo
46+
path: ~/klipper_z_calibration
47+
origin: https://github.com/protoloft/klipper_z_calibration.git

config/printer.cfg

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
# This is a dummy config.
2-
# Either mount your config from host like <config_path>:/home/klippy/.config/printer.cfg or change the contents of this file in UI to match your printer!
2+
# Either mount your config from host like <config_path>:/home/klippy/.config/printer.cfg or change the contents of this file in UI to match your printer!
3+
4+
[include host_mcu.cfg]
5+
[include client.cfg]
6+
[include client_macros.cfg]
7+
[include calibration_macros.cfg]
8+
9+
# To use the klipper_z_calibration-extension uncomment the following line
10+
# Please see https://github.com/protoloft/klipper_z_calibration
11+
#[include z_calibration.cfg]

0 commit comments

Comments
 (0)