0

Scenario: headless Pi. By glancing at the state of an LED that's plugged into the GPIO, I want to know if the Pi is fully shut down or not so I can pull the plug.

For example:
Pi on --> LED on.
Pi is fully shut down but still receiving power --> LED off.

Is this possible?

Botspot
  • 1,674
  • 5
  • 25
  • 1
    Yes, led attached to a gpio pin. – Botspot Sep 17 '19 at 21:39
  • Not sure how to achieve this, since the Pi is off. I don't think a python script would work since the SoC is not processing commands. Only way I can think of is to use a systemd shutdown service or something like that. – Botspot Sep 17 '19 at 21:43

1 Answers1

1

There is a kernel service gpio-poweroff which asserts a GPIO pin on poweroff but may not work on the Pi4.

See https://raspberrypi.stackexchange.com/a/100125/8697 for details

I just tried shutting down my Pi4, and as I suspected the 3.3V supply is off when in the low power state.

The Pi4 puts the power management chip into a low power state when off - effectively totally shutting down the SoC and the GPIO.

This low power on the Pi4 can be disabled e.g. to use the soft reboot option, but requires modified firmware. The lack of 3.3V would seem to a feasible indicator.

The Activity LED flashes 10 times at 1 second intervals before final shutdown.

Milliways
  • 54,718
  • 26
  • 92
  • 182