1

I'm trying to run my Pi Zero W as a motion detecting camera using RPI cam web interface but it keeps hanging after a few hours at most. Before it hangs, it can record motion detect videos and upload them to google drive using rclone. I left it running in my office over the weekend, and now that I've come back it's happened again.

Without pulling the plug, I can observe the following:

  • Activity light is solid green
  • It's not connected to wifi

My questions are:

  1. Without a hard power cycle, is there any way I can check if the whole system is hanging or just the wifi?
  2. If I do pull the plug and plug it in again, where can I look for clues as to the cause of this issue?

Pi Zero W, Raspian Stretch 4.14.98+

  • 1
    system log files is a place to start looking for system logs – Jaromanda X Mar 18 at 0:14
  • Thanks. I'm definitely going to update the settings on journalctl per your advice on my other question. Just want to see if I can find out what it's doing right now before I reset it. Will hdmi show anything if I'm running stretch light? – John Haire Mar 18 at 0:29
  • that wasn't my advice :p – Jaromanda X Mar 18 at 0:36
  • 1
    Look in /var/log/syslog. Check your power supply isn't too weedy - the camera is power hungry. Run free > /var/log/free.log every minute from root's crontab write that with sudo crontab -e. After the system fails take a look at that log to see if there's a memory leak. – Dougie Mar 18 at 7:05
  • Not to throw cold water but I thought the log files were not persistent by default so by looking through them after a reboot you'd only be getting logs since the reboot? Correct me if I'm wrong. – Roger Jones Mar 19 at 20:01
2

You can use the serial debug interface to get a console on the Raspberry Pi. To use it you need a USB to Serial adapter like one from amzon - RPi USB/serial adapter. You do not need the most expensive one. I have made very good experience with one of the cheapest from China. To use the serial console you have to add a line to /boot/config.txt

enable_uart=1

Then you can connect the adapters cable black to pin 6 (Ground), white to pin 8 (GPIO14=TXD) and green to pin 10 (GPIO15=RXD). Never connect the red cable. Now you can use a serial console program to get connected to the RasPi as long as it is running. For example on a linux Laptop you can use screen:

laptop ~$ screen /dev/ttyUSB0 115200

But also on MS Windows are serial console programs available.

Now you can examine what's wrong with your RasPi and why it hangs.

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.