You can use the BCM2708's hardware watchdog.
To use it begin by loading the module:
sudo modprobe bcm2708_wdog
Then edit the /etc/modules file:
sudo nano /etc/modules
and add the following line:
bcm2708_wdog
Next you will need to setup the watchdog daemon.
Install and confiigure it to start on bootup:
sudo apt-get install watchdog chkconfig
chkconfig watchdog on
sudo /etc/init.d/watchdog start
Next configure watchdog:
sudo nano /etc/watchdog.conf
# Uncomment the line watchdog-device = /dev/watchdog
The watchdog daemon will send /dev/watchdog a heartbeat every 10 seconds. If /dev/watchdog does not receive this signal it will restart your Raspberry Pi.
The daemon monitors the state of various things defined in the file /etc/watchdog.conf, including the existence of several files, successful pings, etc. and stops signaling the watchdog timer if they don't exist, which resets the Raspberry Pi.
No comments:
Post a Comment