Octoprint Power control with debian

What is the problem?

I want to know how I can control my Power Supply without a raspberry Pi.
There is a good tutorial for Raspberry https://www.youtube.com/watch?v=dQNBeAZpRmk but i have all running on debian 11. I really don't want to place a extra raspberry pi for this job. What kind of hardware do I probably need?

What did you already try to solve it?

Googled for "octoprint psu control linux"

Have you tried running in safe mode?

No that probably don't give me Information I need.

Did running in safe mode solve the problem?

No that probably don't give me Information I need.

Systeminfo Bundle

octoprint-systeminfo-20230321190758.zip (18.4 KB)

Additional information about your setup

Octoprint was installed with python https://community.octoprint.org/t/setting-up-octoprint-on-a-raspberry-pi-running-raspberry-pi-os-debian/2337 runs on a debian 11 GNU/LINUX bullseye VM inside Proxmox7.1-7. Printer is a Ender 3 Neo with Marlin Firmware.

Hello @Walker !

You can use this plugin:

and one of a smart plugin extension:

@Ewald_Ikemann Thanky you for your reply. I try to get into this. Don't I need a extra switch for the Power supply of the Ender 3 like in the Video above? Is it possible with PSU Plugin to shutdown the Printer remotely with Power switch "ON"?

Foy you don't have a RasPi, you go a different way with a smart plug. That has the relay inside and is controlled from the PSU Control plugin via your local network. So no GPIO is needed.

Yes, you can from the OctoPrint Web GUI and, depending on the smart plug you use, also from the vendors smartphone app.

See here:

There are mote options outside of PSU control too that I have personally written. Here's a list of power control plugins.

1 Like

Ok now I understand. That helps a lot. thank you @Ewald_Ikemann & @jneilliii

Just fyi:
There is also the option to add gpios to your PC with a pi zero (every model - also the non w)

Idk if it works with any existing plugin, but I wanted to mention it.

My raspberry Pi has an annoying fan in my office, so I plugged both my Pi and my Ender 3v2 into a Kasa smart plug, which I can control from the Kasa app on my iphone, or I can control it through HomeAssistant in a vbox on my computer. Works great!

So just unpower the Pi without shutting down?

Definitely a concern and possible corruption. With my TPLinkSmartplug plugin it's possible to configure it in a way to do a safe shutdown of the pi and power off the plug using countdown timers to give the pi time to shut off before yanking power and corrupting the OS/SD card. I posted an example of this config in my Tasmota plugin, but it works the same way with TPLinkSmartplug plugin too.


Just dropping power to a pi is not recommended, but I haven't had any issues yet. But now that you mention it, I should at least make a backup SD card so I'm not down too long... I may look into running from ram instead of SD to eliminate issues.

You may use this:

Or what @jneilliii recommended.

And for backup:

with one of these:

Presumably it will also turn it on and wait for it to startup when you start a new print? That would be great. The only problem left is remote start for the pi, if I shut it down responsibly. (If it weren't for the fan on the pi4, I'd just let it run, but the fan is noisy.)

If the Pi is powered off there is no way for a plugin to be able to power it back on for you. You would have to use the app to do that.

I leave my RPi 3B and my RPi 4B on all the time. Fan noise can be significantly reduced by switching to 3.3v instead of 5v. I haven't noticed any cooling issues at the lower voltage.

There are other fan / case options that are quiet. I have the argon-poly-raspberry-pi-4-vented-case with the argon-fan-hat but the argon-poly-raspberry-pi-4-vented-case-with-pwm-30mm-fan looks interesting as well.

Using the app to power things up is not a problem. That's what I do now. But to do an orderly shutdown of the Pi AND shut down the system, one would need a delayed power off in the smart socket. Does the smart socket have a "Turn off after 10 seconds" command so the pi can be halted prior to power loss?

Yes, that's what my plugin does. It sends the command to the device to set the countdown timer on the device itself to power off after x amount of seconds and then sends the shutdown command to the pi.

I bought the TP-Link Tapo from Amazon and testet it today but it does not seem to work with psu plugin. I installed PSU plugin and PSU Control Tapo and put IP adress in there. But nothing happens when switching on the power symbol. anyone experience with the TPLink tapo p110?

Ah, Tapo needs a different plugin than mine. There was a fork of my plugin for Tapo devices here but based on the open pull request on that repo it might be broken. If that is the case you could use this URL in plugin manager > get more > ...from URL.


The countdown before disconnect is perfect. I'll have to look into that plugin soon! I'd be much happier if I could cleanly shutdown the pi before powering off.

1 Like