I'm trying to use the library zbar to scan qr codes using Raspberry pi's camera module. I've connected and tested the camera, but I don't know how to access that from the library because it isn't on /dev/video0 or any location I can find. So I went here and followed these instructions:

raspberrypi ~ $ uv4l --driver raspicam --auto-video_nr --encoding h264 --width 1920 --height 1080 

After that I can use my camera and can find it on /dev/video0 through " ls /dev/video* " . However, when I run zbar through python, it doesn't work and, afterwards, " ls /dev/video* " returns no results!

The code I use is very similar to the one in here

  • The driver might be crashing due something this zbar does. I noticed similar problems with mjpeg streamer when video0 gets blocked, no video, video2 appears but is black video. Or there could be a bug in the driver still.
    – Piotr Kula
    Commented Nov 28, 2014 at 23:08
  • I am getting fine results.. can you elaborate with errors what you are getting.. or Do you mean when you try to run camera it works and then it breaks..?? it could be the power problem also give an external power supply to your USB hub and then put camera in it .. check if it works
    – RahulAN
    Commented Dec 29, 2014 at 5:47

2 Answers 2


You can access the camera board on /dev/video0 by running the command:

sudo modprobe bcm2835-v4l2

This will have to be run on every boot of the device. Or you can put modprobe bcm2835-v4l2 in /etc/rc.local to make it run on every boot automatically.


Manually running modprobe bcm2835-v4l2 is good for temporarily loading a kernel module. To load a module at every boot, add it to /etc/modules:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.