I’m trying to get my Pi Zero 2W to raise a GPIO pin when powering down.
Nothing appears to be happening - the unit stays externally powered, suggesting my hardware does not detect the raised pin but in this case I would expect after 3s to see a kernal panic raised on the Pi.
I’m assuming that the correct file is /boot/config.txt (a symlink to /boot/firmware/config.txt) and have put the command (“dtoverlay=gpio-poweroff,gpiopin=4”) there.
One other possible cause of issues - my application on the Pi uses diozero java library (https://www.diozero.com/) to handle I2C messages.
What command do you use to power down the device? reboot or halt will not assert the pin.
Just to be sure, did you connect the right pin? GPIO 4 is physical pin 7 (https://pinout.xyz/)
And did you activate i2c within dietpi-config?
AI also suggested
If the Java library exports GPIO 4 then gpio-poweroff can not take control over this pin. The overlay only works if the pin is unused.