Apuntes de impresión 3D

Instalación del software en nuestro ordenador

Instalación de octoprint en docker

Pronterface se ha vuelto imposible de instalar para mi, así que vamos a probar Octoprint dockerizado, así ya lo tenemos controlado para instalarlo en una Orangepi Zero en la propia impresora.

El fichero docker-compose.yml para el Octoprint (cortesía de Caligari):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
version: '2.4'

services:
  octoprint:
    image: octoprint/octoprint
    container_name: octoprint
    restart: unless-stopped
    network_mode: bridge
    ports:
      - "80:80"
    devices:
      - "/dev/bus/usb"
    volumes:
      - "./data:/octoprint"
      - "/run/udev:/run/udev:ro"
    device_cgroup_rules:
      - "c 188:* rmw" # USB to serial
      - "c 81:* rmw" # USB webcams
    # uncomment the lines below to ensure camera streaming is enabled when
    # you add a video device
    #environment:
    #  - ENABLE_MJPG_STREAMER=true

  ####
  # uncomment if you wish to edit the configuration files of octoprint
  # refer to docs on configuration editing for more information
  ####
  #config-editor:
  #  image: linuxserver/code-server
  #  ports:
  #    - 8443:8443
  #  depends_on:
  #    - octoprint
  #  restart: unless-stopped
  #  environment:
  #    - PUID=0
  #    - PGID=0
  #    - TZ=America/Chicago
  #  volumes:
  #    - octoprint:/octoprint

Tenemos que adaptar la parte del mapeo del puerto USB para usarlo en nuestro ordenador.

A continuación algunas notas de como se puede hacer el mapeo del puerto USB en nuestro ordenador.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55



DSM docker UI application does not have option to set "device".

But you still can do this by following steps:

    create "octoprint" container with all settings you need (volumes, ports etc)
    select "Settings" -> "Export" and export docker container configuration JSON to local computer
    open exported JSON in any editor
    find string

"devices" : null,

and replace it with

   "devices" : [
       {
           "pathOnHost": "/dev/ttyUSB0",
           "PathInContainer": "/dev/ttyUSB0",
           "CgroupPermissions": "rwm"
       }
   ],

    Import JSON file back to DSM docker UI

P.S. Also I found that my "/dev/ttyUSB0" has "crw-------" permission, and can't be accessed inside docker by octoprint application. So I have to manually set to "crw-rw-rw-" with

chmod a+rw /dev/ttyUSB0


-----
also



    Suggest adding instructions to to identify the USB port being used and then passing this device into the container.

    With the pi connected to the printer via usb
    ls /dev | grep tty

    This should return a long list of 'tty' The one we need is found at the end of the list and is probably
    ttyUSB0 if no other USB devices are plugged in.

    In order to use this ttyUSB0 add this to your docker run command

    docker run -device /dev/ttyUSB0:/dev/ttyUSB0 .....

    Now octoprint can detect the the USB port and connect to the printer.

Hi
i installed everything and it works. unfortunately I can't enable the usb and launching the command (pi4): docker: invalid reference format: repository name must be lowercase.
See 'docker run --help'.

some advice?

Partes de repuesto

0%