Ashnook13
Posts: 120
Joined: Wed Sep 26, 2012 3:43 pm

Pi stops running, why?

Tue Mar 10, 2020 8:55 pm

I have 3 pis' running different tasks, security camera, network, bird box camera, and they eack randomly stop running. I cannot find out why, the only wayi can keep them running is to have a mains timer turn them off and on once a day.
Can anyone enlighten Me on why this happens?
Thanks.

User avatar
thagrol
Posts: 2907
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Pi stops running, why?

Wed Mar 11, 2020 1:11 am

Without a lot more information from you all anyone can do is guess. Start with the log files after a hang.

Rather than use a mains timer (that will cause SD card corruption as the OS won't be properly shutdown) I'd use a combination of a cron job to reboot each pi once a day and enabling the hardware watchdog to force a reset if the system hangs.

To reboot at 04:30 every day I'd add the following to root's crontab:

Code: Select all

4 30 * * * /sbin/reboot
For more information on cron, run

Code: Select all

man cron
It's been a while since I've used the hardware watchdog so I'm afraid you'll have to hit a web/forum search for that.
Attempts to contact me outside of these forums will be ignored unless signed in triplicate, sent in, sent back, queried, lost, found, subjected to public enquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters

Ashnook13
Posts: 120
Joined: Wed Sep 26, 2012 3:43 pm

Re: Pi stops running, why?

Wed Mar 11, 2020 2:30 pm

Hi, I have tried the cron job rebooting every day but it still stops running and then the cron job won't run.

I will look at the log file (which one?).

I have checked that they are not running out of memory and all the other things I can think of. Some times it caan take a couple of days and sometimes several weeks.
Two pis are running video capture wit the motion software, another is running Seti and I have had other video programs running and most of the have stopped at some time.

Brian

User avatar
thagrol
Posts: 2907
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Pi stops running, why?

Wed Mar 11, 2020 2:34 pm

Ashnook13 wrote:
Wed Mar 11, 2020 2:30 pm
Hi, I have tried the cron job rebooting every day but it still stops running and then the cron job won't run.
That's why I suggested you look into using the hardware watchdog.
I will look at the log file (which one?).
Start with /var/log/syslog.
Attempts to contact me outside of these forums will be ignored unless signed in triplicate, sent in, sent back, queried, lost, found, subjected to public enquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters

Ashnook13
Posts: 120
Joined: Wed Sep 26, 2012 3:43 pm

Re: Pi stops running, why?

Wed Mar 11, 2020 4:19 pm

Please explain what the hardware watchdog is.

Cheers

User avatar
thetrueyoshifan
Posts: 2
Joined: Wed Mar 11, 2020 4:09 pm
Contact: Website

Re: Pi stops running, why?

Wed Mar 11, 2020 4:28 pm

This is a little bit of a longshot, but have you tried swapping out the USB cables and power supply? Perhaps after a long period of time, your Pi draws enough power to brown out your power supply, causing the system to hang. Does the power LED light even when the Pi isn't running?
Tinkering with Raspberry Pi since 2012!

PhatFil
Posts: 1665
Joined: Thu Apr 13, 2017 3:55 pm
Location: Oxford UK

Re: Pi stops running, why?

Wed Mar 11, 2020 4:53 pm

to filter the logs you look at from the command line you can use the grep tool to search for key messages like :

Code: Select all

$ cat /var/log/syslog | grep "error"
which will filter only entries containing the word error .

User avatar
thagrol
Posts: 2907
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Pi stops running, why?

Wed Mar 11, 2020 5:22 pm

Ashnook13 wrote:
Wed Mar 11, 2020 4:19 pm
Please explain what the hardware watchdog is.

Cheers
There's a circuit built into the SoC that once enabled forces a hardware reset if the OS/software doesn't send it a regular keep alive signal.

If your OS hangs, after a short time the Pi gets reset much like your mains timers but on demand rather than at a set time. The only link to a setup guide I have is seven years old so very out of date. I've not used the watchdog on buster or a 4B so am unable to help..

As I said above, your best bet is a forum and/or a web search.
Attempts to contact me outside of these forums will be ignored unless signed in triplicate, sent in, sent back, queried, lost, found, subjected to public enquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters

Ashnook13
Posts: 120
Joined: Wed Sep 26, 2012 3:43 pm

Re: Pi stops running, why?

Wed Mar 11, 2020 5:38 pm

Thanks , I will look into it.

Return to “Troubleshooting”