# dtoverlay=gpio-shutdown,gpio\_pin=3,active\_low=1,gpio\_pull=up

**URL:** https://dietpi.com/forum/t/dtoverlay-gpio-shutdown-gpio-pin-3-active-low-1-gpio-pull-up/3274
**Category:** Troubleshooting
**Created:** [17 June 2019 23:06 UTC](https://dietpi.com/forum/t/dtoverlay-gpio-shutdown-gpio-pin-3-active-low-1-gpio-pull-up/3274 "2019-06-17T23:06:37Z")
**Posts on this page:** 10
**Page:** 2

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [6 March 2021 22:17 UTC](https://dietpi.com/forum/t/dtoverlay-gpio-shutdown-gpio-pin-3-active-low-1-gpio-pull-up/3274/21 "2021-03-06T22:17:47Z")

</div>

Hi,

systemd-logind is masked by default on DietPi and can be unmask on first initial boot if needed

```nohighlight
# Unmask (enable) systemd-logind service (including dbus), which is masked by default on DietPi
AUTO_UNMASK_LOGIND=0

```

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [11 March 2021 11:39 UTC](https://dietpi.com/forum/t/dtoverlay-gpio-shutdown-gpio-pin-3-active-low-1-gpio-pull-up/3274/22 "2021-03-11T11:39:52Z")

</div>

Yes indeed we have it masked by default since it cannot be “disabled” only. Can be toggled via dietpi.txt AUTO\_UNMASK\_LOGIND=1 setting before first boot or any dietpi-software install to have it unmasked, and it will be unmasked automatically if dietpi-software finds libpam-systemd installed.

But outstanding indeed is to have this well prominent documented, including a list of things which require it.

---

<div class="post-metadata">

### Author: ![berny-I](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/b/c77e96/32.png) [@berny-I](https://dietpi.com/forum/u/berny-I)
#### Post date: [4 August 2021 09:38 UTC](https://dietpi.com/forum/t/dtoverlay-gpio-shutdown-gpio-pin-3-active-low-1-gpio-pull-up/3274/23 "2021-08-04T09:38:35Z")

</div>

To get the shutdown working, I had to add this line in /boot/config.txt

```nohighlight
#-------shutdown-button----------------
dtoverlay=gpio-shutdown,gpiopin=3

```

AND I had to to comment out the following lines in the same file

```nohighlight
#-------I2C-------------
##commenting the following line might help with recognizing the power-off-button
#dtparam=i2c_arm=on
[...]
#-------SPI-------------
##commenting the following line might help with recognizing the power-off-button
#dtparam=spi=on

```

It seems I2C and SPI take precedence over the gpio. I found that decisive hint here: [https://raspberrypi.stackexchange.com/questions/77905/raspberry-pi-3-model-b-dtoverlay-gpio-shutdown](https://raspberrypi.stackexchange.com/questions/77905/raspberry-pi-3-model-b-dtoverlay-gpio-shutdown)

Ideally this could be mentioned in a comment in the default /boot/config.txt

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [7 August 2021 11:07 UTC](https://dietpi.com/forum/t/dtoverlay-gpio-shutdown-gpio-pin-3-active-low-1-gpio-pull-up/3274/24 "2021-08-07T11:07:25Z")

</div>

I2C and SPI btw can be disabled via dietpi-config as well and are disabled by default, so unless enabled manually, nothing needs to be done on this.

I2C (when enabled) by default uses pins 0 and 1 (I2C0) and 2 and 3 (I2C1), which is the reason why it broke the GPIO shutdown via pin 3 as you chose it.

SPI by default uses GPIOs 7-11 (SPI0, header pins 19 21 23 24 26) and GPIOs 16-21 (SPI1, header pins 11 12 35 36 38 40), hence, even when enabled, it should not interfere with your chosen shutdown pin. But of course, every interface that is not used, should be disabled anyway.

---

<div class="post-metadata">

### Author: ![BurdonSanderson](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/b/ac91a4/32.png) [@BurdonSanderson](https://dietpi.com/forum/u/BurdonSanderson)
#### Post date: [22 August 2021 07:46 UTC](https://dietpi.com/forum/t/dtoverlay-gpio-shutdown-gpio-pin-3-active-low-1-gpio-pull-up/3274/25 "2021-08-22T07:46:07Z")

</div>

> [@](#):
>
> For what ever reason I had to unmask the systemd-logind.
> 
> Install:  
> G\_AGI dbus  
> G\_AGI libpam-systemd
> 
> sudo systemctl unmask systemd-logind
> 
> Bootconfig change:  
> sudo nano /boot/config.txt  
> dtoverlay=gpio-shutdown,gpio\_pin=3  
> reboot
> 
> I am looking for a way to change the power up from Pin 3 to Pin 21, cause Pin 3 is already in use.

Maybe half a year late, but FWIW, I was under the impression that moving the powerup pin was not possible; interested to know if you figured out a way to do it.

I have one switch doing powerup and poweroff, it’s connected to GPIO 25 and GPIO 3/SCL. I also have i2c devices that are also connected to GPIO3/SCL; they’re just all connected to the same rail on a perma-proto board with a single connection coming off of the Pi header for GPIO3 to the same rail. It works perfectly fine, I was a little worried that it might mess with the i2c devices, but no problems.

---

<div class="post-metadata">

### Author: ![Caporeira](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/c/6bbea6/32.png) [@Caporeira](https://dietpi.com/forum/u/Caporeira)
#### Post date: [27 September 2021 21:59 UTC](https://dietpi.com/forum/t/dtoverlay-gpio-shutdown-gpio-pin-3-active-low-1-gpio-pull-up/3274/26 "2021-09-27T21:59:29Z")

</div>

What can I do to work this script on RPi2 ?

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [27 September 2021 22:48 UTC](https://dietpi.com/forum/t/dtoverlay-gpio-shutdown-gpio-pin-3-active-low-1-gpio-pull-up/3274/27 "2021-09-27T22:48:03Z")

</div>

You enabled systemd-logind already?

```nohighlight
apt install dbus
systemctl unmask systemd-logind
systemctl start systemd-logind

```

---

<div class="post-metadata">

### Author: ![Caporeira](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/c/6bbea6/32.png) [@Caporeira](https://dietpi.com/forum/u/Caporeira)
#### Post date: [28 September 2021 06:57 UTC](https://dietpi.com/forum/t/dtoverlay-gpio-shutdown-gpio-pin-3-active-low-1-gpio-pull-up/3274/28 "2021-09-28T06:57:25Z")

</div>

Thank you !  
Now is working 🙂

---

<div class="post-metadata">

### Author: ![john](https://dietpi.com/forum/user_avatar/dietpi.com/john/32/4554_2.png) [@john](https://dietpi.com/forum/u/john)
#### Post date: [24 August 2023 09:39 UTC](https://dietpi.com/forum/t/dtoverlay-gpio-shutdown-gpio-pin-3-active-low-1-gpio-pull-up/3274/29 "2023-08-24T09:39:45Z")

</div>

If you’ve been unable to get the power down button working on a Dell Wyse 3040 running DietPi, those 3 lines above and repeated below worked for me. Thank you! I was really struggling with that problem.

```auto
apt install dbus
systemctl unmask systemd-logind
systemctl start systemd-logind

```

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [24 August 2023 10:05 UTC](https://dietpi.com/forum/t/dtoverlay-gpio-shutdown-gpio-pin-3-active-low-1-gpio-pull-up/3274/30 "2023-08-24T10:05:32Z")

</div>

> [@john](#):
>
> `apt install dbus`

Yes `dbus` package is not installed on our default images.

[Previous page](https://dietpi.com/forum/t/dtoverlay-gpio-shutdown-gpio-pin-3-active-low-1-gpio-pull-up/3274.md?page=1)
