2

Is it possible to use Watchdog to reboot the Raspberry Pi in case of overheating? I tried making Watchdog read the temperature from /sys/class/thermal/thermal_zone0/temp but so far no such luck.

Can this be done by software alone? Or would I need an external temperature sensor?

4
  • 1
    it's very unlikely you could overheat RPi without an extensive help of bunsen burner or an acetylene torch =)
    – lenik
    Commented Jun 3, 2014 at 22:16
  • Eheh! Well, mine is running at about 70ºC and I'd like to make it reboot in case it reaches 80ºC
    – nsmyself
    Commented Jun 4, 2014 at 9:38
  • i wonder what does it do to get this warm? bitcoins? protein folding? SETI@Home?
    – lenik
    Commented Jun 4, 2014 at 11:17
  • 1
    Omxplayer on loop and a hot environment.
    – nsmyself
    Commented Jun 4, 2014 at 13:49

2 Answers 2

3

I think temperature-device option should be used in watchdog config file for Raspbian (8.0) instead of temperature-sensor. There is an old watchdog version which supports temperature-device option version only. See: http://www.sat.dundee.ac.uk/psc/watchdog/watchdog-configure.html#Temperature_Sensors

My /etc/watchdog.conf file - temperature part

temperature-sensor = /sys/class/thermal/thermal_zone0/temp
temperature-device = /sys/class/thermal/thermal_zone0/temp
max-temperature        = 80
3

The latest Raspbian has the GPU temperature output at this command

/opt/vc/bin/vcgencmd measure_temp

and has a result of...

temp=49.2'C

But the system also has the CPU temp- I am not sure if they are different sensors or the same but they output slightly different values.

/sys/class/thermal/thermal_zone0/temp

Install watchdog

sudo apt-get install watchdog

Uncomment the following line in /etc/watchdog.conf

watchdog-device = /dev/watchdog

In the watchdog configuration file add the following line for temperate sensor

temperature-sensor = /sys/class/thermal/thermal_zone0/temp

Edit /etc/modules

sudo editor /etc/modules

And add the following:

# hardware watchdog
bcm2708_wdog

To load the watchdog you use these command

sudo modprobe bcm2708_wdog 
sudo nano /etc/modules (add line “bcm2708_wdog”)

In the configuration file you set programs for the watchdog too

3
  • Watchdog is up and running, but it won't reboot when a specific temperature (defined in /etc/watchdog.conf) is reached. Do I need to uncomment the temperature-device line as well? What do I put in there?
    – nsmyself
    Commented Jun 4, 2014 at 15:05
  • I think you need to set the sensor to temperature-sensor = /sys/class/thermal/thermal_zone0/temp - In SSH just put in the command cat /sys/class/thermal/thermal_zone0/temp and let me know what it is. It might be in thousands ... not sure.
    – Piotr Kula
    Commented Jun 4, 2014 at 15:55
  • It's in the thousands, but watchdog isn't looking doing anything. I've tried settings the temperature threshold first to 59 and then 59000. I restarted the watchdog service, but it didn't reboot although the temperature's currently at 62ºC.
    – nsmyself
    Commented Jun 4, 2014 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.