You ran sudo modprobe bcm2835-v4l2, the shell answered ERROR: could not insert 'bcm2835_v4l2': No such device, and /dev/video0 never appeared, so OpenCV's VideoCapture has nothing to open. This failure is almost never a broken driver. The module file is present; its probe routine ran, asked the board's camera interface for a sensor, was told there was none, and returned the kernel's no-device error. The fix sits in hardware configuration: enable the camera interface, confirm the sensor is detected at boot, and re-seat the ribbon when it is not. The tests below run in order of probability, with the command for each and the point at which you stop debugging the ribbon and fit a camera with a proper interface instead.
What the error is really telling you
modprobe fails in two distinct ways, and the wording tells them apart. A module-not-found message means the name you typed matches no file on disk; that is a spelling problem, covered in Test 3. Your error is different: the module was found, its probe routine ran, found no hardware to bind to, and returned ENODEV (errno 19), which the loader prints as No such device.
On this family of boards the sensor is not wired straight into the kernel. The graphics processor's firmware owns the camera port, and the V4L2 module is a bridge: it asks that firmware for a camera and republishes what it finds as a video device node. When the firmware reports no camera attached, the bridge has nothing to register and refuses to insert. In kernel terms the sensor would appear as a V4L2 sub-device — sensors and camera controllers are the usual sub-devices in the media controller model — so a sensor the bridge never saw simply never becomes one.
Read the error as a detection result and work down this map:
| What you see | What it means | First move |
|---|---|---|
ERROR: could not insert 'bcm2835_v4l2': No such device |
Probe found no camera (ENODEV, errno 19) |
Test 1, then Test 2 |
| A module-not-found message | The name on the command line is wrong | Test 3 |
No /dev/video0 after a clean boot |
No node was registered | Read the boot log, then Test 1 |
Test 1: the camera interface is disabled
Fresh OS images ship with the camera port turned off, and that state alone produces exactly your error: the firmware only powers and clocks the port when the boot configuration tells it to, and the bridge loads only against a detected sensor. Check this first because it is the default, not a fault.
Run sudo raspi-config, open the Camera entry, enable it, and reboot when prompted. If the node still does not appear, do a full power cycle — shut down, remove power for a few seconds, reconnect — so the port is powered from a cold start rather than a warm restart. The manual route to the same end is an active camera line in /boot/config.txt followed by a reboot.
Then, before touching drivers again:
- Run
ls /dev/video*: on current images the node appears on its own once the interface is enabled and a sensor is detected. - On legacy stacks, load the bridge once with
sudo modprobe bcm2835-v4l2, then addbcm2835-v4l2to/etc/modulesso it loads at every boot. - Re-open the config screen and read its camera detection line. A camera marked detected, with the node present, ends the incident.
Test 2: the ribbon is unreadable
Interface enabled and the loader still answers No such device? The ribbon is next, in this order of likelihood: contacts facing the wrong way, the plug not seated square and fully home, the latch not closed. Power the board down, re-seat both ends, and cold boot. Then run dmesg and search the boot output for the camera lines: when nothing mentions the camera, the firmware never saw the sensor, and the problem is mechanical, not software. A second, known-good camera on the same port separates the two cases — if it is not detected either, the port or the board is at fault and no driver work will change that.
For a hardware-first walk-through of this stage, see image sensor not detected: check the camera module connections. When the log names the sensor but no node appears, the failure has moved into the device tree — the separate case in sensor probes but no video node: fix the devicetree chain.
Test 3: the module name, the node index and /dev/fb0
The module name on the command line is written with a hyphen: bcm2835-v4l2. The insertion error prints the module's internal name with an underscore — 'bcm2835_v4l2' — and that is normal output, not an instruction to type it that way. An underscore in your command gives a module-not-found message instead, which is how you tell the two apart before wasting an afternoon.
Two neighbours of this error also get blamed on the driver:
- A module can refuse to load because it never needs loading: when the bridge is built into the kernel,
/dev/video0exists andmodprobehas nothing to add. The same trap on the USB side is described in uvcvideo module not loaded: check for a built-in driver. -
/dev/fb0is not a camera. It is the display framebuffer — memory the system renders to the screen with — and it will never deliver frames toVideoCapture. Count only/dev/video*nodes as cameras.
Bring the camera up in OpenCV
/dev/video0 exists and belongs to the sensor. Prove the pipeline end to end in this order:
-
List the nodes and pin the one you want in code:
ls /dev/video*. -
Open the camera with a check whose output you can read:
import cv2 # documented API: cv2.VideoCapture, cv2.CAP_PROP_FRAME_WIDTH
device: int = 0 # illustrative value: first V4L2 node
capture = cv2.VideoCapture(device) # or cv2.VideoCapture("/dev/video0")
opened: bool = capture.isOpened()
width: float = capture.get(cv2.CAP_PROP_FRAME_WIDTH)
grabbed, frame = capture.read()
print("opened:", opened, "| width:", width, "| frame is None:", frame is None)
A run that prints opened: True and frame is None: False proves node, driver and capture path together; the width value is simply the negotiated format.
-
Expect raw colour. Many CSI sensors deliver unprocessed Bayer data, so a grey or channel-swapped image means the pipeline works and the colour step is missing — see CSI camera with no ISP: what raw sensor output means.
-
Close everything else first. The node allows one process at a time, so viewers and test scripts must release it before your application opens it.
-
Inside containers, pass the media device nodes themselves, not only
/dev/video0— the details are in Camera in Docker: pass V4L2 media nodes.
From here the neighbours change character. A stream that opens but stalls is the case in MIPI sensor detected but streaming fails; controls that will not stick are covered in V4L2 exposure and gain settings a sensor driver ignores. Frames that arrive torn or striped point at signal integrity, not software — V4L2 CSI image artifacts on embedded boards works that case.
When to stop debugging the ribbon
Keep the CSI camera when the board and the sensor live together — a bench rig or one sealed enclosure, no relative movement, no door swinging the cable. Replace it when the camera rides on a machine: the flex connector is not a locking industrial connector, the cable has no strain relief, its reach is measured in centimetres, and the failure you just debugged costs line time on every recurrence.
Two replacements keep the compact form factor and lose the ribbon:
- Sensor format
- 1/1.8"
- Lens mount
- C-mount
- Sensor format
- 1/2.9"
- Lens mount
- M12
The LS-BCM-0003 is a 3.1 MP USB3 board-level camera, IMX252, 1/1.8" global shutter, 120 fps, C-mount. The MV-CB016-10GM-M-W is a 1.6 MP GigE board-level camera, IMX296, 1/2.9" global shutter, M12 lens mount, mono. USB3 keeps the wiring to one short locked cable; GigE reaches 100 m per segment on standard copper cabling, so the camera can sit on the line while the host stays in the cabinet.
Where the camera moves with a fixture, use a drag-chain rated cable:
The LS-CBL-0219 is a 3 m USB3.0 camera cable built for drag-chain use; further lengths and connector styles are under camera cables.
Plan one software difference: OpenCV cannot open a GigE Vision camera directly, for the reasons in why OpenCV VideoCapture cannot open a GigE Vision camera — you connect through the transport layer instead. The wider choice of mounts, formats and sensors is in board-level cameras and in board-level camera selection for embedded vision machines; complete machine cameras are in area scan cameras and the camera finder. The same CSI-versus-USB decision on industrial controllers is laid out in CSI versus USB camera options on an industrial controller.
The configurator matches a camera, lens, light, light controller and cables to each other, step by step, and lists only parts that fit what you already picked.
Prevention checklist
- Enable the camera interface before the first boot of a fresh image, and power-cycle after every change to
/boot/config.txt. - Keep one opener per node: close viewers before starting the application, and release the capture object in scripts that finish.
- Route the ribbon away from moving parts, keep the bend away from the connector, and re-check seating after any transport of the machine.
- Pin the node in code by path, not by index, whenever more than one capture device is connected.
- On legacy stacks, keep
bcm2835-v4l2in/etc/modulesso a reboot cannot silently drop the node.
A stream that runs and later stops is a different failure: read a CSI camera that times out after a working period before swapping parts. If the port reports no camera with a second sensor and a verified ribbon, bring the boot log and the exact error line to the contact page and we will pin the failing stage with you.
Questions
Can two programs share /dev/video0 while I test?
No. The node allows one open file at a time, so a viewer, a recording script and your application cannot hold it together. The second open fails with a device-busy error (EBUSY, errno 16). Close every other tool, and make sure finished scripts release the capture object before the next one starts.
Why does VideoCapture(0) grab the wrong camera when several nodes exist?
Index 0 is the first node the driver stack registered, not necessarily your CSI sensor: a USB webcam can take that index. List the nodes with ls /dev/video*, then open the exact path in code, cv2.VideoCapture("/dev/video0"), so the registration order of the day cannot change which camera you get.
Do USB3 and GigE board-level cameras need the same enable step?
No. They enumerate over their own interfaces, so the board's camera-port toggle, the ribbon and the bridge module play no part. A USB3 module appears as a standard video device; a GigE module needs its transport layer and an IP address before software lists it. The failure modes described here do not follow the camera.
How far can the replacement camera sit from the computer?
USB3 keeps passive runs short: the LS-CBL-0219 spans 3 m in a drag-chain build, which is the practical length on a machine. GigE cameras run to 100 m per segment on standard copper cabling, which is why machine-span installations use GigE and a switch near the line.
Could OpenCV itself be causing the error?
No. The failure happens while the kernel inserts the module, before any application runs. OpenCV only reports the aftermath: VideoCapture finds no node to open because none was created. Fix the interface and the ribbon first, then rerun the loader; only a stream that opens but misbehaves points back toward your code.


