Page 1 of 1

3D printer and Raspberry Pi power control

Posted: Wed Apr 24, 2019 4:27 pm
by recantha2
Hi all,
Over on a Facebook group, we've been having a discussion about controlling power to a 3D printer and a Raspberry Pi from a common source.
Rather than figure out some way of using a buck converter to power the Pi *from* the printer, my preferred solution is to do it from the mains in some way. I'm especially not wanting to corrupt the Pi's SD card, as I'm sure you can appreciate.

My thinking is this:
1. Power both the 3D printer and the Pi from an Energenie plug (or 4-way strip).
2. Have a GPIO button on the Raspberry Pi.
3. When pressed, the button tells the Pi to shut itself down cleanly.
4. The Pi shuts itself down cleanly, *but* it triggers the Energenie to shut itself off just before the Pi is no longer in a state to do anything.

My question is: Is there a way for the Pi to send a command to an Energenie plug AFTER it's finished writing everything to the SD card but BEFORE it shuts down completely? I know there's all kinds of levels of Boot process, but is there a way to get the Pi to know where it is in the Shutdown cycle?

Hope someone can help! :-)

Re: 3D printer and Raspberry Pi power control

Posted: Wed Apr 24, 2019 6:44 pm
by scruss
I'd just leave the Raspberry Pi on, and switch the printer via X10 (like I currently do) or a GPIO-controlled power outlet (like I probably should). There are nice programmable power switches that have one always-on outlet for running the server from.

Re: 3D printer and Raspberry Pi power control

Posted: Wed Apr 24, 2019 6:59 pm
by Andyroo
You can get some very very smart rack power strips (PDUs) designed exactly for this type of task giving TCP/IP control, monitoring, web view, timed on / off and delays in shutdown BUT they are not cheap (even compared to the blade systems on the end of them) :shock:

I would just pop the printer into one of these https://energenie4u.co.uk/catalogue/product/ENER002-2PI and just turn the Pi off with the Shutdown command as normal.