mkuf / prind

print in docker - Deploy a containerized Klipper Stack for your 3D Printer
GNU General Public License v3.0
324 stars 82 forks source link

No USB connection after printer restart #77

Closed boehser-enkel closed 1 year ago

boehser-enkel commented 1 year ago

Hi,

when my printer is turned on again klipper is not able to connect anymore. I have to restart the whole system to be able to connect again. Also after a restart i have to take down the stack and start it again. The container klipper-klipper-1 is not started and i am not able to connect when i start it manually.

System: Raspbi 4 Connection via USB Printer: Neptune 3 Pro

Greetings

GAZ082 commented 1 year ago

This is happening to me as well. Just coincidentally I had duct-taped the 5v line of the USB connector and though it was related, but looks like its not.

Perhaps this is a Klipper issue and not a prind one.

Edited: I do not see any open ticket in Klipper related to this.

mkuf commented 1 year ago

This is usually the case when the serial device changes after a printer reset (e.g. from ttyACM0 to ttyACM1) and can be mitigated by running klipper in privileged mode via your docker-compose.override.yaml like so.

services:
  klipper:
    privileged: true

If that does not fix your issue, please run scripts/get-info.sh when this is occuring again and upload the generated archive here.

boehser-enkel commented 1 year ago

The device does not seem to change. I don't need to update the entry (/dev/ttyUSB0). Also privileged mode does not help

System Info

Client: Docker Engine - Community Version: 24.0.2 Context: default Debug Mode: false Plugins: buildx: Docker Buildx (Docker Inc.) Version: v0.10.5 Path: /usr/libexec/docker/cli-plugins/docker-buildx compose: Docker Compose (Docker Inc.) Version: v2.18.1 Path: /usr/libexec/docker/cli-plugins/docker-compose

Server: Containers: 8 Running: 6 Paused: 0 Stopped: 2 Images: 21 Server Version: 24.0.2 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Using metacopy: false Native Overlay Diff: true userxattr: false Logging Driver: json-file Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
WARNING: No memory limit support
WARNING: No swap limit support
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
runc version: v1.1.7-0-g860f061
init version: de40ad0
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.1.21-v8+
Operating System: Debian GNU/Linux 11 (bullseye)
OSType: linux
Architecture: aarch64
CPUs: 4
Total Memory: 3.657GiB
Name: Pi2
ID: J4HF:HG4T:CDE4:GJKF:DQJX:DVWD:YIVY:V5EG:C34S:HWOB:Q4W3:CUWT
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

Compose Version

Docker Compose version v2.18.1

System df

TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 21 8 6.642GB 5.04GB (75%)
Containers 8 6 1.123MB 223.5kB (19%)
Local Volumes 4 2 126.6MB 121MB (95%)
Build Cache 0 0 0B 0B

Docker Images

REPOSITORY TAG IMAGE ID CREATED SIZE
mkuf/klipper latest 7e56075ff44c 26 hours ago 422MB
mkuf/ustreamer latest a3563f752ab7 27 hours ago 99.2MB
mkuf/moonraker latest 8b9147f2aba6 27 hours ago 265MB
mkuf/klipper 20d3afec3716 7 days ago 422MB
mkuf/ustreamer 51b10afdab01 7 days ago 99.2MB
mkuf/moonraker 88d1bc39bf6b 7 days ago 261MB
octoprint/octoprint latest 878617efca8a 2 weeks ago 891MB
octoprint/octoprint minimal 44b8f49c32b9 2 weeks ago 705MB
portainer/agent latest 7d34ff3ed0ee 2 weeks ago 187MB
busybox latest f92f3ea6e4a8 2 weeks ago 3.72MB
ghcr.io/mainsail-crew/mainsail edge b226040779c1 2 weeks ago 50.5MB
ghcr.io/fluidd-core/fluidd latest 85f571a1701b 3 weeks ago 52MB
portainer/agent 1d67e5a81fb6 5 weeks ago 187MB
portainer/agent d1c5a5411302 7 weeks ago 187MB
octoprint/octoprint dc0d016366f6 3 months ago 889MB
octoprint/octoprint 1e02d588831a 3 months ago 887MB
portainer/agent 09bba7d0f8b5 3 months ago 178MB
portainer/agent ce9a081b32e8 3 months ago 178MB
portainer/agent e2a8e4e0c4d5 4 months ago 178MB
octoprint/octoprint 66d4b5c6bd5a 7 months ago 892MB
traefik v2.5 09bdb197fc5d 16 months ago 99MB

Disk Space

Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf
/dev/root 29G 9,3G 19G 34% /
devtmpfs 1,6G 0 1,6G 0% /dev
tmpfs 1,9G 0 1,9G 0% /dev/shm
tmpfs 749M 1,7M 748M 1% /run
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
/dev/mmcblk0p1 255M 31M 225M 13% /boot
log2ram 1,0G 134M 891M 14% /var/log
overlay 29G 9,3G 19G 34% /var/lib/docker/overlay2/5aa671f46d31c27700efbd2add684e79f68e7fb5d1674376f6f4d57c80f2e0d7/merged
overlay 29G 9,3G 19G 34% /var/lib/docker/overlay2/34e2a206dc0e0965fcc76b48b4ce4c853e4995b363a7bdea0733d955048982f4/merged
overlay 29G 9,3G 19G 34% /var/lib/docker/overlay2/d00950f3ab017077bd1a9fb0113bbaba0864fa5bace488928170834aadfe36e8/merged
overlay 29G 9,3G 19G 34% /var/lib/docker/overlay2/5babd7d8800bb7de237177f70071bdf3539d672775f2d142681571ccc763dbbe/merged
overlay 29G 9,3G 19G 34% /var/lib/docker/overlay2/579fa389e8afbb2ee9a80152a8d2666fe6f1a93971d8cfb0c9b224a42e53c242/merged
overlay 29G 9,3G 19G 34% /var/lib/docker/overlay2/458de5aecef6210dabbb9fd39e186ece17a60a748aab8265ef1368b3e90e43d7/merged
tmpfs 1,9G 60K 1,9G 1% /var/lib/docker/volumes/klipper_log/_data
tmpfs 1,9G 0 1,9G 0% /var/lib/docker/volumes/klipper_run/_data
tmpfs 375M 0 375M 0% /run/user/0
tmpfs 375M 0 375M 0% /run/user/1000

Connected devices

insgesamt 0
crw-r--r-- 1 root root 10, 235 7. Jun 08:02 autofs
drwxr-xr-x 2 root root 580 7. Jun 08:02 block
crw------- 1 root root 10, 234 7. Jun 08:02 btrfs-control
drwxr-xr-x 3 root root 60 1. Jan 1970 bus
crw------- 1 root root 10, 126 7. Jun 08:02 cachefiles
crw-rw---- 1 root video 237, 0 7. Jun 08:02 cec0
crw-rw---- 1 root video 237, 1 7. Jun 08:02 cec1
drwxr-xr-x 2 root root 3400 7. Jun 08:03 char
crw--w---- 1 root tty 5, 1 7. Jun 08:02 console
crw------- 1 root root 10, 123 7. Jun 08:02 cpu_dma_latency
crw------- 1 root root 10, 203 7. Jun 08:02 cuse
drwxr-xr-x 7 root root 140 7. Jun 08:02 disk
drwxr-xr-x 2 root root 80 1. Jan 1970 dma_heap
drwxr-xr-x 3 root root 120 7. Jun 08:02 dri
lrwxrwxrwx 1 root root 13 22. Dez 12:55 fd -> /proc/self/fd
crw-rw-rw- 1 root root 1, 7 7. Jun 08:02 full
crw-rw-rw- 1 root root 10, 229 7. Jun 08:02 fuse
crw-rw---- 1 root gpio 254, 0 7. Jun 08:02 gpiochip0
crw-rw---- 1 root gpio 254, 1 7. Jun 08:02 gpiochip1
crw-rw---- 1 root gpio 245, 0 7. Jun 08:02 gpiomem
crw------- 1 root root 10, 183 7. Jun 08:02 hwrng
lrwxrwxrwx 1 root root 12 22. Dez 12:55 initctl -> /run/initctl
drwxr-xr-x 4 root root 160 7. Jun 08:02 input
crw-r--r-- 1 root root 1, 11 7. Jun 08:02 kmsg
crw-rw---- 1 root kvm 10, 232 7. Jun 08:02 kvm
lrwxrwxrwx 1 root root 28 22. Dez 12:55 log -> /run/systemd/journal/dev-log
brw-rw---- 1 root disk 7, 0 7. Jun 08:02 loop0
brw-rw---- 1 root disk 7, 1 7. Jun 08:02 loop1
brw-rw---- 1 root disk 7, 2 7. Jun 08:02 loop2
brw-rw---- 1 root disk 7, 3 7. Jun 08:02 loop3
brw-rw---- 1 root disk 7, 4 7. Jun 08:02 loop4
brw-rw---- 1 root disk 7, 5 7. Jun 08:02 loop5
brw-rw---- 1 root disk 7, 6 7. Jun 08:02 loop6
brw-rw---- 1 root disk 7, 7 7. Jun 08:02 loop7
crw-rw---- 1 root disk 10, 237 7. Jun 08:02 loop-control
drwxr-xr-x 2 root root 60 7. Jun 08:02 mapper
crw-rw---- 1 root video 238, 0 7. Jun 08:02 media0
crw-rw---- 1 root video 238, 1 7. Jun 08:02 media1
crw-rw---- 1 root video 238, 2 7. Jun 08:02 media2
crw-rw---- 1 root video 238, 3 7. Jun 08:02 media3
crw-rw---- 1 root video 238, 4 7. Jun 08:02 media4
crw-rw---- 1 root video 238, 5 7. Jun 08:02 media5
crw-r----- 1 root kmem 1, 1 7. Jun 08:02 mem
brw-rw---- 1 root disk 179, 0 7. Jun 08:02 mmcblk0
brw-rw---- 1 root disk 179, 1 7. Jun 08:02 mmcblk0p1
brw-rw---- 1 root disk 179, 2 7. Jun 08:02 mmcblk0p2
drwxrwxrwt 2 root root 40 1. Jan 1970 mqueue
drwxr-xr-x 2 root root 60 7. Jun 08:02 net
crw-rw-rw- 1 root root 1, 3 7. Jun 08:02 null
crw-r----- 1 root kmem 1, 4 7. Jun 08:02 port
crw------- 1 root root 108, 0 7. Jun 08:02 ppp
crw-rw-rw- 1 root tty 5, 2 7. Jun 08:07 ptmx
drwxr-xr-x 2 root root 0 22. Dez 12:55 pts
brw-rw---- 1 root disk 1, 0 7. Jun 08:02 ram0
brw-rw---- 1 root disk 1, 1 7. Jun 08:02 ram1
brw-rw---- 1 root disk 1, 10 7. Jun 08:02 ram10
brw-rw---- 1 root disk 1, 11 7. Jun 08:02 ram11
brw-rw---- 1 root disk 1, 12 7. Jun 08:02 ram12
brw-rw---- 1 root disk 1, 13 7. Jun 08:02 ram13
brw-rw---- 1 root disk 1, 14 7. Jun 08:02 ram14
brw-rw---- 1 root disk 1, 15 7. Jun 08:02 ram15
brw-rw---- 1 root disk 1, 2 7. Jun 08:02 ram2
brw-rw---- 1 root disk 1, 3 7. Jun 08:02 ram3
brw-rw---- 1 root disk 1, 4 7. Jun 08:02 ram4
brw-rw---- 1 root disk 1, 5 7. Jun 08:02 ram5
brw-rw---- 1 root disk 1, 6 7. Jun 08:02 ram6
brw-rw---- 1 root disk 1, 7 7. Jun 08:02 ram7
brw-rw---- 1 root disk 1, 8 7. Jun 08:02 ram8
brw-rw---- 1 root disk 1, 9 7. Jun 08:02 ram9
crw-rw-rw- 1 root root 1, 8 7. Jun 08:02 random
crw-rw-r-- 1 root netdev 10, 242 7. Jun 08:02 rfkill
drwxr-xr-x 3 root root 60 7. Jun 08:03 serial
lrwxrwxrwx 1 root root 7 7. Jun 08:02 serial1 -> ttyAMA0
drwxrwxrwt 2 root root 40 22. Dez 12:55 shm
drwxr-xr-x 4 root root 280 7. Jun 08:02 snd
lrwxrwxrwx 1 root root 15 22. Dez 12:55 stderr -> /proc/self/fd/2
lrwxrwxrwx 1 root root 15 22. Dez 12:55 stdin -> /proc/self/fd/0
lrwxrwxrwx 1 root root 15 22. Dez 12:55 stdout -> /proc/self/fd/1
crw-rw-rw- 1 root tty 5, 0 7. Jun 08:02 tty
crw--w---- 1 root tty 4, 0 7. Jun 08:02 tty0
crw--w---- 1 root tty 4, 1 7. Jun 08:02 tty1
crw--w---- 1 root tty 4, 10 7. Jun 08:02 tty10
crw--w---- 1 root tty 4, 11 7. Jun 08:02 tty11
crw--w---- 1 root tty 4, 12 7. Jun 08:02 tty12
crw--w---- 1 root tty 4, 13 7. Jun 08:02 tty13
crw--w---- 1 root tty 4, 14 7. Jun 08:02 tty14
crw--w---- 1 root tty 4, 15 7. Jun 08:02 tty15
crw--w---- 1 root tty 4, 16 7. Jun 08:02 tty16
crw--w---- 1 root tty 4, 17 7. Jun 08:02 tty17
crw--w---- 1 root tty 4, 18 7. Jun 08:02 tty18
crw--w---- 1 root tty 4, 19 7. Jun 08:02 tty19
crw--w---- 1 root tty 4, 2 7. Jun 08:02 tty2
crw--w---- 1 root tty 4, 20 7. Jun 08:02 tty20
crw--w---- 1 root tty 4, 21 7. Jun 08:02 tty21
crw--w---- 1 root tty 4, 22 7. Jun 08:02 tty22
crw--w---- 1 root tty 4, 23 7. Jun 08:02 tty23
crw--w---- 1 root tty 4, 24 7. Jun 08:02 tty24
crw--w---- 1 root tty 4, 25 7. Jun 08:02 tty25
crw--w---- 1 root tty 4, 26 7. Jun 08:02 tty26
crw--w---- 1 root tty 4, 27 7. Jun 08:02 tty27
crw--w---- 1 root tty 4, 28 7. Jun 08:02 tty28
crw--w---- 1 root tty 4, 29 7. Jun 08:02 tty29
crw--w---- 1 root tty 4, 3 7. Jun 08:02 tty3
crw--w---- 1 root tty 4, 30 7. Jun 08:02 tty30
crw--w---- 1 root tty 4, 31 7. Jun 08:02 tty31
crw--w---- 1 root tty 4, 32 7. Jun 08:02 tty32
crw--w---- 1 root tty 4, 33 7. Jun 08:02 tty33
crw--w---- 1 root tty 4, 34 7. Jun 08:02 tty34
crw--w---- 1 root tty 4, 35 7. Jun 08:02 tty35
crw--w---- 1 root tty 4, 36 7. Jun 08:02 tty36
crw--w---- 1 root tty 4, 37 7. Jun 08:02 tty37
crw--w---- 1 root tty 4, 38 7. Jun 08:02 tty38
crw--w---- 1 root tty 4, 39 7. Jun 08:02 tty39
crw--w---- 1 root tty 4, 4 7. Jun 08:02 tty4
crw--w---- 1 root tty 4, 40 7. Jun 08:02 tty40
crw--w---- 1 root tty 4, 41 7. Jun 08:02 tty41
crw--w---- 1 root tty 4, 42 7. Jun 08:02 tty42
crw--w---- 1 root tty 4, 43 7. Jun 08:02 tty43
crw--w---- 1 root tty 4, 44 7. Jun 08:02 tty44
crw--w---- 1 root tty 4, 45 7. Jun 08:02 tty45
crw--w---- 1 root tty 4, 46 7. Jun 08:02 tty46
crw--w---- 1 root tty 4, 47 7. Jun 08:02 tty47
crw--w---- 1 root tty 4, 48 7. Jun 08:02 tty48
crw--w---- 1 root tty 4, 49 7. Jun 08:02 tty49
crw--w---- 1 root tty 4, 5 7. Jun 08:02 tty5
crw--w---- 1 root tty 4, 50 7. Jun 08:02 tty50
crw--w---- 1 root tty 4, 51 7. Jun 08:02 tty51
crw--w---- 1 root tty 4, 52 7. Jun 08:02 tty52
crw--w---- 1 root tty 4, 53 7. Jun 08:02 tty53
crw--w---- 1 root tty 4, 54 7. Jun 08:02 tty54
crw--w---- 1 root tty 4, 55 7. Jun 08:02 tty55
crw--w---- 1 root tty 4, 56 7. Jun 08:02 tty56
crw--w---- 1 root tty 4, 57 7. Jun 08:02 tty57
crw--w---- 1 root tty 4, 58 7. Jun 08:02 tty58
crw--w---- 1 root tty 4, 59 7. Jun 08:02 tty59
crw--w---- 1 root tty 4, 6 7. Jun 08:02 tty6
crw--w---- 1 root tty 4, 60 7. Jun 08:02 tty60
crw--w---- 1 root tty 4, 61 7. Jun 08:02 tty61
crw--w---- 1 root tty 4, 62 7. Jun 08:02 tty62
crw--w---- 1 root tty 4, 63 7. Jun 08:02 tty63
crw--w---- 1 root tty 4, 7 7. Jun 08:02 tty7
crw--w---- 1 root tty 4, 8 7. Jun 08:02 tty8
crw--w---- 1 root tty 4, 9 7. Jun 08:02 tty9
crw-rw---- 1 root dialout 204, 64 7. Jun 08:02 ttyAMA0
crw------- 1 root root 5, 3 7. Jun 08:02 ttyprintk
crw-rw---- 1 root dialout 188, 1 7. Jun 08:03 ttyUSB1
crw------- 1 root root 10, 239 7. Jun 08:02 uhid
crw------- 1 root root 10, 223 7. Jun 08:02 uinput
crw-rw-rw- 1 root root 1, 9 7. Jun 08:02 urandom
drwxr-xr-x 4 root root 80 7. Jun 08:02 v4l
crw-rw---- 1 root video 81, 18 7. Jun 08:02 v4l-subdev0
crw-rw---- 1 root video 81, 19 7. Jun 08:02 v4l-subdev1
crw-rw---- 1 root video 10, 124 7. Jun 08:02 vchiq
crw-rw---- 1 root video 10, 125 7. Jun 08:02 vcio
crw------- 1 root root 246, 0 7. Jun 08:02 vc-mem
crw-rw---- 1 root tty 7, 0 7. Jun 08:02 vcs
crw-rw---- 1 root tty 7, 1 7. Jun 08:02 vcs1
crw-rw---- 1 root tty 7, 2 7. Jun 08:02 vcs2
crw-rw---- 1 root tty 7, 3 7. Jun 08:02 vcs3
crw-rw---- 1 root tty 7, 4 7. Jun 08:02 vcs4
crw-rw---- 1 root tty 7, 5 7. Jun 08:02 vcs5
crw-rw---- 1 root tty 7, 6 7. Jun 08:02 vcs6
crw-rw---- 1 root tty 7, 128 7. Jun 08:02 vcsa
crw-rw---- 1 root tty 7, 129 7. Jun 08:02 vcsa1
crw-rw---- 1 root tty 7, 130 7. Jun 08:02 vcsa2
crw-rw---- 1 root tty 7, 131 7. Jun 08:02 vcsa3
crw-rw---- 1 root tty 7, 132 7. Jun 08:02 vcsa4
crw-rw---- 1 root tty 7, 133 7. Jun 08:02 vcsa5
crw-rw---- 1 root tty 7, 134 7. Jun 08:02 vcsa6
crw-rw---- 1 root video 10, 122 7. Jun 08:02 vcsm-cma
crw-rw---- 1 root tty 7, 64 7. Jun 08:02 vcsu
crw-rw---- 1 root tty 7, 65 7. Jun 08:02 vcsu1
crw-rw---- 1 root tty 7, 66 7. Jun 08:02 vcsu2
crw-rw---- 1 root tty 7, 67 7. Jun 08:02 vcsu3
crw-rw---- 1 root tty 7, 68 7. Jun 08:02 vcsu4
crw-rw---- 1 root tty 7, 69 7. Jun 08:02 vcsu5
crw-rw---- 1 root tty 7, 70 7. Jun 08:02 vcsu6
crw------- 1 root root 10, 127 7. Jun 08:02 vga_arbiter
crw------- 1 root root 10, 137 7. Jun 08:02 vhci
crw------- 1 root root 10, 238 7. Jun 08:02 vhost-net
crw------- 1 root root 10, 241 7. Jun 08:02 vhost-vsock
crw-rw---- 1 root video 81, 14 7. Jun 08:02 video0
crw-rw---- 1 root video 81, 15 7. Jun 08:02 video1
crw-rw---- 1 root video 81, 6 7. Jun 08:02 video10
crw-rw---- 1 root video 81, 7 7. Jun 08:02 video11
crw-rw---- 1 root video 81, 8 7. Jun 08:02 video12
crw-rw---- 1 root video 81, 0 7. Jun 08:02 video13
crw-rw---- 1 root video 81, 2 7. Jun 08:02 video14
crw-rw---- 1 root video 81, 3 7. Jun 08:02 video15
crw-rw---- 1 root video 81, 4 7. Jun 08:02 video16
crw-rw---- 1 root video 81, 12 7. Jun 08:02 video18
crw-rw---- 1 root video 81, 1 7. Jun 08:02 video19
crw-rw---- 1 root video 81, 16 7. Jun 08:02 video2
crw-rw---- 1 root video 81, 5 7. Jun 08:02 video20
crw-rw---- 1 root video 81, 9 7. Jun 08:02 video21
crw-rw---- 1 root video 81, 10 7. Jun 08:02 video22
crw-rw---- 1 root video 81, 11 7. Jun 08:02 video23
crw-rw---- 1 root video 81, 17 7. Jun 08:02 video3
crw-rw---- 1 root video 81, 13 7. Jun 08:02 video31
crw------- 1 root root 10, 130 7. Jun 08:02 watchdog
crw------- 1 root root 248, 0 7. Jun 08:02 watchdog0
crw-rw-rw- 1 root root 1, 5 7. Jun 08:02 zero

Image Versions of running containers

moonraker: mkuf/moonraker:latest d6231634db27a86c3674c051b991b1276c0d1397
klipper: mkuf/klipper:latest 90e1477d728d6ff123fc9a5d4df1d523058fb57d
traefik: traefik:v2.5
mainsail: ghcr.io/mainsail-crew/mainsail:edge
webcam: mkuf/ustreamer:latest aeb5930483390b995b6bd652dbb833b8626b23a3
init: busybox:latest

All Containers

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b66b0392b2cd mkuf/moonraker:latest "/opt/venv/bin/pytho…" 57 minutes ago Up 5 minutes 7125/tcp klipper-moonraker-1
6eb2a95bb811 mkuf/klipper:latest "/opt/venv/bin/pytho…" 57 minutes ago Up 5 minutes klipper-klipper-1
37fdca6b789f traefik:v2.5 "/entrypoint.sh --ac…" 57 minutes ago Up 5 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp klipper-traefik-1
f30ebdda6fee ghcr.io/mainsail-crew/mainsail:edge "/docker-entrypoint.…" 57 minutes ago Up 5 minutes 80/tcp klipper-mainsail-1
ade72603c799 mkuf/ustreamer:latest "/opt/ustreamer/ustr…" 57 minutes ago Up 5 minutes 8080/tcp klipper-webcam-1
6d4ee0a842ac busybox:latest "chown -R 1000:1000 …" 57 minutes ago Exited (0) 57 minutes ago klipper-init-1

Retrieving Klipper/Moonraker Logfiles

Successfully copied 57.3kB to /tmp/tmp.kFyTVrez0q-prind

Copying current configs

Generating Archive

tar: Entferne führende „/“ von Elementnamen
/tmp/tmp.kFyTVrez0q-prind/
/tmp/tmp.kFyTVrez0q-prind/runtime-info.txt
/tmp/tmp.kFyTVrez0q-prind/klipper/
/tmp/tmp.kFyTVrez0q-prind/klipper/docker-compose.extra.calibrate-shaper.yaml
/tmp/tmp.kFyTVrez0q-prind/klipper/custom/
/tmp/tmp.kFyTVrez0q-prind/klipper/custom/docker-compose.custom.portainer.yaml
/tmp/tmp.kFyTVrez0q-prind/klipper/custom/README.md
/tmp/tmp.kFyTVrez0q-prind/klipper/custom/moonraker-timelapse/
/tmp/tmp.kFyTVrez0q-prind/klipper/custom/moonraker-timelapse/docker-compose.override.yaml
/tmp/tmp.kFyTVrez0q-prind/klipper/custom/moonraker-timelapse/README.md
/tmp/tmp.kFyTVrez0q-prind/klipper/custom/moonraker-timelapse/Dockerfile.moonraker.ffmpeg
/tmp/tmp.kFyTVrez0q-prind/klipper/custom/docker-compose.custom.multiple-printers.yaml
/tmp/tmp.kFyTVrez0q-prind/klipper/docker-compose.override.yaml
/tmp/tmp.kFyTVrez0q-prind/klipper/docker/
/tmp/tmp.kFyTVrez0q-prind/klipper/docker/klipperscreen/
/tmp/tmp.kFyTVrez0q-prind/klipper/docker/klipperscreen/README.md
/tmp/tmp.kFyTVrez0q-prind/klipper/docker/klipperscreen/Dockerfile
/tmp/tmp.kFyTVrez0q-prind/klipper/docker/klipper/
/tmp/tmp.kFyTVrez0q-prind/klipper/docker/klipper/config.simulavr
/tmp/tmp.kFyTVrez0q-prind/klipper/docker/klipper/README.md
/tmp/tmp.kFyTVrez0q-prind/klipper/docker/klipper/Dockerfile
/tmp/tmp.kFyTVrez0q-prind/klipper/docker/moonraker/
/tmp/tmp.kFyTVrez0q-prind/klipper/docker/moonraker/README.md
/tmp/tmp.kFyTVrez0q-prind/klipper/docker/moonraker/Dockerfile
/tmp/tmp.kFyTVrez0q-prind/klipper/docker/ustreamer/
/tmp/tmp.kFyTVrez0q-prind/klipper/docker/ustreamer/README.md
/tmp/tmp.kFyTVrez0q-prind/klipper/docker/ustreamer/Dockerfile
/tmp/tmp.kFyTVrez0q-prind/klipper/docker-compose.extra.make.yaml
/tmp/tmp.kFyTVrez0q-prind/klipper/README.md
/tmp/tmp.kFyTVrez0q-prind/klipper/docker-compose.extra.simulavr.yaml
/tmp/tmp.kFyTVrez0q-prind/klipper/docker-compose.yaml
/tmp/tmp.kFyTVrez0q-prind/klipper/img/
/tmp/tmp.kFyTVrez0q-prind/klipper/img/splashscreen-1080p.png
/tmp/tmp.kFyTVrez0q-prind/klipper/img/splashscreen-1080p-dark.png
/tmp/tmp.kFyTVrez0q-prind/klipper/img/prind-logo.png
/tmp/tmp.kFyTVrez0q-prind/klipper/LICENSE
/tmp/tmp.kFyTVrez0q-prind/klipper/.github/
/tmp/tmp.kFyTVrez0q-prind/klipper/.github/workflows/
/tmp/tmp.kFyTVrez0q-prind/klipper/.github/workflows/moonraker.yaml
/tmp/tmp.kFyTVrez0q-prind/klipper/.github/workflows/klipperscreen.yaml
/tmp/tmp.kFyTVrez0q-prind/klipper/.github/workflows/ustreamer.yaml
/tmp/tmp.kFyTVrez0q-prind/klipper/.github/workflows/image-workflow.yaml
/tmp/tmp.kFyTVrez0q-prind/klipper/.github/workflows/klipper.yaml
/tmp/tmp.kFyTVrez0q-prind/klipper/scripts/
/tmp/tmp.kFyTVrez0q-prind/klipper/scripts/get-info.sh
/tmp/tmp.kFyTVrez0q-prind/klipper/scripts/build-images.sh
/tmp/tmp.kFyTVrez0q-prind/klipper/scripts/setup-X11.sh
/tmp/tmp.kFyTVrez0q-prind/klipper/config/
/tmp/tmp.kFyTVrez0q-prind/klipper/config/printer-20230606_203112.cfg
/tmp/tmp.kFyTVrez0q-prind/klipper/config/octoprint.yaml
/tmp/tmp.kFyTVrez0q-prind/klipper/config/klipperscreen.conf
/tmp/tmp.kFyTVrez0q-prind/klipper/config/.moonraker.conf.bkp
/tmp/tmp.kFyTVrez0q-prind/klipper/config/printer-20230606_201706.cfg
/tmp/tmp.kFyTVrez0q-prind/klipper/config/build.config
/tmp/tmp.kFyTVrez0q-prind/klipper/config/printer-20230605_214004.cfg
/tmp/tmp.kFyTVrez0q-prind/klipper/config/printer-20230606_200057.cfg
/tmp/tmp.kFyTVrez0q-prind/klipper/config/printer-20230605_221441.cfg
/tmp/tmp.kFyTVrez0q-prind/klipper/config/printer-simulavr.cfg
/tmp/tmp.kFyTVrez0q-prind/klipper/config/printer-20230606_201732.cfg
/tmp/tmp.kFyTVrez0q-prind/klipper/config/mobileraker.conf
/tmp/tmp.kFyTVrez0q-prind/klipper/config/printer-20230605_222318.cfg
/tmp/tmp.kFyTVrez0q-prind/klipper/config/printer.cfg
/tmp/tmp.kFyTVrez0q-prind/klipper/config/printer-20230606_063355.cfg
/tmp/tmp.kFyTVrez0q-prind/klipper/config/telegram.conf
/tmp/tmp.kFyTVrez0q-prind/klipper/config/moonraker.conf
/tmp/tmp.kFyTVrez0q-prind/klipper/config/printer-20230606_200810.cfg
/tmp/tmp.kFyTVrez0q-prind/logs/
/tmp/tmp.kFyTVrez0q-prind/logs/klippy.log
/tmp/tmp.kFyTVrez0q-prind/logs/moonraker.log

boehser-enkel commented 1 year ago

Okay if i set the device up as ttyUSB* it changes after a reconnect. Also privileged does not change anything. I also tried /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0-port0 but the container does not start with that. With /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 the container starts but the same problems as with /dev/ttymxc3

mkuf commented 1 year ago

Okay, so it would probably be best to also mount /dev into the container.

  1. Set up your klipper service like so in the docker-compose.override.yaml, remove any other config under klipper
services:
  klipper:
    privileged: true
    volumes:
      - /dev:/dev
      - ./config:/opt/printer_data/config
      - run:/opt/printer_data/run
      - gcode:/opt/printer_data/gcodes
      - log:/opt/printer_data/logs
  1. in your printer.cfg set the serial device to the symlink generated by klipper (in /dev/serial/by-id/)
  2. Restart the stack

If it still does not work, run the get-info script again and upload the generated tar archive, not just the scripts output.

I just tested this on my machine and could successfully reconnect after the board was reset.
If it works for you, I will add this to the default configuration for the klipper service so that this lenghty configuration is not necessary anymore.

boehser-enkel commented 1 year ago
services:
  klipper:
    privileged: true
    volumes:
      - /dev:/dev
      - ./config:/opt/printer_data/config
      - run:/opt/printer_data/run
      - gcode:/opt/printer_data/gcodes
      - log:/opt/printer_data/logs

This - sir - works like a charm :) Just hit restart in klipper after the printer is turned on and everything is ready to go. Thanks!

mkuf commented 1 year ago

With the merge of https://github.com/mkuf/prind/pull/78 this is now in main.
On the next release you may remove the klipper service completely from your docker-compose.override.yaml and still be able to reconnect to your printer after a reset.

GAZ082 commented 1 year ago

@mkuf is it sensible to allow docker run in privilege mode? If i understand correctly, this is basically giving it root access.

mkuf commented 1 year ago

Running a Container in privileged mode grants access to the hosts devices, it does not grant root access to the host. Klippy is still run by an unprivileged user within the container, just as if it was installed directly on the host.

See the docker docs for reference: https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities

As klipper is hardware (=device) dependent it makes sense to run it in privileged mode.
Some usecases like the octoprint profile and simulavr stack already run klipper in privileged mode as it is required for operation. The upcoming hostmcu service will also profit from this change.

From a usability standpoint this is a great improvement, as Users only have to set their serial device in the printer.cfg and are not forced to interact with compose files.

GAZ082 commented 1 year ago

Using this mode will render obsolete the rule for defining the group of the dev for those hosts not based on Debian?

mkuf commented 1 year ago

As klipper is still run by an unprivileged user within the container, it is still necessary to have the right permissions for the device it is trying to access. So the udev rule for matching the group access to the device is required if groupids do not match between the host an the klipper container, as described in the readme.

https://github.com/mkuf/prind/blob/21f9b51af4b5aa1b94cc906828446b25b5244f06/README.md?plain=1#L144-L156

GAZ082 commented 1 year ago

Im still having the issue. I added volumes in the override config file, do i need to add all the sections of Klipper in that file, thus including the privilege or it picks it up from the original docker compose? @mkuf

mkuf commented 1 year ago

Please run scripts/get-info.sh and upload the generated archive here. @GAZ082

GAZ082 commented 1 year ago

@mkuf For some reason GitHub rejects my files. Here https://we.tl/t-yeNNclz0sX

GAZ082 commented 1 year ago

BTW, the printer is currently turned off.

mkuf commented 1 year ago

There is not much sense in trying to troubleshoot the issue if the printer is turned off 😄

From the klippy log, /dev/ttyUSB0 is missing. That makes sense, when the printer is turned off.

You'll have to use the symlink provided by klipper under /dev/serial/by-id, as ttyUSB0 may change to ttyUSB1 on printer reset, as mentioned in the comment before

This is usually the case when the serial device changes after a printer reset (e.g. from ttyACM0 to ttyACM1) and can be mitigated by running klipper in privileged mode via your docker-compose.override.yaml like so.

  1. in your printer.cfg set the serial device to the symlink generated by klipper (in /dev/serial/by-id/)
mkuf commented 1 year ago

Any update @GAZ082?

GAZ082 commented 1 year ago

@mkuf As you said, the issue here is the host not re-creating the dev upon printer restart. Dont know why, perhaps the fact that I duct-taped the 5v line in the USB plug has something to do. But its not related to prind.