Shutdown/Restart Pushbutton

Raspberry Pi related support

Shutdown/Restart Pushbutton

Postby stablgr » 16 Mar 2019, 01:13

Raspberry Pi 3 Model B Ver 1.2
IQAudio Pi-Dac Pro
RuneAudio v0.5

Searching around the web I've come across a method of safely shutting down (and restarting) the Pi using a N.O. pushbutton wired across pins 5 and 6 and apparently all it requires is for the following line to be added to /boot/config.txt

dtoverlay=gpio-shutdown,gpio_pin=3

After editing the file and rebooting the Pi I find that shorting pin 5 to pin 6 has no effect. Rune carries on running as normal. If I shut Rune down, shorting pin 5 to pin 6 does indeed restart the Pi and Rune comes back to life.

I guess my question is should this work as described and if so, what am I doing wrong. My aim is to have a single pushbutton that will safely shut everything down, then bring it back to life again.

All the best
Gary

Am I doing something wrong here?
stablgr
 
Posts: 16
Joined: 21 Feb 2016, 04:32

Re: Shutdown/Restart Pushbutton

Postby janui » 17 Mar 2019, 10:37

User avatar
janui
 
Posts: 714
Joined: 20 Dec 2014, 12:55
Location: Ollanda

Re: Shutdown/Restart Pushbutton

Postby stablgr » 17 Mar 2019, 20:46

Hi Janui,

Thanks for your reply. If I can find a free GPIO pin that will work for the shutdown functionality then I think I can still use a single pushbutton and appropriate logic (relays or otherwise) to connect the button across the appropriate pair of pins depending upon whether the Pi is running or shutdown. I'll also experiment with the DAC removed first to see if it'll all work as planned.

Thanks again for your help.
Gary
stablgr
 
Posts: 16
Joined: 21 Feb 2016, 04:32

Re: Shutdown/Restart Pushbutton

Postby hondagx35 » 18 Mar 2019, 19:57

User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: Shutdown/Restart Pushbutton

Postby janui » 19 Mar 2019, 10:53

Thanks Frank,
Really elegant solution.
janui
User avatar
janui
 
Posts: 714
Joined: 20 Dec 2014, 12:55
Location: Ollanda

Re: Shutdown/Restart Pushbutton

Postby stablgr » 01 Apr 2019, 03:13

Thanks for the tips.

I tried the setup using the diode and the other GPIO pin but still cannot get anything to work. I removed the DAC and tried the both the diode and original modification to config.txt by adding:

dtoverlay=gpio-shutdown,gpio_pin=4

and

dtoverlay=gpio-shutdown,gpio_pin=3

as appropriate.....Still no joy. :(

Next step was to remove the SD card with Rune on it and put in a fresh image of Raspbian. After updating everything I edited config.txt with

dtoverlay=gpio-shutdown,gpio_pin=3

and rebooted. Now when I short between header pins 5 and 6 the Pi will shutdown/restart as required. Does this mean there is something wrong with the code I am entering in config.txt on the Rune installation?

Next step is to try Frank's suggestion with the Raspbian SD card, and if that works, back to Rune and see what happens.

Regards,
Gary
stablgr
 
Posts: 16
Joined: 21 Feb 2016, 04:32

Re: Shutdown/Restart Pushbutton

Postby stablgr » 01 Apr 2019, 03:42

No luck with using GPIO pin 4, with or without the diode.

Pulling GPIO 3 low when the Pi is in standby wakes it up correctly, but when awake, pulling GPIO 4 low does nothing.

Just to make sure I hadn't damaged anything I changed config.txt back to using GPIO 3. After rebooting, pulling GPIO 3 low shutdown/restarts the Pi as expected.

It's getting late so I'll try again in a day or two.

Gary
stablgr
 
Posts: 16
Joined: 21 Feb 2016, 04:32

Re: Shutdown/Restart Pushbutton

Postby janui » 01 Apr 2019, 15:11

User avatar
janui
 
Posts: 714
Joined: 20 Dec 2014, 12:55
Location: Ollanda

Re: Shutdown/Restart Pushbutton

Postby stablgr » 02 Apr 2019, 19:26

Janui,

For the mapping of the physical pin numbers to the GPIO pin numbers I did a google image search and found a pinout diagram for the Pi. I'll be honest that I didn't look too closely at it and perhaps this may be the issue. Next opportunity I have I'll try what you suggested both with and without the DAC installed and see where that leads me.

Thanks for all the help so far.

Best regards,
Gary
stablgr
 
Posts: 16
Joined: 21 Feb 2016, 04:32

Re: Shutdown/Restart Pushbutton

Postby stablgr » 04 Apr 2019, 01:11

Attachments
Screen Shot 2019-04-02 at 10.56.59 PM.png
Screen Shot 2019-04-02 at 10.56.59 PM.png (157.81 KiB) Viewed 2979 times
stablgr
 
Posts: 16
Joined: 21 Feb 2016, 04:32

support RuneAudio Donate with PayPal

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 14 guests