Shutdown/Restart Pushbutton

Raspberry Pi related support

Re: Shutdown/Restart Pushbutton

Postby stablgr » 13 Apr 2019, 23:36

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

Re: Shutdown/Restart Pushbutton

Postby janui » 14 Apr 2019, 18:43

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

Re: Shutdown/Restart Pushbutton

Postby stablgr » 16 Apr 2019, 18:17

Thanks Janui. I'll take a look at it this weekend and see where it leads me.

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

Re: Shutdown/Restart Pushbutton

Postby andre_chang » 05 Sep 2019, 15:28

This way can realize the shutdown state, click the button to start it?
andre_chang
 
Posts: 84
Joined: 01 Feb 2016, 13:27

Re: Shutdown/Restart Pushbutton

Postby BritishAndy » 24 Sep 2019, 20:18

Hi, I have been following your conversation, thank you for all the info, it is exactly what I am trying to achieve. Have you had any luck?
I downloaded the files and installed as per:

Set Up:
cp gpio-trigger@.service /etc/systemd/system
mkdir /etc/systemd-gpio
cp examples/shutdown /etc/systemd-gpio
systemctl reenable gpio-trigger@shutdown

I assume from gpio readall and the config file that this uses GPIO.5 which is pin 18, but shorting this to 5v (or 0v) doesn't seem to do anything.
Is there anything more I need to do apart from the 'setup' above?

My 'project' is to mount the Pi in a 19" rack and use it as part of a PA system to play interval music during shows, it works really well but no easy way to shut it down and I would like to stay headless, hence me trying to figure this out. I am hoping to add a couple of status LEDs too. I guess I could just use a small touchscreen, but I like the minimalist look.
I have very little experience and I am rattling through tutorials and documentation as fast as I can, but struggling with this.

Thanks, and great work so far.

Andrew.
BritishAndy
 
Posts: 2
Joined: 24 Sep 2019, 20:02

Re: Shutdown/Restart Pushbutton

Postby R101 » 24 Sep 2019, 21:21

I have added dtoverlay=gpio-shutdown,gpio_pin=3 to the end of config.txt and found it works fine in 0.4.

I suspect that if I had the local browser enabled, it would not work, as pin=3 is used for the touch screen i2c bus. Could that be the problem?
(Pi 3B, rAudio-1, JLS I2S over USB)
R101
 
Posts: 343
Joined: 29 Apr 2016, 16:16

Re: Shutdown/Restart Pushbutton

Postby BritishAndy » 24 Sep 2019, 21:45

I have got this working.
I think the code works fine as described above but I was getting confused with the pin numbering. GPIO=5 in the 'shutdown' file seems to be GPIO.21 on physical pin 29.
If I set GPIO=24 in 'shutdown' then this refers to GPIO.5 on physical pin 18.

In short, it works well. I didn't change the command string as shutdown -h now worked fine as downloaded and any attempt to modify it seemed to stop things working so any advice on this appreciated.

So now I can put 2 buttons on my project, a pull-up switch on pin 18 marked SHUTDOWN and a short between pins 5&6 marked RESET.

Now to work out some LEDs :-)
BritishAndy
 
Posts: 2
Joined: 24 Sep 2019, 20:02

support RuneAudio Donate with PayPal

Previous

Return to Raspberry Pi

Who is online

Users browsing this forum: Bing [Bot] and 11 guests