mavpi
Posts: 16
Joined: Fri Dec 13, 2013 1:49 pm

SimpleCV camera operation not permitted

Sun Mar 23, 2014 4:40 am

I followed the instructions to install SimpleCV given in this post (http://www.raspberrypi.org/phpBB3/viewtopic.php?t=57788). But I get the following errors.

Code: Select all

SimpleCV:1> cam = Camera(0, {"width":1280, "height":1024})
WARNING: caught exception: SystemError("Cannot open '/dev/video0': 1, Operation not permitted",)
WARNING: SimpleCV can't seem to find a camera on your system, or the drivers do not work with SimpleCV.
What can I do to make it work? I am using the raspberry pi camera board with stock raspbian.

ygramoel
Posts: 9
Joined: Fri Oct 03, 2014 7:23 pm

Re: SimpleCV camera operation not permitted

Tue Mar 24, 2015 9:04 am

I am experiencing a very similar problem, with code that worked only a few days ago. Is the problem related to a recent software update?

The error occurs even when running as root.

The same problem can be reproduced without OpenCV, with the simple program shown below. I am still investigating further.
Any suggestions are welcome.

Code: Select all

#include <fcntl.h>
#include <err.h>

int main()
{
  const char *device = "/dev/video0";
  int fd = open(device, O_RDWR | O_NONBLOCK, 0);
  if (fd == -1) {
    err(1,"Error: Cannot open %s",device);
  }
}

Code: Select all

$ g++    -c -o opencam opencam.cpp
$ sudo ./opencam
opencam: Error: Cannot open /dev/video0: Operation not permitted

ygramoel
Posts: 9
Joined: Fri Oct 03, 2014 7:23 pm

Re: SimpleCV camera operation not permitted

Tue Mar 24, 2015 9:21 am

The problem in my case was that the camera was not properly connected. The camera cable was inserted at an angle into the connector on the RPi board, probably due to uncareful manipulation.

Problem solved for me.

Return to “Troubleshooting”