Fork this with Git

OctoTray

PyQt tray application to control OctoPrint/Moonraker
Project started on May 08, 2021.
Last updated on October 16, 2022.

Recent activity on GitHub:

...back to 3D Printing overview

To quickly print new stuff on one of my printers, I am using the OctoPrint integration of PrusaSlicer. Unfortunately, it does not allow me to turn on the printers power supply using the Raspberry Pi. But it is possible to do that via the OctoPrint REST API or the Moonraker REST API. Because of that, I wrote a small tool to trigger the power of my printers that lives in the system tray. It runs on Linux using the Python Qt5 bindings, but it has been tested on Windows and should run on macOS as well.

Screenshot of OctoTray version 0.5
Screenshot of webcam viewer in OctoTray version 0.5
Screenshot of settings dialog in OctoTray version 0.5
Screenshot of status dialog in OctoTray version 0.2

To get started quickly, if you are running Windows or macOS, simply download the most recent pre-built binary from GitHub. For Linux, just run or install the program from the source repo directly.

Release builds for OctoTray are available on GitHub.
Latest release of OctoTray, at the time of this writing: Version 0.5 Release Candidate 1 (2022-10-16 12:57:27)

You need to enter the hostnames / IPs and the OctoPrint API keys of your printers in the settings dialog of the application. The program will automatically detect which method to use to switch the power. If you are using the PSU Control OctoPrint Plugin it will use that to toggle the power. Also it looks for custom system commands, as described in the OctoPrint docs.

To give you an example of the system actions you could use to switch GPIOs from OctoPrint, take a look below at the excerpt of my 'config.yaml' file.

system:
    actions:
    -   action: printer on
        command: gpio -g mode 26 out && gpio -g write 26 0
        name: Turn on printer
    -   action: printer off
        command: gpio -g write 26 1 && gpio -g mode 26 in
        confirm: You are about to turn off the printer.
        name: Turn off printer

You can find the project on my Gitea server or on GitHub.

I also wrote a bit more about my OctoPrint setups on this page.

Here are some older screenshots of OctoTray.
Screenshot of OctoTray version 0.3
Screenshot of settings dialog in OctoTray version 0.3
Screenshot of webcam viewer in OctoTray version 0.2
Screenshot of OctoTray version 0.2
Screenshot of OctoTray version 0.1