2

I have a pi in an embedded project. When the user turns the instrument off, I want to inhibit turning back on until the pi is done shutting down. I can do this with a timer circuit, but would like to minimise the inhibit time. Is there a way to detect the status of the pi? GPIO pins appear to retain their state and the RUN and EN pins on the (not installed) header are always at 3.3v.

2 Answers2

2

This howchoo post shows how to connect an LED to show the status of the Pi. The LED is steady on when the Pi is running, and off after shutdown.

Briefly:

Add this line to /boot/config.txt, and reboot

enable_uart=1

Connect the TxD pin (GPIO pin 8) to the positive lead of a 2 or 3 volt LED.

Connect a ground pin (e.g. GPIO pin 6) to a 330 ohm resistor, then to the negative lead of a 2V LED.

I have not yet tried this, it's on my to-do list.

Peter bill
  • 309
  • 1
  • 5
1

As you have noted GPIO pins retain their state when shutdown.

There are a couple of exceptions where the state is modified by the shutdown process. gpio-poweroff (which is designed for this purpose) is the most reliable method.

See https://raspberrypi.stackexchange.com/a/94399/8697

PS RUN and EN pins are INPUTS, and NOT connected to the GPIO. RUN is actually a RESET pin.

Milliways
  • 54,718
  • 26
  • 92
  • 182