GLS
Posts: 5
Joined: Tue Sep 24, 2013 6:41 pm

RaspberryPi Camera Board

Wed Jan 08, 2014 9:47 pm

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 ?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26442
Joined: Sat Jul 30, 2011 7:41 pm

Re: RaspberryPi Camera Board

Wed Jan 08, 2014 10:07 pm

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
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

GLS
Posts: 5
Joined: Tue Sep 24, 2013 6:41 pm

Re: RaspberryPi Camera Board

Wed Jan 08, 2014 10:27 pm

Thanks for the tip. Unfortunately I have tried sudo rpi-update now, rebooted and it made no difference....

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26442
Joined: Sat Jul 30, 2011 7:41 pm

Re: RaspberryPi Camera Board

Thu Jan 09, 2014 9:23 am

What GPU memory split do you have?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

GLS
Posts: 5
Joined: Tue Sep 24, 2013 6:41 pm

Re: RaspberryPi Camera Board

Thu Jan 09, 2014 9:24 pm

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.

GLS
Posts: 5
Joined: Tue Sep 24, 2013 6:41 pm

Re: RaspberryPi Camera Board

Sat Jan 18, 2014 7:11 pm

Use this instead of DeviceRead in Mathematica:-
image = Import["!raspistill -n -w 600 -h 400 -t 5 -o -", "JPG"]

Arnoud
Posts: 9
Joined: Thu Jul 18, 2013 3:52 pm

Re: RaspberryPi Camera Board

Tue Jan 21, 2014 8:50 pm

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

Return to “Mathematica”