Off/On Switch

Raspberry Pi related support

Off/On Switch

Postby neanderthaler » 02 Jan 2021, 23:46

The dtoverlay-directive "gpio_shutdown" makes life much easier for all friends of hardware shutdown buttons. This works like a charm on my Pi 3B (with Re6).
But it doesn't work with 0.5 beta on Pi 2B, even if dtoverlays in general are working.
So I had to set it up according to janui's hint in https://www.runeaudio.com/forum/shutdown-restart-pushbutton-t6781-10.html#p27707
My /etc/systemd-gpio/shutdown reads:
Code: Select all
GPIO=3
MODE=up
DIR=rising
MESSAGE="Shutdown requested by GPIO trigger."
COMMAND="/srv/http/command/rune_shutdown ; /usr/bin/shutdown -h now"
DEBOUNCE=1.0

Caveat:
- GPIO number relates to the BCM numbering scheme, GPIO 3 means physical pin 5, like shown on https://pinout.xyz/
- option -h ist needed for shutdown:
Code: Select all
shutdown -P
doesn't work in this script. Fancy.

I do not understand if it is really important to run rune_shutdown before /bin/shutdown. In my opinion a system-shutdown should also unmount all shares and close all services, like the rune script does?

However: Kudos to all coders at this great peace of SW!
neanderthaler
 
Posts: 21
Joined: 01 May 2015, 08:20

Re: Off/On Switch

Postby neanderthaler » 03 Jan 2021, 17:01

Kommando zurück!
rune_shutdown doesn't work together with /usr/bin/shutdown.
So I had to reset the variable back to
Code: Select all
COMMAND="/usr/bin/shutdown -h now"

This works as hoped for. Rune seems not to be messed afterwards, even the active playlist with USB-mounts and Samba shares is up and running.

BTW, "shutdown" is just symlinked to "systemctl", this could explain the unexpected behaviour of some options.
neanderthaler
 
Posts: 21
Joined: 01 May 2015, 08:20

support RuneAudio Donate with PayPal


Return to Raspberry Pi

Who is online

Users browsing this forum: cmh714 and 0 guests