Skip to content

Octoprint with socat for remote printers using ser2net

Notifications You must be signed in to change notification settings

ausshir/octoprint-socat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Octoprint with socat for remote printers

This is a Dockerfile to set up OctoPrint using an idea from vladbabii/homeassistant-socat to connect to network printers.

It also may be useful for running in a docker-based cluster such as swarm.

Based on nunofgs/octoprint image published on Docker Hub (as this is currently the most flexible image available which also supports the lightweight alpine), and homeassistant-socat for the main idea on how to acheive this.

This is a new project and many issues are expected!!

Usage

Instead of using a locally-connected printer (usb serial device), we can use the serial device mapped over the network with ser2net and then map it to a local zwave serial device with socat.

This docker container ensures that

  • A serial device is mapped in the local docker with socat

  • Octoprint is running

If there are any failures, both socat and octoprint will be restarted.

Example ser2net config

7676:raw:600:/dev/ttyACM0:115200 8DATABITS NONE 1STOPBIT

Environment options:

All Octoprint variables are available and on top of that a few others have been added:

DEBUG_VERBOSE=0

Set to 1 to see more information

Default: 0

PAUSE_BETWEEN_CHECKS=2

In seconds, how much time to wait between checking running processes.

Default: 2

LOG_TARGET=/log.log

Path to log file. Ommit to write logs to stdout.

Default: stdout

SOCAT_PRINTER_TYPE="tcp"

SOCAT_PRINTER_HOST="192.168.5.5"

SOCAT_PRINTER_PORT="7676"

Where socat should connect to - will be used as tcp://192.168.5.5:7676

SOCAT_PRINTER_LINK="/dev/ttyACM0"

What the printer's serial device should be mapped to. Use this in octoprint's configuration files.

About

Octoprint with socat for remote printers using ser2net

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 95.8%
  • Dockerfile 4.2%