When I use the USB camera attached to my freshly booted Raspberry Pi 3, I'm able to capture a single image/video. But when I attempt to do this again, the camera (
/dev/video0) seems to have disappeared completely... Rebooting allows to camera to be used again, but only for a single iteration.
When I run
fswebcam -r 640x480 --no-banner test.jpgto capture an image I get:
--- Opening /dev/video0... Trying source module v4l2... /dev/video0 opened. No input was specified, using the first. --- Capturing frame... Captured frame in 0.00 seconds. --- Processing captured image... Disabling banner. Writing JPEG image to 'test.jpg'.
However, if I run the exact same command again I get:
--- Opening /dev/video0... Trying source module v4l2... Error opening device: /dev/video0 open: Device or resource busy Trying source module v4l1... Error opening device: /dev/video0 open: No such file or directory Unable to find a source module that can read /dev/video0.
And running it a third time gives:
--- Opening /dev/video0... stat: No such file or directory
ls: cannot access '/dev/video*': No such file or directory
A similar effect is also observed using different methods for capturing the camera feed, e.g. using motion.
So why does this happen and how can I fix it?
Any help is greatly appreciated!