Hello I didn't like that the power button was "hidden" behind the power cable (I'm right handed). And I have seen that some of you has put in a power button on the front. I liked that idea, so I did a version of that myself. I put in a 5V power supply for the raspberry pi. This power supply was connected directly to 240V. I also made a HAT for the raspberry pi. It looks like this. I connected 5V to the HAT from the new power supply and removed the 12V/5V DC/DC converter. The HAT powers the raspberry pi. I routed one 240V lead to the green screw connector, which is hooked up to a relay on the HAT, and then from the green screw connector to the 24V power supply. The other 240V lead and the earth goes directly to the 24V power supply. I wrote a short program in Python and then added a couple of lines in ~/.octoprint/config.yaml A short press of the power button starts the printer, but a slightly longer press (0.8s) is needed to turn the printer of. Here is a video of it I got the inspiration to the circuit from this video and this web page http://www.susa.net/wordpress/2012/06/raspberry-pi-relay-using-gpio/
Very cool! Accessing the power button at the back of the box is something I've found mildly annoying, I like your solution.
To get this right, the raspi is always on, and you can swtich th3 printer (PSU) on and of this way. Nice, but I'm comfortable having mains on the HAT, I would make a separate PCB with the relay, like this http://www.sainsmart.com/arduino-pro-mini.html
@Stefan Yes, I understand your concern. I'm not completely comfortable with the mains on the HAT, but I decided to do it this way anyway. I guess mostly because I was impatient and wanted it done when I had some time to spend on the printer. And a Raspberry pi is fairly cheap