/dev/video0 missing


7 posts
by akaarain » Sat Feb 01, 2014 7:53 am
I am using raspberrypi as root i.e.
rootraspberrypi:/#
i updated and upgraded the pi, enabled ssh and etc according to the instructions provided. i made a program as shown below:
from imgproc import *

# open the webcam
my_camera = Camera(320, 240)
# grab an image from the camera
my_image = my_camera.grabImage()

# open a view, setting the view to the size of the captured image
my_view = Viewer(my_image.width, my_image.height, "Basic image processing")

# display the image on the screen
my_view.displayImage(my_image)

# wait for 5 seconds, so we can see the image
waitTime(5000)
.............................................................
when i execute it, it gives an error
/dev/video0: 2 directory cannot be found
what should i do?
Posts: 8
Joined: Sat Feb 01, 2014 7:44 am
by DougieLawson » Sat Feb 01, 2014 11:47 am
What camera are you using?

If it's a PiCam on the CSI interface you'll need to use the python picamera library.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.
User avatar
Posts: 27543
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
by ghans » Sat Feb 01, 2014 3:59 pm
The foundation V4L2 driver creates a /dev/video device
for the Raspberry Pi Camera. This should make the RPi camera
work with most webcam-aware Linux apps i.e. "motion" without
the "motion-mmal" hack . Should work the same for OpenCV.

viewtopic.php?f=43&t=62364

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 7149
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by DougieLawson » Sun Feb 02, 2014 6:39 pm
So the crux is
sudo rpi-update # to make sure the v4L2 drive is available.
sudo modprobe bcm2835-v4l2 # to load it and create /dev/video0
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.
User avatar
Posts: 27543
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
by omouse » Fri Jan 01, 2016 11:10 pm
DougieLawson wrote:So the crux is
sudo rpi-update # to make sure the v4L2 drive is available.
sudo modprobe bcm2835-v4l2 # to load it and create /dev/video0


This worked for me. I was having previous problems so in case anyone else has this issue; check to make sure you inserted the camera ribbon into the slot correctly, mine was in backwards.

You can add bcm2835-v4l2 to modprobe.d so whenever the pi is restarted it will always load up the module and always have /dev/video0 available.
Posts: 4
Joined: Fri Jan 01, 2016 11:06 pm
by golferschneider » Fri Apr 01, 2016 10:03 pm
When I did "sudo modprobe bcm2835-v4l2" i got "ERROR: could not insert 'bcm2835-v4l2': Operation not permitted" what am I doing wrong?
Posts: 2
Joined: Mon Mar 28, 2016 7:50 pm
by reijechk » Sun May 08, 2016 9:48 pm
lsmod and dmesg show the Linux webcam module loaded properly; but no /dev/video0 was created.

Attempting "sudo modprobe bcm2835-v4l2" results in:
modprobe: ERROR: could not insert 'bcm2835_v4l2': Operation not permitted

What needs to be done?
Posts: 2
Joined: Sun May 08, 2016 9:18 pm