Pi Cam problem

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.
Reply to
Adrian
Loading thread data ...

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
Reply to
Alex Potter

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

Reply to
Dom

In message , Adrian writes

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.

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.
Reply to
Adrian

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

--
Cheers 
Dave.
Reply to
Dave Liquorice

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.

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.
Reply to
Adrian

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

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.
Reply to
Dave Liquorice

Also, and probably regularly: sudo apt-get update && sudo apt-get upgrade

Reply to
A. Dumas

Sorry, I should have said, I did that before the rpi-update.

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.
Reply to
Adrian

Thanks.

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

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.
Reply to
Adrian

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.
Reply to
Dave Liquorice

In message , Adrian writes

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.

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.
Reply to
Adrian

After look through the whole internet, I solved the problem by raising the memory allocated for the GPU. Thank very, very much!!!

Reply to
wols.cl

Hello brother, finally i can solve this problem after a lot of hours troubleshooting.

I already share it in my YouTube

formatting link

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 Code: Select all

vcgencmd get_camera to make sure your hardware is detected the camera

  1. capture image using Code: Select all

raspistill -v and camera will capture the image

  1. Then replace the works camera with ENOSPC Error Camera (from Element14)
  2. then try to capture the image Code: Select all

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

Reply to
Hanif Izzudin

Hello brother, finally i can solve this problem after a lot of hours troubleshooting.

I already share it in my YouTube

formatting link

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

Reply to
Hanif Izzudin

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.