Hi,
systemd-logind is masked by default on DietPi and can be unmask on first initial boot if needed
# Unmask (enable) systemd-logind service (including dbus), which is masked by default on DietPi
AUTO_UNMASK_LOGIND=0
Hi,
systemd-logind is masked by default on DietPi and can be unmask on first initial boot if needed
# Unmask (enable) systemd-logind service (including dbus), which is masked by default on DietPi
AUTO_UNMASK_LOGIND=0
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.
To get the shutdown working, I had to add this line in /boot/config.txt
#-------shutdown-button----------------
dtoverlay=gpio-shutdown,gpiopin=3
AND I had to to comment out the following lines in the same file
#-------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
Ideally this could be mentioned in a comment in the default /boot/config.txt
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.
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.
What can I do to work this script on RPi2 ?
You enabled systemd-logind already?
apt install dbus
systemctl unmask systemd-logind
systemctl start systemd-logind
Thank you !
Now is working ![]()
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.
apt install dbus
systemctl unmask systemd-logind
systemctl start systemd-logind
Yes dbus package is not installed on our default images.