Two ways to install a watchdog on a Raspberry Pi [turn]

Source: Internet
Author: User


The Raspberry Pi CPU is protected by a hardware watchdog, which can be implemented by installing modules and guarding the watchdog program to prevent Raspberry Pi from freezing.

Installation method One:
Source code for WATCHDOG.SH:

1234567891011121314151617 #!/usr/bin/env bashecho "[+] Activating Temperature Sensor"modprobe bcm2708_wdogecho "bcm2708_wdog" >> /etc/modulesecho "[+]Installing Watchdog"apt-get -y install watchdog chkconfigecho "[+]Setting Up Watchdog"chkconfig watchdog onsed -i ‘s/#max-load-1[^5]/max-load-1\ /g‘ /etc/watchdog.confsed -i ‘s/#\(watchdog-device\t[\ ]*\)\=/\1\t\=/g‘ /etc/watchdog.confsed -i ‘s/#\(temperature-device[\ ]*\)\=/\1\ \= \/sys\/class\/thermal\/thermal\_zone0\/temp/g‘ /etc/watchdog.confsed -i ‘s/#\(max-temperature[\ ]*\)\=\ 120/\1\ \=\ 75000/g‘ /etc/watchdog.confsed -i ‘s/#\(interval[\ ]*\)\=\ 1/\1\ \=\ 10 /g‘ /etc/watchdog.conf/etc/init.d/watchdog start

Run:

1 sudosh watchdog.sh

Installation Method Two:
1. Load the watchdog module, edit the/etc/modules file, add a line "Bcm2708_wdog"

12 sudomodprobe bcm2708_wdogsudonano /etc/modules

Add a line "Bcm2708_wdog"

2. Installing the System configuration software and the watchdog program

1 sudoapt-get installchkconfig watchdog

3. Configure the watchdog program and edit the "/etc/watchdog.conf" file

1 sudonano /etc/watchdog.conf

Remove the # Watchdog-device =/dev/watchdog before the watchdog device corresponds to the Raspberry Pi hardware watchdog
Remove the # number before max-load-1 = 24, and restart when the 1-minute load process exceeds 24

You can also set the high temperature reset:
Remove
Temperature-device =
Max-temperature = 120
Before the # number, instead
Temperature-device =/sys/class/thermal/thermal_zone0/temp
Max-temperature = 80000
Temperatures exceeding 80 degrees will cause a reboot to protect the CPU.
After the configuration is complete, save (ctrl+o), exit (CTRL+X).

4. Configure the watchdog program, Boot automatically run

1 chkconfig watchdog on

5. Start the watchdog

1 sudo/etc/init.d/watchdogstart
This article comes from: Raspberry Pi Lab
Link Address: http://shumeipai.nxez.com/2013/10/05/raspberry-pi-for-two-methods-of-installing-watchdog.html

Two ways to install a watchdog on a Raspberry Pi [turn]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.