turn on raspberry pi 4b with a button

February 15, 2024, 00:21

imscare

Hi I have trouble in turn on raspberry pi 4b with a button, I using a button that connecting to the GPIO 17 and change the config.txt like this "dtoverlay=gpio-shutdown,gpio_pin=17,active_low=1,gpio_pull=up" the button only help me to turn off the raspberry pi but not turn on how I can fix this. In addition I have a PiSugar 2 Plus connecting to my raspberry pi, when I pressed the button the battery turn off too.

oops.se

That is a "Shut down" feature, not a power on. So you are experiencing the expected behaviour.

k9t33n

you can use stuff like this https://thepihut.com/products/usb-c-cable-with-switch which will turn on the power once you turn it off so you can switch your pi on and off

k9t33n

then again you need to do sudo poweroff in your pi to shutdown properly before you switch it off

imscare

I redo with this approach

imscare

He said the switch will make raspberry in hault state

imscare

When i press my button it does go to hault state but not turn back on

imscare

I did update my bootloader

oops.se

This is the expected behaviour.

oops.se

dtoverlay=gpio-shutdown is NOT a on/off button feature, it is a shutdown feature.

imscare

Are there anyway i can turn on or off beside the on/off cable?

oops.se

Yes

oops.se

There are several HAT or "shims" that you can buy that do it. And I have also a project going to do it.

imscare

Can you give me some instructions when you have a chance to?

oops.se

Search for "shim on/off"

imscare

Thank youu