The Stack Overflow podcast is back! Listen to an interview with our new CEO.
76

You can use the BCM2708's hardware watchdog. To use it begin by loading the module: sudo modprobe bcm2708_wdog Then edit the /etc/modules file: sudo nano /etc/modules and add the following line: bcm2708_wdog Next you will need to setup the watchdog daemon. Install and confiigure it to start on bootup: sudo apt-get install watchdog chkconfig ...


7

how i can load Module bcm2708_wdog At first I thought you were looking for the wrong thing because of this: Linux raspberrypi 4.4.7-v7+ ^^^ Since this means you are using a Pi 2 or 3, parts for which are sometimes referred to as "2709" instead of "2708". However, as far as I can tell, the watchdog module has the same name for both ...


6

This answer is not specific to the raspberry pi, but is general advice for remote administered servers. ssh. Using secure shell is almost as good as being there. serial console and out of band administration: if you screw up your network interface having a second way to login is a lifesaver. a simple way would be to have a Identical backup machine running ...


6

For your system-level watchdog, I was going to suggest building a hardware watchdog. There are connections on the RPi board (the P6 header) which you can short to reset the device. You could connect this to a countdown timer chip, and have your app regularly use the GPIO pins to reset the timer. If your app stopped working for too long, the countdown would ...


6

You can and it's quite easy. RPi has a Linux module that implements the standard Linux watchdog API. You can find documentation of this here. Now, if you read this, you will know that there is a special device file called /dev/watchdog and in order to use watchdog you have to open this file and write some data (one byte, it's best to write something other ...


6

It is very easy to wire a hardware reset to the Rpi3. Here is where you will find holes already open and waiting: (Shown here with header pins soldered in place directly above the screw hole) Don't use too much heat or solder. A little bit will do. It is delicate underneath, with a thin trace. I leave them just open, and use the green wire to briefly ...


6

As mentioned in the question edit the rev 2.0 boards now have a specific reset header labelled P6 which is positioned in between the HDMI connector and micro-USB port. The header consists of just two holes (into which one could solder a header/pins). To reset the PI you just momentarily connect the two pins.


4

a) for a effective forkbomb you need to disable the swap partition. (swapoff -a) b) the system may survive a single forkbomb. Simply start a number of them. A very simply test can be done by killing the watchdog process. By doing so the watchdog process doesn't ping the watchdog device, so the hardware watchdog will reboot the pi. In a realworld situation ...


4

I have a theory of why system is not rebooting, but not yet tested. in /etc/watchdog.conf there are lines: realtime = yes priority = 1 basically what I am thinking is that the forkbomb runs but at a lower priority than 1. WatchDog Daemon is still able to get the pulses to the hardware WatchDog. System is still running pretty inoperable, but because ...


4

I spent a bit of time getting the watchdog working on a Debian Stretch version of Raspbian: pi@orangepi:~ $ cat /etc/rpi-issue Raspberry Pi reference 2018-11-13 Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 7e0c786c641ba15990b5662f092c106beed40c9f, stage2 pi@orangepi:~ $ uname -a Linux orangepi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT ...


4

I didn't wade through all the rant you linked, but the author doesn't seem to understand the watchdog. There is a BCM hardware watchdog; If you want to start the hardware watchdog include dtparam=watchdog=on in /boot/config.txt In and of itself this does little, although it should restart the system if not "kicked" regularly. You can write code which opens ...


4

sudo poweroff means shut down and stay off. The watchdog does not, and should not, intercept this. The behaviour you are experiencing is correct and you should not expect the watchdog to restart a powered-off system. I don't think this is what you are wanting to do though. If you want to restart the pi. you should use the command sudo reboot instead. And in ...


3

I was facing a very similar situation. I ended up not using ping but curl. because many times, ping will still work even though the mobile 3G/4G connection has run out of credits/data -- while accessing the web is blocked. On some networks, ping does never work (because ICMP protocol is blocked). In any case, ping is not a reliable way for testing internet ...


3

Over at Unix & Linux Ineb answered: Open /lib/systemd/system/watchdog.service and add [Install] WantedBy=multi-user.target Systemd needs the [Install]-Section for a Unit to know how it should enable/disable the Unit. After that calling systemctl enable watchdog worked.


3

The monit tool is good for monitoring and restarting services. If you are using a Debian based distribution then it should be in the package repository that your Raspberry Pi is using. See the main Debian monit packages for links to some useful information about monit but you will need to download from you R-Pi repository. If you have created init.d ...


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-...


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 ...


3

Update. This package was moved from the upstream of the Arch Repo over to the AUR and no one has produced an ARM version so the watchdog package is no longer available via pacman. The sources are available alongside the systemd unit files so you could try compiling it yourself (note the issues tagged on the package page) and enabling the service via the ...


2

I had the same experience when running the fork-bomb - the system become unstable - and kicked me off my ssh session - but the pi didn't reboot. I got it to work (at least once) however - by running the fork-bomb as root. $ sudo su - # swapoff -a # :(){ :|:& };:


2

There is no way, without a separate circuit or device to have the RPi wake itself up. You could bridge the pins on P6 Header using an Arduino or similar, or a physical switch or jumper on those same pins, or cut power and re-energize the system, but you can't have the RPi power itself on.


2

1. Reset The Pi 2 has a reset pin. According to this article it's a two pin header (unpopulated holes only) located between the display socket and the ACT LED. Supposedly, it's also labeled "RUN". Shorting these pins pulls an input pin of the BCM low, and thus resetting it. So, to emulate this with the Arduino, it's only necessary to figure out which of ...


2

It's pretty clear about there being no /dev/watchdog. You may have to manually load the driver. Try: sudo modprobe bcm2708_wdog sudo modprobe bcm2835_wdt And see if /dev/watchdog now exists. If it doesn't, or there are errors, immediately check tail -n 25 /var/log/syslog and/or journalctl -xn 25 to see if there is any explanation. You can also double ...


2

Here is a small bash script that you can call with cron, for example every 30 seconds. #!/bin/bash COUNT=3 INTERVAL=1 for ((i=COUNT; i>0; i--)); do /bin/ping -c1 -n 8.8.8.8 >/dev/null 2>&1 [ $? -eq 0 ] && exit 0 sleep $INTERVAL done /sbin/reboot This will look $COUNT times if ping returns without error. If so the script ...


1

Not an answer to the original question, but relevant to the problem. There is no 3G dongle in the world that requires only 100mA to work properly. These devices need more than 0.5W. Show us the datasheet. What would happen if your dongle didn't get enough current? It would freeze or otherwise malfunction in obscure ways. The Pi3 can source more current on a ...


1

I've tried blocking my Pi's traffic as a test case. It seems that ping waits a little too long when the connection is frozen. I could be wrong though. Anyways, try adding a timeout to your script. # 10 second timeout. Will quit "ping" after 10 seconds and set $? to error code 124. timeout 10 ping -c4 google.com > /dev/null if [ $? != 0 ] then sudo /...


1

From this: https://github.com/raspberrypi/linux/issues/1285#issuecomment-182264729 That is, add: dtparam=watchdog=on to the end of /boot/config.txt $ ls -l /dev/wat* crw------- 1 root root 10, 130 May 20 01:28 /dev/watchdog crw------- 1 root root 253, 0 May 20 01:28 /dev/watchdog0


1

Your RAM and swap usage in the upper bar of top look like pretty much everything is used up: KiB Mem: 380780 total, 370264 used, 10516 free, 180 buffe KiB Swap: 102396 total, 101344 used, 1052 free, 19092 cache The cache is almost non-existent. This will hurt the performance of the system. The kernel uses free RAM as a file/page ...


1

I don't think it's the watchdog process that signals your app. It triggers the shutdown and the signal comes from init or the kernel. SOP at shutdown is: all processes are first notified that the system is going down by the signal SIGTERM. After an interval (see -t) all processes shall be sent the signal SIGKILL. So if your clean-up is not too time ...


1

It seems like the watchdog is not receiving heartbeats "stroke" from the python scripts. For some reason they are not starting up with the Pi or there is another permission issue. Since you do not have enough to log in and disable the watchdog you will need to try and start in safe mode. This only works on the latest firmware Mount the SD card. If /mnt ...


Only top voted, non community-wiki answers of a minimum length are eligible