Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Pi Cam problem

3,679 views
Skip to first unread message

Adrian

unread,
Apr 18, 2015, 6:12:49 AM4/18/15
to
Pi B running Raspbrian

I've had a Pi Cam hooked up to my Pi for a while now, and whilst it has
only been used intermittently, it has worked. I've been able to run
Motion and (from a Ubuntu box) vlc successfully.

A few weeks back, I noticed that the camera was no longer working. I've
now had time to do a bit of digging, and if I run :

raspistill -o test.jpg

I get :

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


I've tried swapping the Pi Cam for another brand new one, and I still
get the same result. Any suggestions as to where to look next ?

Thanks

Adrian
--
To Reply :
replace "bulleid" with "adrian" - all mail to bulleid is rejected
Sorry for the rigmarole, If I want spam, I'll go to the shops
Every time someone says "I don't believe in trolls", another one dies.

Alex Potter

unread,
Apr 18, 2015, 6:59:03 AM4/18/15
to
On Sat, 18 Apr 2015 11:12:38 +0100, Adrian wrote:

> I've tried swapping the Pi Cam for another brand new one, and I still
> get the same result. Any suggestions as to where to look next ?

As the error message mentions checking for firmware updates, is it
possibly one of those occasions where executing `sudo rpi-update` is
called for?

--
Alex

Dom

unread,
Apr 18, 2015, 8:29:14 AM4/18/15
to
On 18/04/15 11:12, Adrian wrote:
> Pi B running Raspbrian
>
> I've had a Pi Cam hooked up to my Pi for a while now, and whilst it has
> only been used intermittently, it has worked. I've been able to run
> Motion and (from a Ubuntu box) vlc successfully.
>
> A few weeks back, I noticed that the camera was no longer working. I've
> now had time to do a bit of digging, and if I run :
>
> raspistill -o test.jpg
>
> I get :
>
> 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
>
>
> I've tried swapping the Pi Cam for another brand new one, and I still
> get the same result. Any suggestions as to where to look next ?
>

What is your memory split? I think the ENOSPC error can occur if you
haven't allocated enough memory to the GPU in config.txt.

You can check how much is allocated with

vcgencmd get_mem gpu

Adrian

unread,
Apr 19, 2015, 5:11:35 AM4/19/15
to
In message <7mWyjiAW...@ku.gro.lloiff>, Adrian
<bul...@ku.gro.lioff> writes
>Pi B running Raspbrian
>
>I've had a Pi Cam hooked up to my Pi for a while now, and whilst it has
>only been used intermittently, it has worked. I've been able to run
>Motion and (from a Ubuntu box) vlc successfully.
>
>A few weeks back, I noticed that the camera was no longer working.
>I've now had time to do a bit of digging, and if I run :
>
>raspistill -o test.jpg
>
>I get :
>
>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
>
>
>I've tried swapping the Pi Cam for another brand new one, and I still
>get the same result. Any suggestions as to where to look next ?
>
>Thanks
>
>Adrian

Thanks to Dom and Alex Potter for their replies.

vcgencmd get_mem gpu

gpu=128M

rpi-update appears to have succeeded (no error messages, and a
successful reboot afterwards), but still no success with the camera,
running the raspistill command gives the same output as before.

Dave Liquorice

unread,
Apr 19, 2015, 1:43:04 PM4/19/15
to
On Sat, 18 Apr 2015 11:12:38 +0100, Adrian wrote:

> I've tried swapping the Pi Cam for another brand new one, and I still
> get the same result. Any suggestions as to where to look next ?

The camera is still enabled via raspi-config isn't it?

--
Cheers
Dave.



Adrian

unread,
Apr 19, 2015, 2:19:38 PM4/19/15
to
In message <nyyfbegfubjuvyypb...@srv1.howhill.co.uk>, Dave
Liquorice <allsortsn...@howhill.com> writes
Thanks for the suggestion.

I've run raspi-config, and that suggested that the camera was disabled.
I set it to enabled, and rebooted, and I'm still getting the same error.

Not sure if this is right or not, but post reboot, I checked
raspi-config again, and it still had the camera as disabled.

For what it's worth, the red light on the camera is on, so if nothing
else, it is getting power.

Dave Liquorice

unread,
Apr 19, 2015, 3:58:03 PM4/19/15
to
On Sun, 19 Apr 2015 19:11:12 +0100, Adrian wrote:

> I've run raspi-config, and that suggested that the camera was disabled.
> I set it to enabled, and rebooted, and I'm still getting the same error.
>
> Not sure if this is right or not, but post reboot, I checked
> raspi-config again, and it still had the camera as disabled.

That's what raspi-config does here. My camera is working.

> For what it's worth, the red light on the camera is on, so if nothing
> else, it is getting power.

Wonder if this bit of python will do what it's supposed to do?

ledflash.py

#!/usr/bin/env python
import time
import RPi.GPIO as GPIO

# Use GPIO numbering
GPIO.setmode(GPIO.BCM)

# Set GPIO for camera LED
CAMLED = 5

# Set GPIO to output
GPIO.setup(CAMLED, GPIO.OUT, initial=False)

# Five iterations with half a second
# between on and off
for i in range(100):
GPIO.output(CAMLED,True) # On
time.sleep(0.5)
GPIO.output(CAMLED,False) # Off
time.sleep(0.5)

GPIO.cleanup()

--
Cheers
Dave.



A. Dumas

unread,
Apr 19, 2015, 4:02:10 PM4/19/15
to
Also, and probably regularly:
sudo apt-get update && sudo apt-get upgrade

Adrian

unread,
Apr 19, 2015, 4:29:44 PM4/19/15
to
In message <55340998$0$2953$e4fe...@news.xs4all.nl>, A. Dumas
<alex...@dumas.fr.invalid> writes
Sorry, I should have said, I did that before the rpi-update.

Adrian

unread,
Apr 19, 2015, 4:51:48 PM4/19/15
to
Thanks.

If it is supposed to flash the light on and off, it works (I had to run
it as root).

Dave Liquorice

unread,
Apr 19, 2015, 5:13:03 PM4/19/15
to
On Sun, 19 Apr 2015 21:41:47 +0100, Adrian wrote:

> If it is supposed to flash the light on and off, it works (I had to run
> it as root).

Yep, flashes the LED, though that probably just means that the LED is
connected to the relevant GPIO pin. Rather than sending a command to
the camera module to switch the LED on/off...

--
Cheers
Dave.



Adrian

unread,
Apr 25, 2015, 9:43:33 AM4/25/15
to
In message <7mWyjiAW...@ku.gro.lloiff>, Adrian
<bul...@ku.gro.lioff> writes
>Pi B running Raspbrian
>
>I've had a Pi Cam hooked up to my Pi for a while now, and whilst it has
>only been used intermittently, it has worked. I've been able to run
>Motion and (from a Ubuntu box) vlc successfully.
>
>A few weeks back, I noticed that the camera was no longer working.
>I've now had time to do a bit of digging, and if I run :
>
>raspistill -o test.jpg
>
>I get :
>
>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
>
>
>I've tried swapping the Pi Cam for another brand new one, and I still
>get the same result. Any suggestions as to where to look next ?
>

Right, I think I have the answer to this one.

It seems that you can't run either vlc or raspistill if motion is
already running. However, if you stop motion, you can run either vlc or
raspistill.

I assume that in the past when I've had vlc running, I've had motion
turned off.

wol...@gmail.com

unread,
Nov 11, 2017, 4:53:08 PM11/11/17
to
After look through the whole internet, I solved the problem by raising the memory allocated for the GPU. Thank very, very much!!!
Message has been deleted

Hanif Izzudin

unread,
Sep 11, 2021, 11:55:01 PM9/11/21
to
Hello brother, finally i can solve this problem after a lot of hours troubleshooting.

I already share it in my YouTube (https://youtu.be/on8UlkRvLok)

This problem only occur in camera raspberry pi V2.1 (IMX219) from Element14. But in camera raspberry pi V2.1 from OKdo, i don't get this error

So, the solution when error
"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"

You need some initialization with a works camera (me camera from OKdo).
So, the step is
1. Plug your works camera to Raspberry Pi (me using Raspberry Pi 4B)
2. Turn on your Raspberry Pi
3. check
"vcgencmd get_camera"
to make sure your hardware is detected the camera
4. capture image using
"raspistill -v"
and camera will capture the image
5. Then replace the works camera with ENOSPC Error Camera (from Element14)
6. then try to capture the image
"raspistill -v"
and the ENOSPC Error will not occur

Notes:
- But, after the ENOSPC Error Camera works, and then you restart/shutdown the raspberry pi, the error will occur again :(

OS Raspberry Pi 4 Model B (4GB)
- Linux raspberrypi 5.10.60-v7l+ #1449 SMP Wed Aug 25 15:00:44 BST 2021 armv7l GNU/Linux

GIRI VIGNESH BALAKRISHNAN

unread,
Jan 30, 2023, 8:08:32 AM1/30/23
to
On Sunday, November 12, 2017 at 3:23:08 AM UTC+5:30, wol...@gmail.com wrote:
> After look through the whole internet, I solved the problem by raising the memory allocated for the GPU. Thank very, very much!!!
To what value did u increase it?
thanks in advance :)

Ricardo Alexandre

unread,
Aug 3, 2023, 8:13:59 PM8/3/23
to
Em sábado, 11 de novembro de 2017 às 19:53:08 UTC-2, wol...@gmail.com escreveu:
> After look through the whole internet, I solved the problem by raising the memory allocated for the GPU. Thank very, very much!!!

Thanks, in my case it was GPU memory too. I was at 128, I increased it to 228 and it worked perfectly. Hugs.
0 new messages