1

I run my Pi headless, it's in my loft monitoring the output from my growatt solar inverter.

It runs a cron every 5 mins to update my data, no data no problem as the code handles this. I've stopped the cron and it's still hangs.

Randomly, normally every few days it stops working and I have to unplug it as I can't login. I've taken a monitor in the loft as well and it's a black screen so I know it's frozen. The WiFi dongle isn't frozen as I've tried running it over an Ethernet cable and it still hangs.

I've replaced the SD card and the power supply.

The longest it's run for is about a month, the shortest is a few hours.

How do I find out what's causing it to hang?

tlhIngan
  • 3,372
  • 5
  • 21
  • 33
Porter
  • 17
  • 4

1 Answers1

1

All computers (not just the Pi) fail from time to time. Most of my Pi run for months at a time, without problem.

In many cases it is impossible to discover why, although you should check logs to see if there is a systematic error.

It is possible that it is a random hit from a cosmic ray!

Rather than embarking on a futile hunt avoid the problem. The traditional solution is to implement a watchdog timer. This can be a simple external hardware solution, although the Pi has a built-in watchdog.

apt-cache search watchdog will list the modules.

See https://raspberrypi.stackexchange.com/a/54732/8697

Milliways
  • 62,573
  • 32
  • 113
  • 225