|
@@ -9,9 +9,9 @@ date: 2021-05-08
|
9
|
9
|
|
10
|
10
|
<span class="listdesc">[...back to 3D-Printing overview](3d-printing.html)</span>
|
11
|
11
|
|
12
|
|
-To quickly print new stuff on one of my printers, I am using the OctoPrint integration of PrusaSlicer.
|
|
12
|
+To quickly print new stuff on one of my printers, I am using the [OctoPrint](https://octoprint.org) integration of [PrusaSlicer](https://github.com/prusa3d/PrusaSlicer).
|
13
|
13
|
Unfortunately, it does not allow me to turn on the printers power supply using the Raspberry Pi.
|
14
|
|
-But it is possible to do that via the OctoPrint REST API.
|
|
14
|
+But it is possible to do that via the [OctoPrint REST API](https://docs.octoprint.org/en/master/api/index.html).
|
15
|
15
|
Because of that, I wrote a small tool to trigger the power of my printers that lives in the system tray.
|
16
|
16
|
It runs on Linux using the Python Qt5 bindings.
|
17
|
17
|
|
|
@@ -21,4 +21,36 @@ lightgallery([
|
21
|
21
|
])
|
22
|
22
|
%-->
|
23
|
23
|
|
|
24
|
+You need to enter the hostnames / IPs and the API keys of your printers at the beginning of the python file in the repo.
|
|
25
|
+The program will automatically detect if you are using the [PSU Control OctoPrint Plugin](https://plugins.octoprint.org/plugins/psucontrol/) it will use that to toggle the power.
|
|
26
|
+Otherwise it looks for custom system commands, named "all on" and "all off", as described in the [OctoPrint docs](https://docs.octoprint.org/en/master/configuration/config_yaml.html#system).
|
|
27
|
+Mine look like this.
|
|
28
|
+
|
|
29
|
+ system:
|
|
30
|
+ actions:
|
|
31
|
+ - action: all on
|
|
32
|
+ command: gpio -g mode 20 out && gpio -g write 20 0 && gpio -g mode 26 out
|
|
33
|
+ && gpio -g write 26 0
|
|
34
|
+ name: Turn on printer & lights
|
|
35
|
+ - action: all off
|
|
36
|
+ command: gpio -g write 20 1 && gpio -g mode 20 in && gpio -g write 26 1 &&
|
|
37
|
+ gpio -g mode 26 in
|
|
38
|
+ confirm: You are about to turn off the printer and the lights.
|
|
39
|
+ name: Turn off printer & lights
|
|
40
|
+ - action: lights on
|
|
41
|
+ command: gpio -g mode 20 out && gpio -g write 20 0
|
|
42
|
+ name: Turn on lights
|
|
43
|
+ - action: lights off
|
|
44
|
+ command: gpio -g write 20 1 && gpio -g mode 20 in
|
|
45
|
+ name: Turn off lights
|
|
46
|
+ - action: printer on
|
|
47
|
+ command: gpio -g mode 26 out && gpio -g write 26 0
|
|
48
|
+ name: Turn on printer
|
|
49
|
+ - action: printer off
|
|
50
|
+ command: gpio -g write 26 1 && gpio -g mode 26 in
|
|
51
|
+ confirm: You are about to turn off the printer.
|
|
52
|
+ name: Turn off printer
|
|
53
|
+
|
24
|
54
|
You can find the project [on my Gitea server](https://git.xythobuz.de/thomas/OctoTray) or on [GitHub](https://github.com/xythobuz/OctoTray).
|
|
55
|
+
|
|
56
|
+I also wrote a bit more about my OctoPrint setups [on this page](octoprint.html).
|