17

I would like to take snapshots from an USB webcam attached to my Raspberry Pi:

First, I checked the device:

pi@raspberrypi ~ $ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 0ac8:332d Z-Star Microelectronics Corp. Vega USB 2.0 Camera

When I'm trying to grab an Image I'm receiving the following error:

pi@raspberrypi ~ $ fswebcam -d /dev/video0 -r 640x480 test.jpeg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
--- Capturing frame...
Timed out waiting for frame!
No frames captured.

What can be the problem, I tested this method on Ubuntu with success. What can be the problem on Debian?

Using a USB Hub:

pi@raspberrypi ~ $ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 005: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 001 Device 006: ID 0ac8:332d Z-Star Microelectronics Corp. Vega USB 2.0 Camera
pi@raspberrypi ~ $ fswebcam -d /dev/video0 -r 640x480 test.jpeg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
--- Capturing frame...
Timed out waiting for frame!
No frames captured.

This is the webcam.

enter image description here

7
  • 2
    Plugged directly into the Pi- Not enough power is my guess. Try using a compatibly power USB hub then try it.
    – Piotr Kula
    Commented Aug 24, 2012 at 18:39
  • I just tried with an USB hub with the same success.
    – Mokus
    Commented Aug 24, 2012 at 18:45
  • Are you sure the usb hub works? Can you plug a keyboard and wireless in there and does it work on the Pi? It might detect it in the Pi but if you try to do something with it, it can start going wierd
    – Piotr Kula
    Commented Aug 24, 2012 at 19:27
  • 2
    I have same problem. Exact same hardware although the webcam is in a completely different housing. This webcam works without any problem on Ubuntu. Not working on Raspberry Pi. Tried both on a powered hub and directly connected. Webcam seems to be recognized in dmesg and is registered by uvcvideo. Using v4l-conf seems to show 'no overlay' error message.
    – user1772
    Commented Oct 7, 2012 at 21:01
  • 1
    The issue is present here as well. Different housing, same camera. fswebcam behaves the same here, and motion often tells me: "[0] Thread 1 - Watchdog timeout, trying to do a graceful restart". I've tried both the latest Raspian and Arch.
    – Derecho
    Commented Jan 21, 2013 at 18:53

4 Answers 4

6

If you have not already done so, you should try updating your firmware and kernel, in case you are using the officially supported Debian distribution (aka Raspbian). Just follow the instruction you can find here. They just fixed many USB issues (the usb host driver still has a lot of issues left), so you would want to try that.

Also, you should check if the system reports any error through the dmesg command. There is a check-list you can follow to help pinpoint your problem: you can find it here.

2

I've also experienced this issue when using an off-brand USB webcam I got off amazon for $4. It's (probably) due to the camera not getting enough power from the USB to capture.

Try a lower resolution like 320 by 240:

fswebcam -d /dev/video0 -r 320x240 test.jpeg

1

I had the same problem with my webcam and solved it by replacing fswebcam with motion -- it can capture images periodically too. You just have to write snapshot_interval to make it work.

0

I had the same problem but was able to capture images running this as root (or sudo):

uvccapture -t0

1
  • Could you try and elaborate on your answer? Where you came across this solution, etc.
    – kolin
    Commented Mar 19, 2013 at 8:26

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