Page 1 of 1

RaspberryPi Camera Board

Posted: Wed Jan 08, 2014 9:47 pm
by GLS
I've been following the guide on using the Camera with Wolfram Mathematica document http://community.wolfram.com/groups/-/m/t/166778. I am using a model B with NOOBS v1.3.3. The camera board works fine with raspistill -v -o test.jpg, but using DeviceRead["RaspiCam"] mathematica halts, and the Red LED on the Camera comes on like it is waiting. After this condition the camera needs the pi to be rebooted for it to work correctly again. For example:-

pi@raspberrypi ~ $ raspistill -v -o test.jpg

raspistill Camera App v1.3.6

Width 2592, Height 1944, quality 85, filename test.jpg
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
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

Has anybody else experienced this, and how can it be fixed ? Is it due to the new camera driver in NOOBS V1.3.3 ?

Re: RaspberryPi Camera Board

Posted: Wed Jan 08, 2014 10:07 pm
by jamesh
Can you update the firmware - there is a new fix in there which prevents the camera being started up twice (there was a reference counting issue on the power line to the camera), which may be what you are seeing here.

sudo rpi-update

Re: RaspberryPi Camera Board

Posted: Wed Jan 08, 2014 10:27 pm
by GLS
Thanks for the tip. Unfortunately I have tried sudo rpi-update now, rebooted and it made no difference....

Re: RaspberryPi Camera Board

Posted: Thu Jan 09, 2014 9:23 am
by jamesh
What GPU memory split do you have?

Re: RaspberryPi Camera Board

Posted: Thu Jan 09, 2014 9:24 pm
by GLS
The settings are the defaults for NOOBS V.1.3.3 - GPU128, it is a clean install. 8GB SD card.
I can load photos saved by Raspistill using Import["test.jpg"] in to Mathematica.

DeviceRead["RaspiCam"] hangs the mathematica notebook with the camera red LED remaining on, and the processor loading graph drops down after a short burst of activity. Logging off and back on again frees the camera for further use with Raspistill.

Re: RaspberryPi Camera Board

Posted: Sat Jan 18, 2014 7:11 pm
by GLS
Use this instead of DeviceRead in Mathematica:-
image = Import["!raspistill -n -w 600 -h 400 -t 5 -o -", "JPG"]

Re: RaspberryPi Camera Board

Posted: Tue Jan 21, 2014 8:50 pm
by Arnoud
DeviceRead["RaspiCam"] uses raspistill with -t 0 (which used to work in earlier versions of raspistill). This will be addressed in the next update for the Wolfram Language for Raspberry Pi. There is also an immediate patch available from this Wolfram Community post: http://community.wolfram.com/groups/-/m/t/166778