arpi3b
Posts: 9
Joined: Sat Apr 18, 2020 4:53 pm

Shutdown/Start and Reset buttons not working (on Devuan)

Sat May 02, 2020 4:51 pm

Hello:

I am attempting to wire shutdown/start and reset buttons using GPIO pin 5 to Ground and a header soldered to the PEN+RUN location on a Raspberry Pi 3B+ like some examples I have seen on the web.

For the Reset button I am using GPIO 14 as Ground as GPIO 6 and GPIO 4 are used to power a small 12v.
(No noise/good airflow, always @35°C with an AT of 26°C.)

But I digress ...

The shutdown/start and Reset buttons are not working.
Fortunately I have not toasted the board and it still works.

Q:
Are these functions exclusively RPi 3B+ hardware related or is the use of Raspbian as the OS needed?
I am running Devuan ascii 2.0.0.

Code: Select all

groucho@rpidevuan:~$ uname -a
Linux rpidevuan 4.16.14-v8+ #1 SMP PREEMPT Tue Jun 5 18:50:10 CEST 2018 aarch64 GNU/Linux
groucho@rpidevuan:~$ 

Code: Select all

groucho@rpidevuan:~$ cat /boot/config.txt
## memory shared with the GPU
gpu_mem=128
## always audio
dtparam=audio=on
## maximum amps on usb ports
max_usb_current=1
## enable hardware-accelerated graphics
dtoverlay=vc4-kms-v3d
## kernel
kernel=kernel8.img
## shutdown button pin 5 and ground
dtoverlay=gpio-shutdown
groucho@rpidevuan:~$ 

Code: Select all

groucho@rpidevuan:~$ cat /boot/cmdline.txt
dwc_otg.fiq_fix_enable=2 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rootflags=noload net.ifnames=0
groucho@rpidevuan:~$ 
Thanks in advance,

A.
Last edited by arpi3b on Tue May 05, 2020 7:16 pm, edited 1 time in total.

User avatar
scruss
Posts: 3323
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Shutdown/Start and Reset buttons not working

Sat May 02, 2020 5:16 pm

arpi3b wrote:
Sat May 02, 2020 4:51 pm
Are these functions exclusively RPi 3B+ hardware related or is the use of Raspbian as the OS needed?
I am running Devuan ascii 2.0.0.
Yep; Devuan's the problem. From Device Tree overlays README:

Code: Select all

Name:   gpio-shutdown
Info:   Initiates a shutdown when GPIO pin changes. The given GPIO pin
        is configured as an input key that generates KEY_POWER events.
        This event is handled by systemd-logind by initiating a
        shutdown.
You throw out systemd, you throw out the nice things.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

arpi3b
Posts: 9
Joined: Sat Apr 18, 2020 4:53 pm

Re: Shutdown/Start and Reset buttons not working (on Devuan)

Sat May 02, 2020 6:18 pm

Hello:

Thanks for the fast reply.
Much obliged.
scruss wrote:
Sat May 02, 2020 5:16 pm
... Devuan's the problem.

Code: Select all

Name:   gpio-shutdown
Info:  Initiates a shutdown when GPIO pin changes. The given GPIO pin
        is configured as an input key that generates KEY_POWER events.
        This event is handled by systemd-logind by initiating a shutdown.
        
I see.
This with respect to gpio-shutdown functionality.
I'll look at other options I have seen using a python script.

What about RUN and PEN?
I have seen that PEN was (unnamed) Ground up to RPI3 which is why shorting RUN to it made for a soft reset.
How does it work now that the pin is labeled PEN?
I assume that PEN and RUN short to Ground and do something related to power and start/stop/reset?

I have not found official RPi documentation on how to use them.
scruss wrote:
Sat May 02, 2020 5:16 pm
You throw out systemd, you throw out the nice things.
Indeed ...
Depends on what one considers 'nice'.
Some people like to eat a bowl of fermented durian for breakfast.

In another life I clocked in a few years of, among other IT duties, end-user support for PCs running from W95SE to XP.
Previous experience had been a lot of userland DOS 5.0 to W3.11.
I recall that my worst nightmare was the obscure, undocumented and always morphing MS registry.
systemd reminds me of that, so I'll stay with Devuan. =-)

Thanks in advance,

A.
Last edited by arpi3b on Tue May 05, 2020 7:17 pm, edited 1 time in total.

User avatar
scruss
Posts: 3323
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Shutdown/Start and Reset buttons not working (on Devuan)

Sat May 02, 2020 9:02 pm

arpi3b wrote:
Sat May 02, 2020 6:18 pm
What about RUN and PEN?
Not things you really want to touch. You can use RUN to bring a shutdown Raspberry Pi back to life. Lots of discussion on this board, such as: viewtopic.php?t=207961

These are emergency shutdown/startup points that go directly to the CPU. There's no way an OS can trap them.
Some people like to eat a bowl of fermented durian for breakfast.
Mmm, durian. Lovely stuff. Seriously.

Raspbian's the only OS for the Raspberry Pi with good support. There's not much help for niche OSs. I used to admin SCO systems: I do not miss init one bit.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

arpi3b
Posts: 9
Joined: Sat Apr 18, 2020 4:53 pm

Re: Shutdown/Start and Reset buttons not working (on Devuan)

Sat May 02, 2020 9:36 pm

Hello:
scruss wrote:
Sat May 02, 2020 9:02 pm
Not things you really want to touch.
Awww ... =-)
scruss wrote:
Sat May 02, 2020 9:02 pm
... use RUN to bring a shutdown Raspberry Pi back to life.
viewtopic.php?t=207961
Good use, reset.
Thanks for the link.
scruss wrote:
Sat May 02, 2020 9:02 pm
Mmm, durian. Lovely stuff. Seriously.
See what I meant?
Depends is a really neat word. 8^7
scruss wrote:
Sat May 02, 2020 9:02 pm
Raspbian's the only OS for the Raspberry Pi with good support.
Hopefully that will eventually change.
In the meanwhile ...

Thanks a lot for your input.

Cheers,
A.

Return to “General discussion”