16

I am running my Pi headless connected to my wireless router using a ethernet cable. I wanted to shut down the pi remotely even when I am not connected to it using SSH/Putty to shut it down exclusively.

I put a question here: Shutting down my Pi safely and following the solution provided.

Now is there a way to verify that the Pi is shut down when the router is switched off? Any LED indication possible?

UPDATE:

I tried to observe the LED on the attached USB HDD and saw no change (it was already in a standby mode).

I just saw this: http://www.raspberrypi.org/forums/viewtopic.php?f=72&t=58098

Is there anybody in this site who have tried and tested this? I do not have a ready jumper to test it now. But once I do, I shall update this.

Additional Update

I finally stopped working on an implementation to create the indicator to show that the Pi is shut down. This is because, I have trust on the cron and I have checked it visually multiple times. So within two minutes of shutting down the router (eth=down), I see the 10 steady blinking of the ACT LED and the Pi goes to halt. I am so happy. I feel sorry that I had a doubt on my cute Pi!

Kangkan
  • 398
  • 2
  • 8
  • 22

4 Answers4

9

Your solution is simple, use an inverter, and a start up script. When The script runs, have an IO pin go high, which will force the LED off. When the OS is off, and the script driving the IO pin is off, the LED will illuminate.

I still haven't made it back to my Pi location, but it may be possible to do this without an inverter.

You would add you script to run by setting up

sudo vim /etc/rc.local

At the bottom, just above exit 0 we’ll add a call to our script.

python /home/pi/run.py

Your script would look something like this:

import RPi.GPIO as GPIO
pinNum = 8
GPIO.setup(pinNum,GPIO.OUT) 
GPIO.output(pinNum,GPIO.HIGH)

Indent that last line.

You can see I am assuming the name run.py and that you have a user directory named /home/pi

Here is a picture of the schematic.

Invert output

Now, if you wanted to get a little extra fancy, you could have a green and red LED, one on either side of the inverter. When the OS is on, one led would be driving high the green LED, and low on the RED LED low. then when the OS were off, the green led would be off, and the red led, on. (I think that would be neat.) or not. do whatever you like.

Piotr Kula
  • 17,336
  • 6
  • 66
  • 105
j0h
  • 2,508
  • 6
  • 27
  • 36
5

In Raspberry Pi 3 you can trun off the PWR LED with

echo 0 | sudo tee /sys/class/leds/led0/brightness

If the Pi is shut down, the LED will turn on again.

Christian
  • 259
  • 3
  • 11
2

No, here are the leds and explanation. http://www.adafruit.com/blog/2013/02/15/raspberry-pi-status-leds-explained-piday-raspberrypi-raspberry_pi/

You could just add your own led to one of the pins. I believe they all go low on shutdown. At least all my relays shut off when the pi shuts down.

Searching finds this video, I haven't tested it. https://www.youtube.com/watch?v=ZwHxg92BXfs

brian
  • 181
  • 6
1

Strictly no, unless you actually witness the shutdown in which case you see the ACT light brink rapidly a several times (10 I think) at a stable interval.

If you mean you want to be able to look at the Pi and tell if is booted or not then the fact that the power LED (red) is on but the network LEDs are all off is usually a good indication (providing that the network device the Pi is connected to has fairly stable uptime).

Reading your original question it seems that the second case will not be applicable, and the first is more likely.