I also expierience the camera start issue. All cables are properly connected, I also tried different cables and camera modules I had from another project.
I am using a Raspberry Pi 4b (2GB).
Thiss is the return code I get. Does anybody have an Idea?
I also tried enabling the camera Interface manually - also didn't solve the problem.
Starting camera thread.
VIDEOIO ERROR: V4L: can't open camera by index 0
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/home/pi/adeept_rasptank/server/base_camera.py", line 94, in _thread
for frame in frames_iterator:
File "/home/pi/adeept_rasptank/server/camera_opencv.py", line 427, in frames
raise RuntimeError('Could not start camera.')
RuntimeError: Could not start camera.
Are you absolutely sure your camera is seated properly? Try pulling out your camera ribbon, and put it in properly. This is shown in the following link: https://projects.raspberrypi.org/en/projects/getting-started-with-picamera/2. The animation shows how to properly insert your camera ribbon. If the problem persists, try making sure the ribbon isn't bent, and the lights on the camera module show working conditions. A red light should continuously be on, and occasionally a green light would flash. If it still isn't working, try replacing the ribbon or module if you have another. If not, or all the previous fails, it cannot be a hardware issue. At this point, enable the following through raspi-config command, in the interfaces option: Camera, I2C. If it doesn't work, then, you can make sure no 2 operations on the module are happening at the same time.
Thank you for your help. I figured out that it seems to be a hardware problem with my camera unit. I have tried the same compilation on a different raspi-board and the camera had worked. I am now going to replace the raspi board and think that this will solve the problem.
I think I'm having the same issue. I get this back from my cmd window:
VIDEOIO ERROR: V4L: can't open camera by index 0
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/home/pi/adeept_rasptank/server/base_camera.py", line 94, in _thread
for frame in frames_iterator:
File "/home/pi/adeept_rasptank/server/camera_opencv.py", line 427, in frames
raise RuntimeError('Could not start camera.')
RuntimeError: Could not start camera.
I noticed that when I plugged in my camera for the first time, I got the red led to turn on. Then when I rebooted my raspberry pi, it no longer turned on. Could this be a hardware issue?
In case anybody is running the latest raspberry PI operation system - based on Debian Bullseye - you might find camera problems. Bullseye introduced fully new libraries for the picamera. It is not yet fully integrated into Python. Whether or not this is the root cause for my camera problems I don't know yet. I am currently re-installing raspberry PI operating system based on Debian Buster.