Skip to content

Simple overlays for OBS to show printer status

Notifications You must be signed in to change notification settings

vr6syncro/obs-octoprint

 
 

Repository files navigation

OBS-OCTOPRINT

This provides OBS Overlay endpoints to show information about a network printer.

ENDPOINTS

  • /overlay/progress : Shows a progress bar
  • /overlay/info : Shows print info label
  • /api/job : The endpoint that provides the info to the UI endpoints

REQUIRED ENVIRONMENT VARIABLES

  • OCTOPRINT_API_KEY : The OctoPrint API Key
  • OCTOPRINT_HOST : OctoPrint server Host name
  • OCTOPRINT_PORT : OctoPrint server Port

RUN IN DOCKER

The conainer exposes port 3000. -P will map the port on the host.

$ docker build --pull --tag camalot/obs-octoprint -f "./Dockerfile" .
$ docker run -d -P \
	--restart unless-stopped \
	--name "obs-octoprint" \
	-e OCTOPRINT_API_KEY="${OCTOPRINT_API_KEY}" \
	-e OCTOPRINT_HOST="${OCTOPRINT_HOST}" \
	-e OCTOPRINT_PORT="${OCTOPRINT_PORT}" \
	-t camalot/obs-octoprint

RUN IN NODE

  • Create a .env file in the obs-octoprint directory.
  • Add the following:
OCTOPRINT_API_KEY=<MY_OCTOPRINT_API_KEY>
OCTOPRINT_HOST=<MY_OCTOPRINT_HOST_NAME>
OCTOPRINT_PORT=5000
  • Open shell and run the following:
$ npm install
$ npm start

Autostart

cd /obs-octoprint/bin

Nodemon for monitoring for file changes and restart

npm i nodemon

pm2 for autostart see: https://pm2.keymetrics.io/docs/usage/quick-start/

npm install pm2@latest -g
pm2 start nodemon www
pm2 startup
sudo env PATH=$PATH:/usr/bin /usr/local/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi

For status

pm2 status

About

Simple overlays for OBS to show printer status

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 36.8%
  • Shell 35.7%
  • Handlebars 13.4%
  • Groovy 7.0%
  • CSS 4.7%
  • Dockerfile 2.4%