balena-io-experimental / balena-rpi-python-picamera

balena + python + raspberry pi camera module
39 stars 21 forks source link

modprobe: ERROR: could not insert 'bcm2835_v4l2': Operation not permitted #5

Closed SteveEdson closed 7 years ago

SteveEdson commented 7 years ago

Getting this issue with a PI 3:

 Installing application 'registry.resin.io/camera/939ea0ad6cac5fae4a8f2503a9f70afd4ea35e15'
10.02.17 16:12:17 [+0000] Installed application 'registry.resin.io/camera/939ea0ad6cac5fae4a8f2503a9f70afd4ea35e15'
10.02.17 16:12:17 [+0000] Starting application 'registry.resin.io/camera/939ea0ad6cac5fae4a8f2503a9f70afd4ea35e15'
10.02.17 16:12:20 [+0000] Started application 'registry.resin.io/camera/939ea0ad6cac5fae4a8f2503a9f70afd4ea35e15'
10.02.17 16:12:20 [+0000] Systemd init system enabled.
10.02.17 16:12:20 [+0000] systemd 215 running in system mode. (+PAM +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ -SECCOMP -APPARMOR)
10.02.17 16:12:20 [+0000] Detected virtualization 'other'.
10.02.17 16:12:20 [+0000] Detected architecture 'arm'.
10.02.17 16:12:20 [+0000] Set hostname to <raspberrypi3-9ca22eb>.
10.02.17 16:12:23 [+0000] modprobe: ERROR: could not insert 'bcm2835_v4l2': Operation not permitted
10.02.17 16:12:24 [+0000] Serving HTTP on 0.0.0.0 port 80 ...

Any ideas? Checked that start_x=1 and gpu_mem=128

Thanks

emirotin commented 7 years ago

It can fail sometimes and also the module has been renamed at some point if I'm not mistaken

Here are the lines I've used for my project some time ago:

modprobe v4l2_common || true
modprobe bcm2835-v4l2 || true

I think actually only the 1st one is needed.

SteveEdson commented 7 years ago

Thanks for the reply. modprobe v4l2_common || true doesn't error, but the camera still doesn't work:

mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
10.02.17 17:14:38 [+0000] mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
10.02.17 17:14:38 [+0000] Traceback (most recent call last):
10.02.17 17:14:38 [+0000] File "capture.py", line 6, in <module>
10.02.17 17:14:38 [+0000] with picamera.PiCamera() as camera:
10.02.17 17:14:38 [+0000] File "/usr/local/lib/python2.7/site-packages/picamera/camera.py", line 415, in __init__
10.02.17 17:14:38 [+0000] self._init_camera(camera_num, stereo_mode, stereo_decimate)
10.02.17 17:14:38 [+0000] File "/usr/local/lib/python2.7/site-packages/picamera/camera.py", line 444, in _init_camera
10.02.17 17:14:38 [+0000] "Camera is not enabled. Try running 'sudo raspi-config' "
10.02.17 17:14:38 [+0000] picamera.exc.PiCameraError: Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled.
SteveEdson commented 7 years ago

Oh wait, I had the camera in the wrong port! Thanks for the help :D

emirotin commented 7 years ago

:)

Both of these lines don't error because of the || true part. So what did the trick — changing the port or changing the port and the module name?

SteveEdson commented 7 years ago

Both, changing the module name fixed the software issue, the second line still doesn't work but obviously doesn't fail.

Then I had the second issue which made me realize my cable was in the wrong port. I'd recommend updating the docs/code for the v4l2_common module.

Thanks again.

On Fri, Feb 10, 2017, 22:39 Eugene Mirotin notifications@github.com wrote:

:)

Both of these lines don't error because of the || true part. So what did the trick — changing the port or changing the port and the module name?

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/resin-io-projects/resin-rpi-python-picamera/issues/5#issuecomment-279086183, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJXKPWQuraQEhG-8MwnXAOcYsGjoKJkks5rbOcWgaJpZM4L9jtk .

emirotin commented 7 years ago

OK got you, thanks