Shutdown/Restart Pushbutton

Raspberry Pi related support

Re: Shutdown/Restart Pushbutton

Postby stablgr » 13 Apr 2019, 23:36

This is getting frustrating. I tried using GPIO pins 7, 21, 22, and 29 all without success. When I pull the input low I can see it is being read as it changes from 1 to 0 when I run 'gpio readall'.

For the gpio pins that were reading 0 by default I tried puling them high with (for example for gpio-25)
Code: Select all
dtoverlay=gpio-shutdown, gpio_pin=25,gpio_pull(up)

But this doesn't seem to have the desired effect. gpio-25 would still show low.

Should the dtoverlay statement be placed in a specific location in the config.txt file, or doesn't it matter?

I'm curious if anyone has tried this with Rune and been successful.

Thanks,
Gary
stablgr
 
Posts: 14
Joined: 21 Feb 2016, 04:32

Re: Shutdown/Restart Pushbutton

Postby janui » 14 Apr 2019, 18:43

Hi stablgr,
stablgr wrote:This is getting frustrating. I tried using GPIO pins 7, 21, 22, and 29 all without success. When I pull the input low I can see it is being read as it changes from 1 to 0 when I run 'gpio readall'.
I don’t understand why is wont work or why the gpio pins are different from those expected, I do understand the frustration.
You could try something different from the 'dtoverlay=gpio-shutdown,gpio_pin' method, this looks promising: https://github.com/ali1234/systemd-gpio
This looks far better than the python based routines, which loop in the background testing the gpio status. The documentation claims that it does not to use any resources.
This would also enable rune to do its internal shutdown as well, the 'command: ' should be something like this:
Code: Select all
command: /srv/http/command/rune_shutdown ; /usr/bin/shutdown -P now
It is worth taking the time to understand how it works. It uses the gpio utility, so the detected pin state changes which you have seen should trigger it.
janui

Edited 15-04-2019, the link provided was wrong, the correct link is now shown.
User avatar
janui
 
Posts: 674
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: 14
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

support RuneAudio Donate with PayPal

Previous

Return to Raspberry Pi

Who is online

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