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?

  • Welcome to Raspberry Pi! Please take the tour and visit the helpcenter to see how things work here. Right now it is hard to give a good answer beyond guessing. You need to check your system logs (see journalctl) if you can find something suspicious. – Ghanima Feb 19 '17 at 23:50
  • 1
    From your description of the problem, the simplest explanation is that your power supply doesn't have enough capacity for the Pi, causing it to fall over and require a hard reset. It would be helpful if you could edit your question to include the amperage/make/model of any power supplies you've tried so far. – goobering Feb 20 '17 at 0:06
  • @goobering I will go up in the loft tomorrow for the exact details. From memory the initial power supply was 1.25A and the replacement is 1.5A. The only device connected is a USB to series cable, I've left it running over Ethernet. – Porter Feb 20 '17 at 0:12
  • The current rating of most PSU is meaningless (provided it is not too low). I have measured dozens, but few ACTUALLY deliver the rated current at the rated voltage. The only way is to actually test with a known load. See Raspberry Pi Power Limitations – Milliways Feb 20 '17 at 0:20

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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