Get Your Free Subscription By Email:

Installing and using the Watchdog Timer on Raspberry Pi

watchdogIn it's simplest definition watchdog is a hardware and/or software timer-register which can used to trigger an system reset or action if something doesn’t works as expected. The watchdog timer performs regular heartbeat checks and if failed performs the pre-defined corrective tasks.

The now hugely popular mini-computer Raspberry Pi features the BCM2835 SoC which has an built-in hardware watchdog timer, this can be used to check tasks like network connectivity, system load, system freeze and other metrics like temperature to perform corrective measures like automatic system reset. Just follow the steps as instructed next to get started with using watchdog timer.

RasPi Watchdog

Installing and configuring watchdog on Raspberry Pi :

  1. Launch Terminal and enter following commands to activate the watchdog.
  2. sudo modprobe bcm2708_wdog
    sudo nano /etc/modules

  3. Now add bcm2708_wdog to this file and save it.
  4. Install and setup the watchdog deamon.

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

  6. Configure /etc/watchdog.conf as per your requirements by using.
  7. sudo nano /etc/watchdog.conf

  8. Make sure watchdog-device = /dev/watchdog line is uncommented.
  9. Refer to the watchdog.conf manpage - http://linux.die.net/man/5/watchdog.conf for configuration options.

NOTE : It is advisable to backup your SD card before trying watchdog timer as your Pi might get into an endless reboot loop if not done properly. Also, the ping feature seems not to work and results in endless reboots on start, one reason could be unavailability of network when watchdog tries the ping and fails which makes the Pi reboot.

Add new comment

This is just one of the many helpful tips we have posted, You can find more stories here,
Do subscribe to updates using your favorite RSS feed reader or using the secure FeedBurner email update form on top of this post.