akaarain
Posts: 8
Joined: Sat Feb 01, 2014 7:44 am

/dev/video0 missing

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?

User avatar
DougieLawson
Posts: 29306
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: /dev/video0 missing

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.

ghans
Posts: 7321
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: /dev/video0 missing

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.

http://www.raspberrypi.org/phpBB3/viewt ... 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

User avatar
DougieLawson
Posts: 29306
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: /dev/video0 missing

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.

omouse
Posts: 4
Joined: Fri Jan 01, 2016 11:06 pm

Re: /dev/video0 missing

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.

golferschneider
Posts: 2
Joined: Mon Mar 28, 2016 7:50 pm

Re: /dev/video0 missing

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?

reijechk
Posts: 2
Joined: Sun May 08, 2016 9:18 pm

Re: /dev/video0 missing

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?

User avatar
ninazu
Posts: 3
Joined: Fri Apr 07, 2017 2:57 pm
Location: Ukraine
Contact: AOL

Re: /dev/video0 missing

Wed May 03, 2017 7:35 am

Dont work for me.
pi@raspberrypi:~$ zbarcam /dev/video0 --nodisplay
ERROR: zbar processor in _zbar_video_open():
system error: opening video device '/dev/video0': No such file or directory (2)
pi@raspberrypi:~$ ls -la /dev/video0
ls: cannot access /dev/video0: No such file or directory
pi@raspberrypi:~$ sudo rpi-update
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
*** Performing self-update
*** Relaunching after update
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
*** Your firmware is already up to date
pi@raspberrypi:~$ sudo modprobe bcm2835-v4l2
pi@raspberrypi:~$ ls -la /dev/video0
ls: cannot access /dev/video0: No such file or directory
pi@raspberrypi:~$ lsmod | grep video
videobuf2_vmalloc 5849 1 bcm2835_v4l2
videobuf2_memops 1939 1 videobuf2_vmalloc
videobuf2_v4l2 16841 1 bcm2835_v4l2
videobuf2_core 31749 2 bcm2835_v4l2,videobuf2_v4l2
videodev 177702 4 v4l2_common,videobuf2_core,bcm2835_v4l2,videobuf2_v4l2
media 28994 1 videodev
PiZeroW, RaspbianWithPixel(2017-04-10), JT-ZERO-v2.0 YH

Return to “Troubleshooting”

Who is online

Users browsing this forum: No registered users and 50 guests