Skip to content
This repository was archived by the owner on May 6, 2023. It is now read-only.
This repository was archived by the owner on May 6, 2023. It is now read-only.

ATX PSU Power Control #20

@garlick

Description

@garlick

Has there been any discussion about ATX style power control? E.g. press the power button once and the OS shuts down, and then powers off. Hold down the button to override the OS shutdown.

Here are a few references to some pi-related stuff that might be of use:

soft power off
This device tree overlay can be used to map a GPIO to key 116 (power key):
https://www.kernel.org/doc/Documentation/devicetree/bindings/input/gpio-keys.txt

pi specific discussion here:
https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=115394

You can then use a custom udev rule to map this to "power-switch" tag. Systemd then gets ahold of the event and can initiate the shutdown, and finally take the action configured in logind.conf according to its HandlePowerKey setting, which defaults to "poweroff".

turning off ps
After the OS has shut down, you want to signal to the ATX power supply that it can turn off. Here's a discussion about a pi-specific overlay that maps a GPIO pin such that it changes state once the OS has halted the CPU:
https://www.raspberrypi.org/forums/viewtopic.php?t=201483

Lots of ways to implement this, but I'll stop there - maybe this has already been thought about? (Apologies if I missed it!)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions