engineAL
Posts: 3
Joined: Wed Jan 22, 2014 9:08 pm

ON/OFF Power Controller

Sun Feb 21, 2016 8:46 pm

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.)
Last edited by engineAL on Mon Feb 22, 2016 4:51 pm, edited 1 time in total.

Goraxium
Posts: 122
Joined: Tue Jan 26, 2016 1:42 pm

Re: ON/OFF Power Controller

Mon Feb 22, 2016 9:25 am

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

Return to “Advanced users”