User Tools

Site Tools


carberry:rpi:daemons:shutdown

The shutdown daemon

To properly shutdown Raspberry Pi when ignition signal disappears, an electrical line was provided to notify the need to shutdown. The shutdown daemon, monitors this line (pin 13 on P1 header of Raspberry Pi). When this pin goes low, a shutdown command is issued.

Downlaod the daemon

Click here to download the shutdown daemon, or follow installation steps below:

Install the daemon

Enter home directory:

cd /home/pi/

Download the daemon:

curl -O -J http://www.carberry.it/down.php?download_id=691

Untar the file:

tar -xvf shutdown_d_1.0.tar

Add execution rights:

chmod +x /home/pi/shutdown_d/shutdown.sh

Add a new line to the /etc/rc.local before exit 0 line.
Edit:

sudo nano /etc/rc.local

Add:

/home/pi/shutdown_d/shutdown.sh&
exit 0

System Reboot:

sudo reboot

Check daemon exexution

Check daemon execution:

ps aux | grep shutdown

You have to see something like this:

pi@raspberrypi ~ $ ps aux | grep shutdown
root      2058  0.4  0.2   2736  1188 ?        S    14:40   0:00 /bin/bash /home/pi/shutdown_d/shutdown.sh
pi        2380  0.0  0.1   3568   832 pts/0    S+   14:42   0:00 grep --color=auto shutdown
pi@raspberrypi ~ $

Test the daemon

To test the daemon, take a wire, and jump toghether pin 13 and pin 25 of P1 connector on Raspberry Pi. Raspberry Pi will halt now!.

carberry/rpi/daemons/shutdown.txt · Last modified: 2015/12/21 14:39 by Simone Rinaldi