Page 1 of 1

ON/OFF Power Controller

Posted: Sun Feb 21, 2016 8:46 pm
by engineAL
Hello, I am thinking of using this circuit (http://www.mosaic-industries.com/embedd ... controller) to add a hardware power button to my raspberry pi model A running Raspbian. I'm wondering if anyone has done this before, and if they have any tips.

I'm slightly doubtful about how I will be able to drive the GPIO pin low after Raspbian has halted, as the circuit requires. Currently I have written a python script that will issue the shutdown command when it detects a falling edge on the GPIO pin. However, once Raspbian halts, I need to be able to hold the GPIO pin low to cut the power to the pi, and I'm thinking that has to be done somewhere else. Does anyone have some suggestions?

(Edit: I don't have to use Raspbian if there is another distro that would better support what I am trying to do.)

Re: ON/OFF Power Controller

Posted: Mon Feb 22, 2016 9:25 am
by Goraxium
A quick Google search for "linux run script on shutdown" resulted in this, which should do what you need it to do (going by the readme files in the directories mentioned, it should work for Raspbian too):
http://unix.stackexchange.com/questions ... e-shutdown