My static website generator using poole https://www.xythobuz.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

title: OctoTray description: PyQt tray application to control OctoPrint/Moonraker parent: 3d-printing position: 50 comments: true git: https://git.xythobuz.de/thomas/OctoTray github: https://github.com/xythobuz/OctoTray date: 2021-05-08

update: 2022-10-16

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.

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.

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.