Use the gpio-poweroff dtoverlay to change the state of a gpio pin when the Pi reaches the poweroff stage. Monitor that gpio pin.(from /boot/firmware/overlays/README)
Code:
Name: gpio-poweroffInfo: Drives a GPIO high or low on poweroff (including halt). Using this overlay interferes with the normal power-down sequence, preventing the kernel from resetting the SoC (a necessary step in a normal power-off or reboot). This also disables the ability to trigger a boot by driving GPIO3 low. The GPIO starts in an inactive state. At poweroff time it is driven active for 100ms, then inactive for 100ms, then active again. It is safe to remove the power at any point after the initial activation of the GPIO. Users of this overlay are required to provide an external mechanism to switch off the power supply when signalled - failure to do so results in a kernel BUG, increased power consumption and undefined behaviour.Load: dtoverlay=gpio-poweroff,<param>=<val>
Statistics: Posted by rpdom — Sat Jun 22, 2024 1:39 pm