Skip to content

reloxx13/docker-octoprint

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OctoPrint Docker Image

GitHub release Build Status GitHub contributors

HitCount GitHub stars DockerHub Star GitHub forks DockerHub Pull Github all releases

GitHub license

This the Source Repo for the OctoPrint Docker Image.

Docker Hub

It supports the following architectures automatically:

  • arm32v6 (Raspberry Pi, etc.)
  • x86

Docker Tags

Tag Octoprint
latest Latest Stable
beta ReleaseCandidate
dev master

Tested devices

Device Working?
Raspberry Pi 2b
Raspberry Pi 3b+
Raspberry Pi Zero W

Usage

Witout Webcam:

docker run -d  \
  --restart=unless-stopped \
  --name=OctoPrint \
  -p 1337:80 \
  --device=/dev/ttyUSB0:/dev/ttyUSB0 \
  -v /home/pi/Docker/OctoPrint/data:/data \
  -e CAMERA_DEV_1=false \
  reloxx13/octoprint:latest 

With Webcam:

docker run -d  \
  --restart=unless-stopped \
  --name=OctoPrint \
  -p 1337:80 \
  --device=/dev/video0:/dev/video0 \
  --device=/dev/ttyUSB0:/dev/ttyUSB0 \
  -v /home/pi/Docker/OctoPrint/data:/data \
  -e STREAMER_FLAGS_1="-y -n -r 1280x720 -f 10" \
  reloxx13/octoprint:latest 

More about Webcams: Webcams known to work

Environment Variables

Variable Description Default Value CAM 1 Default Value CAM 2
CAMERA_DEV_1, CAMERA_DEV_2 The camera device node /dev/video0 /dev/video2
MJPEG_STREAMER_AUTOSTART_1, MJPEG_STREAMER_AUTOSTART_2 Start the camera automatically true false
STREAMER_FLAGS_1, STREAMER_FLAGS_2 Flags to pass to mjpg_streamer -y -n -r 640x480 -y -n -r 640x480

Webcam integration

  1. Bind the camera to the docker using --device=/dev/video0:/dev/videoX
  2. Optionally, change STREAMER_FLAGS_1 to your preferred settings (ex: -y -n -r 1280x720 -f 10)
  3. Use the following settings in octoprint:
webcam:
  stream: /webcam1/?action=stream
  snapshot: http://127.0.0.1:8080/?action=snapshot
  ffmpeg: /usr/bin/ffmpeg

Webcam Tips

v4l2-ctl --list-devices

fswebcam -v --list-controls --device /dev/video2

fswebcam -d /dev/video2 -r 640x480 test1.jpeg

lsusb

      BUS:DEVICE   

lsusb -s 001:007 -v | egrep "Width|Height"

Notes

This image uses supervisord in order to launch 3 processes: haproxy, octoprint and mjpeg-streamer.

This means you can disable/enable the camera at will from within octoprint by editing your config.yaml:

system:
  actions:
  - action: streamon
    command: supervisorctl start mjpeg-streamer
    confirm: false
    name: Start webcam
  - action: streamoff
    command: supervisorctl stop mjpeg-streamer
    confirm: false
    name: Stop webcam

Credits

Forked from https://github.com/nunofgs/docker-octoprint
Original credits go to https://bitbucket.org/a2z-team/docker-octoprint