Watch dog for Raspberry Pi
来源:互联网 发布:爱心机构手机网站源码 编辑:程序博客网 时间:2024/05/10 22:59
树莓派的CPU是保护有硬件看门狗的,可以通过安装模块和值守程序来实现看门狗防止树莓派死机
安装看门狗:
方法一:
watchdog.sh的源码:
#!/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
sudo sh watchdog.sh
====================================================================================
方法二:
1.加载看门狗模块,编辑/etc/modules文件,添加一行”bcm2708_wdog”
sudo modprobe bcm2708_wdogsudo nano /etc/modules
添加一行”bcm2708_wdog”
2.安装系统配置软件和看门狗程序
sudo apt-get install chkconfig watchdog
3.配置看门狗程序,编辑“/etc/watchdog.conf”文件
sudo nano /etc/watchdog.conf
去掉 watchdog-device = /dev/watchdog 前的#号,让看门狗设备对应树莓派的硬件看门狗
去掉 max-load-1 = 24 前的#号,当1分钟load进程超过24个的时候就会重启
还可以设置高温复位:
去掉
temperature-device =max-temperature = 120
前的#号,改为
temperature-device = /sys/class/thermal/thermal_zone0/tempmax-temperature = 80000
温度超过80度就会引起重启,保护CPU
配置完后,保存(Ctrl+O),退出(ctrl+x)
4.配置看门狗程序,开机自动运行
chkconfig watchdog on
5.启动看门狗
sudo /etc/init.d/watchdog start
0 0
- Watch dog for Raspberry Pi
- Raspberry Pi For Windows
- Raspberry Pi ISP tools for Embedded Pi
- watch dog
- watch dog
- 如何安装 Google coder for Raspberry Pi
- PiLC - S7 PLC for Raspberry Pi
- BerryGPS setup Guide for Raspberry Pi
- Cross-compiling TensorFlow for the Raspberry Pi
- Ubuntu MATE for the Raspberry Pi 2 and Raspberry Pi 3
- How to compile FFmpeg for Raspberry Pi (Raspbian)
- How to build a cross compiler for your Raspberry Pi
- How to config USB wifi adapter for Raspberry Pi
- How to Flash an SD Card for Raspberry Pi
- Chromium OS for Raspberry Pi 3 0.5版本发布
- Setting up an RTEMS development environment for the Raspberry Pi
- Compiling and installing RTEMS for the Raspberry Pi
- A Low Cost JTAG Debugger for the Raspberry Pi
- 最大子序列、最长递增子序列、最长公共子串、最长公共子序列、字符串编辑距离
- 仪表盘设计师访谈录之一 -- RescueTime开发负责人Robby Macdonell
- java高级特效讲解
- Git教程(一)简介
- CAS单点登录(SSO)完整教程
- Watch dog for Raspberry Pi
- Android——SharedPreferences数据存储
- java核心编程之集合类
- Autotools学习
- Google play billing(Google play 内支付) 上篇
- 1.QDialog 窗口外hide;2.QListWidget item重置问题;3.tableview的lineedit;4.tableview 中心checkbox
- 分布式-在win7上安装linux操作系统
- POJ1122_FDNY to the Rescue!(逆向建图+最短路树)
- 手游产品经理初探(七)打造本地化产品的看法