1

This is the weirdest problem I have ever ever faced! I am using Raspberry PI (running Raspbian Wheezy) with Logitech C310 webcam for home monitoring, with motion detection and recording enabled. It records videos to a hard-disk attached to raspberry. Its more than a month I have this setup up and running 24 hours.

Things were running flawlessly until a week before. Since last 6 days I am seeing a very strange behavior. The motion daemon kills itself every evening between 6pm to 6:30pm and if I restart it it kills itself between 7am to 7:30am in the morning! I am pulling my hair to fix this and find out why this happens only during a certain time period in morning and evening?

  • Is it because of some change in daylight the camera is unable to handle?
  • Is it because change in temperature?
  • How was it working fine until a week before and now suddenly showing this issue?
  • Is there an intrusion? Does not look like as I checked most logs/history and basic sanity.
  • Some software update caused this?
  • What should be my next step to debug this?

The syslog around the time when it kills itself are -

Feb 27 18:14:20 raspberrypi motion: [1] 3 length=614400
Feb 27 18:14:20 raspberrypi motion: [1] Resizing pre_capture buffer to 1 items
Feb 27 18:14:21 raspberrypi motion: [1] Started stream webcam server in port XXXX
Feb 27 18:14:25 raspberrypi motion: [1] Resizing pre_capture buffer to 2 items
Feb 27 18:15:38 raspberrypi motion: [0] Thread 1 - Watchdog timeout, trying to do a graceful restart
Feb 27 18:15:57 raspberrypi motion: [1] Calling vid_close() from motion_cleanup
Feb 27 18:15:57 raspberrypi motion: [1] Closing video device /dev/video0
Feb 27 18:15:57 raspberrypi motion: [0] Motion thread 1 restart
Feb 27 18:15:57 raspberrypi motion: [1] Thread 1 started
Feb 27 18:15:57 raspberrypi motion: [1] cap.driver: "uvcvideo"
Feb 27 18:15:57 raspberrypi motion: [1] cap.card: "UVC Camera (046d:081b)"
Feb 27 18:15:57 raspberrypi motion: [1] cap.bus_info: "usb-bcm2708_usb-1.2.1"
Feb 27 18:15:57 raspberrypi motion: [1] cap.capabilities=0x84000001
Feb 27 18:15:57 raspberrypi motion: [1] - VIDEO_CAPTURE
Feb 27 18:15:57 raspberrypi motion: [1] - STREAMING
Feb 27 18:15:57 raspberrypi motion: [1] Config palette index 8 (YU12) doesn't work.
Feb 27 18:15:57 raspberrypi motion: [1] Supported palettes:
Feb 27 18:15:57 raspberrypi motion: [1] 0: YUYV (YUV 4:2:2 (YUYV))
Feb 27 18:15:57 raspberrypi motion: [1] 1: MJPG (MJPEG)
Feb 27 18:15:57 raspberrypi motion: [1] Selected palette YUYV
Feb 27 18:15:57 raspberrypi motion: [1] Test palette YUYV (640x480)
Feb 27 18:15:57 raspberrypi motion: [1] Using palette YUYV (640x480) bytesperlines 1280 sizeimage 614400 colorspace 00000008
Feb 27 18:15:57 raspberrypi motion: [1] found control 0x00980900, "Brightness", range 0,255
Feb 27 18:15:57 raspberrypi motion: [1] #011"Brightness", default -8193, current 128
Feb 27 18:15:57 raspberrypi motion: [1] found control 0x00980901, "Contrast", range 0,255
Feb 27 18:15:57 raspberrypi motion: [1] #011"Contrast", default 57343, current 32
Feb 27 18:15:57 raspberrypi motion: [1] found control 0x00980902, "Saturation", range 0,255
Feb 27 18:15:57 raspberrypi motion: [1] #011"Saturation", default 57343, current 32
Feb 27 18:15:57 raspberrypi motion: [1] found control 0x00980913, "Gain", range 0,255
Feb 27 18:15:57 raspberrypi motion: [1] #011"Gain", default 57343, current 64
Feb 27 18:15:57 raspberrypi motion: [1] mmap information:
Feb 27 18:15:57 raspberrypi motion: [1] frames=4
Feb 27 18:15:57 raspberrypi motion: [1] 0 length=614400
Feb 27 18:15:57 raspberrypi motion: [1] 1 length=614400
Feb 27 18:15:57 raspberrypi motion: [1] 2 length=614400
Feb 27 18:15:57 raspberrypi motion: [1] 3 length=614400
Feb 27 18:15:57 raspberrypi motion: [1] Resizing pre_capture buffer to 1 items
Feb 27 18:16:05 raspberrypi motion: [1] Started stream webcam server in port XXXX
Feb 27 18:16:05 raspberrypi motion: [1] Resizing pre_capture buffer to 2 items
Feb 27 18:36:47 raspberrypi motion: [0] Thread 1 - Watchdog timeout, trying to do a graceful restart
Feb 27 18:37:47 raspberrypi motion: [0] Thread 1 - Watchdog timeout, did NOT restart graceful,killing it!
Feb 27 18:37:47 raspberrypi motion: [0] Calling vid_close() from motion_cleanup
Feb 27 18:37:47 raspberrypi motion: [0] Closing video device /dev/video0
  • That's very strange... Have you got a cron job stopping it? In fact, do you have any cron jobs that activate in those times? – developius Mar 1 '14 at 14:45
  • @user2822450 there are couple of cron jobs, one running every 2 mins and another every night 3am. They don't seem to interfere with motion. – Gopi Mar 2 '14 at 17:23
  • Did you have any luck with this? Have you checked cron jobs for other users, e.g.? Or seen if any other processes might be involved e.g. by looking at /var/log/messages and /var/log/syslog around those times? – Chris M Mar 14 '14 at 13:16
  • @ChrisM no luck. no cron jobs issue. Put the motion in debut mode, no specific logs. planning to replace the camera now, probably it fails handling low lights but works fine when bright and dark. – Gopi Mar 15 '14 at 6:03
7

Finally! I found it after almost two months after trying out every minor change in configuration and peripherals/accessories every day. It turned out to be a USB extension cable issue. I was using a 3 meter USB extension cable, which was not having noise filter. When I replaced the same with 5 meter cable with Noise Filter on both sides, everything works perfectly fine now, even at a higher resolution of 640x480.

Although I could not figure out why the earlier cable causes failure only in the morning and evening, I would recommend everyone that if you are using USB extension cable, make sure that you get one with ferrite noise filter. The noise filter looks something like this, you already have seen that on many cables, this plays a vital role! The ferrite core noise filter

2

I've seen a couple of people say that the 'Watchdog timeout' error can be solved by lowering the resolution (e.g., cached article: http://web.archive.org/web/20130708125010/http://raspberry-blog.com/general/installing-webcam-on-raspberry-pi/). Hopefully this will help, but leave a comment if that doesn't work.

  • Right, I read that too. Will try that as last option. Its still weird that with same resolution it worked perfectly fine for more than 20 days. Thanks for the suggestion. – Gopi Mar 2 '14 at 17:22
  • December 18th 2014, that link to raspberry-blog.com is a placeholder for domain name sales. Can you update it with something more relevant please. – rob Dec 18 '14 at 22:03

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.