@
Listener
Ah. I was thinking it might be an RPi4B, which is so different internally that the firmware- and Raspbian-developers are still working out kinks.
I have never tried this shutdown overlay so don't have personal experience. The current
firmware documentation says (I pasted this snippet as code rather than quote so the text formatting doesn't break up):
Code:
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. Systemd versions older than 225 need an udev rule
enable listening to the input device:
ACTION!="REMOVE", SUBSYSTEM=="input", KERNEL=="event*", \
SUBSYSTEMS=="platform", DRIVERS=="gpio-keys", \
ATTRS{keys}=="116", TAG+="power-switch"
This overlay only handles shutdown. After shutdown, the system
can be powered up again by driving GPIO3 low. The default
configuration uses GPIO3 with a pullup, so if you connect a
button between GPIO3 and GND (pin 5 and 6 on the 40-pin header),
you get a shutdown and power-up button.
Load: dtoverlay=gpio-shutdown,<param>=<val>
Params: gpio_pin GPIO pin to trigger on (default 3)
active_low When this is 1 (active low), a falling
edge generates a key down event and a
rising edge generates a key up event.
When this is 0 (active high), this is
reversed. The default is 1 (active low).
gpio_pull Desired pull-up/down state (off, down, up)
Default is "up".
Note that the default pin (GPIO3) has an
external pullup.
So, no, the parameter names don't appear to have changed.
(We're up to systemd version 241 in moOde 6.1.0, so the udev rule is unnecessary.)
I know this says the default pin is 3 but I suggest you try the full invocation anyway:
Code:
dtoverlay=gpio-shutdown,gpio_pin=3
Note the underscore in "gpio_pin".
If I get a chance tomorrow I'll try this for myself.
Regards,
Kent
Post-edit notes:
[1] Tim's suggestion will turn up bad parameter names
[2] It turns out I didn't need to go to the github repo. I could have printed out the same information at the command line entering a command I didn't know about until 1 minute ago:
Code:
dtoverlay -h gpio-shutdown