You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4.3 KiB

weight title date draft hiddenFromHomePage summary categories tags
4 Apuntes de impresión 3D 2022-08-20T12:04:30+0200 false true Apuntes incompletos de impresión 3D
notes
3dprinter

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):

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.




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