Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
Power on/off button
I needed an easy power ON/OFF button on my RPi4B and came across this approach at??which worked great. It does the equivalent of "shutdown" command. Read the link for additional info before implementing.
Simply add the line below to the /boot/config.txt and add a push button between gpio_pin 3 and ground. dtoverlay=gpio-shutdown,gpio_pin=3 |
¿ªÔÆÌåÓýHmmm.. that's a new one to me and thanks for mentioning it.? That said, I use a modified version of this older-style shutdown method mentioned at .? My concern for the new way is I had a considerable amount of false shutdowns with the original script so I added both software debouncing and also a required 5 second hold-down of the button to ensure it's a) not a glitch / RFI / etc and you REALLY want the Pi to go down.? I also see this new approach defaults to the use of the GPIO pin#3 which is also the I2C SCL signal.? That's a serious bummer as I personally use I2C all the time for say RTC chips, LCD displays, etc. but fortunately, this is reconfigurable to GPIO#1 though that will impact reading of HATT ID eproms. --David KI6ZHD On 08/20/2023 09:35 AM, Scott Eckert
via groups.io wrote:
I needed an easy power ON/OFF button on my RPi4B and came across this approach at??which worked great. It does the equivalent of "shutdown" command. Read the link for additional info before implementing. |
If you look at , you'll see that a 100ms debounce is already in the kernel overlay -- no need to add your own.
This has been available since 2017. You can choose other GPIO pins, except, the comments say that for "Raspberry Pi 1 Model B rev 1 can be wake up only by GPIO1 pin." Look through /boot/overlays/README for tons of other useful built-in functionality. 73, Ron KO4RON |
to navigate to use esc to dismiss