SW_OffButtonRPi - fablab-wue/piTelex GitHub Wiki

OFF-button on Raspberry Pi

If you do not intend to run your piTelex station with a RaspBerry around the clock, it is heavily recommended to use this option, to ensure to not mess up your SD-card, your linux-installation and last but not least your RPi. A power off button allows to shutdown the RPi properly before cutting the power

[!IMPORTANT] For using this functionality it is important, to enable the "secure power off" feature of the Raspberry Pi on first startup.

First, navigate to /boot/config.txt, then insert the code-lines below in section "[all]" right at the bottom of the document:

# Shutdown-button
dtoverlay=gpio-shutdown,gpio_pin=#

Replace '#' with the GPIO number to be used, not the pin number. The GPIO pin numbering scheme is not in numerical order; see https://www.raspberrypi.com/documentation/computers/images/GPIO-Pinout-Diagram-2.png