kcx
Posts: 15
Joined: Tue Apr 21, 2015 10:29 pm
Location: Central Texas

Camera works on Pi1, not Pi2.

Tue Apr 21, 2015 11:08 pm

Hello all. I have a couple B+ RPIs and recently got a Pi2.
I have a NoIR camera that works fine with the B+ but I cannot get it working with the Pi2.

I assumed I could just swap the camera and the SD card but apparently that is not enough or I have a problem with my Pi2.

In addition to trying my working Raspbian setup I did a fresh one, did a dist-upgrade to the latest as well.
rpi-update done, all up to date (and rebooted).

The camera LED *DOES* come on (and of course I can control it via the config.txt option).


root@raspberrypi:/home/pi# vcgencmd get_camera
supported=1 detected=1
root@raspberrypi:/home/pi#

root@raspberrypi:/home/pi# raspistill -o cam.jpg
mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates

Bottom of config.txt contains (as of lately, didn’t appear required before):
start_x=1
gpu_mem=128

(I tried gpu_mem=256 as well).



When trying the mmal motion binary I’m getting errors like:
[1978585976] [NTC] [ALL] [Apr 21 22:49:23] motion_startup: Using log type (ALL) log level (NTC)
[1978585976] [NTC] [ALL] [Apr 21 22:49:23] become_daemon: Motion going to daemon mode
[1978585976] [NTC] [ALL] [Apr 21 22:49:23] become_daemon: Created process id file /var/run/motion/motion.pid. Process ID is 2306
[1978585976] [NTC] [ALL] [Apr 21 22:49:23] motion_startup: Motion running as daemon process
[1978585976] [NTC] [ENC] [Apr 21 22:49:23] ffmpeg_init: ffmpeg LIBAVCODEC_BUILD 3482368 LIBAVFORMAT_BUILD 3478785
[0] [NTC] [ALL] [Apr 21 22:49:23] main: Thread 1 is from motion.conf
[0] [NTC] [ALL] [Apr 21 22:49:23] main: Thread 1 is device: /dev/video0 input -1
[0] [NTC] [ALL] [Apr 21 22:49:23] main: Stream port 8081
[1] [NTC] [ALL] [Apr 21 22:49:23] motion_init: Thread 1 started , motion detection Enabled
[0] [NTC] [ALL] [Apr 21 22:49:23] main: Waiting for threads to finish, pid: 2306
[1] [ALR] [VID] [Apr 21 22:49:23] mmalcam_start: MMAL Camera thread starting... for camera (vc.ril.camera) of 256 x 144 at 25 fps
[1] [ALR] [VID] [Apr 21 22:49:23] mmalcam_start: MMAL Camera using video capture
[0] [NTC] [STR] [Apr 21 22:49:23] httpd_run: motion-httpd testing : IPV4 addr: 127.0.0.1 port: 8080
[0] [NTC] [STR] [Apr 21 22:49:23] httpd_run: motion-httpd Bound : IPV4 addr: 127.0.0.1 port: 8080
[0] [NTC] [STR] [Apr 21 22:49:23] httpd_run: motion-httpd/mmaltest running, accepting connections
[0] [NTC] [STR] [Apr 21 22:49:23] httpd_run: motion-httpd: waiting for data on 127.0.0.1 port TCP 8080
(so far so good, then after a pause):

[1] [ERR] [VID] [Apr 21 22:49:33] camera component couldn't be enabled
[1] [ALR] [VID] [Apr 21 22:49:33] MMAL Camera cleanup

I am NOT running multiple apps at once using the camera— it’s only mmal-motion or raspistill running by themselves.

Trying raspistill -v:

raspistill -v

raspistill Camera App v1.3.8

Width 2592, Height 1944, quality 85, filename (null)
Time delay 5000, Raw no
Thumbnail enabled Yes, width 64, height 48, quality 35
Link to latest frame enabled no
Full resolution preview No
Capture method : Single capture

Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Opacity 255
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
(10 second pause, then):

mmal: mmal_vc_component_enable: failed to enable component: ENOSPC
mmal: camera component couldn't be enabled
mmal: main: Failed to create camera component
mmal: Failed to run camera app. Please check for firmware updates

After the camera NOT working on the rpi2 I’ve switched it back to the original Pi I was using and it’s fine, so I switched it back.

Doing:

modprobe bcm2835-v4l2
shows in dmesg:
root@raspberrypi:/home/pi# dmesg
[ 176.369111] media: Linux media interface: v0.10
[ 176.387403] Linux video capture interface: v2.00
[ 176.422931] bcm2835-v4l2: scene mode selected 0, was 0
[ 176.423421] bcm2835-v4l2: V4L2 device registered as video0 - stills mode > 1280x720
[ 176.428550] bcm2835-v4l2: Broadcom 2835 MMAL video capture ver 0.0.2 loaded.


Any ideas? I seem to have done most or all of what I’ve seen people recommend trying already… any insight would be welcome!

kcx
Posts: 15
Joined: Tue Apr 21, 2015 10:29 pm
Location: Central Texas

Re: Camera works on Pi1, not Pi2.

Fri May 01, 2015 2:43 am

Got a new Pi2 and it works fine after just swapping the SD card. Maybe an issue with the camera port, not overly concerned now.

Return to “Camera board”