Skip to content

Instantly share code, notes, and snippets.

@justinschuldt
Created November 30, 2021 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinschuldt/f4a538c73b06d395399af7b38f65c070 to your computer and use it in GitHub Desktop.
Save justinschuldt/f4a538c73b06d395399af7b38f65c070 to your computer and use it in GitHub Desktop.
OctoPrint config for controlling relays via GPIO
system:
actions:
- action: light_on
command: gpio mode 0 out && gpio write 0 0
name: Light ON
- action: light_off
command: gpio mode 0 out && gpio write 0 1
name: Light OFF
- action: divider
- action: rpi_usb_on
command: gpio mode 4 out && gpio write 4 1
name: rPi usb ON
- action: rpi_usb_off
command: gpio mode 4 out && gpio write 4 0
confirm: You are about to disconnect the data connection between OctoPrint and the printer.<br><b>Be warned
that any ongoing print job will be interupted.</b>
name: rPi usb OFF
- action: divider
- action: printer_on
command: gpio mode 2 out && gpio write 2 0
name: Printer ON
- action: printer_off
command: gpio mode 4 out && gpio write 4 0 && gpio mode 2 out && gpio write 2 1
confirm: You are about to shutdown the printer main power.<br><b>Be warned
that any ongoing print job will be interupted.</b><br>This will also turn off the rPi USB.
name: Printer OFF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment