Sunspot Home

more notes for a bad memory - - -

Running the watchdog on the Raspberry Pi

Attempt to create a more robust Pi system as the master of my IOT LAN

My Pi seems to die at odd times for no reason that I can detect.
I may use cron to reboot every few hours - but that is no use if it has died!

There are several web pages explaining the use of the internal watchdog.
Ricardo - - SwitchDoc - - Binerry

None fixed it for me on their own (my lack of understanding I think!) but the following now seems to work -

modprobe bcm2708_wdog

/etc/modules to contain bcm2708_wdog

lsmod to see bcm2708_wdog 3537 0 or similar to prove it has loaded

The following feeds the dog to stop it rebooting the Pi

apt-get install watchdog chkconfig
chkconfig watchdog on
/etc/init.d/watchdog start

Modify /etc/watchdog.conf to contain only:
watchdog-device = /dev/watchdog
watchdog-timeout = 14
realtime = yes
priority = 1
max-load-1 = 24

script to blow up the pi and test that the watchdog is working

# /home/graham/
swapoff -a
:(){ :|:& };:

This forces a reboot after 25 seconds or so (Pi B)

A tip

I control my Pi via ssh on an iMac - I was getting annoyed by the delay of 15 seconds or so between doing

ssh root@192.168.0.XXX

and receiving

in /etc/ssh/sshd_config
add -

It now asks for the password in less than one second

Please email me if you want to swap notes