1

I recently bought a Raspberry Pi 3B+ and a Pi Noir Camera and attempted to set them up. I followed the install instructions on the Pi website for the board and camera, and unfortunately received an error when trying to run the camera preview script.

The error was as follows:

camera = picamera.PiCamera()
mmal: mmal_vc_component_enable: failed to enable component : ENOSPC
Traceback (most recent call last):
  File "<stdin>", line, in <module>
  ...
  ...
picamera.exc.PiCameraMMALError: Camera component couldn't be enabled: Out of
resources

I have verified that it is a software issue and not a hardware issue as I have tried setting up two different Pi boards and NOIR cameras.

I checked the connection of the camera to the pi board using vcngencmd get_camera. I then also attempted to substitute the camera module I had plugged in for a different one (as I bought two) and received the same error. I used the config utility to enable the camera and reboot the board after doing so.

I have also tried updating the packages, as recommmended in many previous forums, no dice.

Additionally, no manual changes were made to the /boot/config.txt and no other scripts are running. This is the first script to be run on the board. I have no other programs running or trying to access the camera as this was literally plugged in and set up straight out of the box.

Any help would be much appreciated. Thanks!

Ghanima
  • 15,855
  • 15
  • 61
  • 119
user94448
  • 11
  • 2
  • Can you explain in more detail why you think it's a software problem? It's not clear to me what exactly you did to conclude that. Also: no resources can mean the camera is not properly enabled. Did you use the RPF config utility or did you do that manually? Did you make any manual changes to /boot/config.txt? Are you running more than 1 program/script that uses the camera concurrently? The camera hardware does not support that. – Dirk Nov 26 '18 at 20:01
  • Please add any additional details to your question – Dirk Nov 26 '18 at 20:12
  • Hi Dirk, I believe it is a software problem because I checked the connection of the camera to the pi board using vcngencmd get_camera. I then also attempted to substitute the camera module I had plugged in for a different one (as I bought two) and received the same error. I did use the config utility to enable the camera and reboot the board after doing so. No manual changes were made to the /boot/config.txt and no other scripts are running. This is the first script to be run on the board. – user94448 Nov 26 '18 at 20:12
  • What did vcgencmd get_camera say? BTW: do you know that there are some Pi3B+ out there that have the connector the wrong way around? – Dirk Nov 26 '18 at 20:28
  • It displayed: supported = 1 detected = 1. I did try reversing the connector with no luck. I also tried the camera on a pi zero W and it displayed the same error. – user94448 Nov 26 '18 at 20:33
  • Ok. Looking at the error msg I would say there are 2 main reasons: GPU memory. Just double check that with vcgencmd get_mem gpu. Second one: multiple camera sessions. Have you made sure that there is just one program trying to access the camera board? – Dirk Nov 26 '18 at 20:37
  • Sorry I neglected to mention we reallocated 256 to the GPU memory, instead of the normal 128 as some forums had suggested this had been an issue. I believe there is only one program running on the camera board since I used the command "ps -a" to list all of the currently running processes and no others came up. Could there be any "hidden" programs running that I'm not aware of? This is the first program to run since I took the pi board out of the box. – user94448 Nov 26 '18 at 20:42
  • we reallocated 256 to the GPU memory Just for my peace of mind: can you enable the camera again with raspi-config and then reboot. Check the camera and the actual allocated GPU memory (tbh: I doubt if increasing the GPU mem actually has any positive effect) – Dirk Nov 26 '18 at 20:49
  • Just tried - still no luck :/ – user94448 Nov 26 '18 at 20:54
  • You've checked with https://raspberrypi.stackexchange.com/questions/13764/what-causes-enospc-error-when-using-the-raspberry-pi-camera-module ? – Gerard H. Pille Nov 27 '18 at 03:33
  • Yes, unless there are dual processes taing place that Im not aware of. But this is the only program to run on the pi board since taking it out of the box. No other programs installed and no other running code. – user94448 Nov 27 '18 at 14:18
  • Have you checked memory usage, i.e. by running top? – Fabian Nov 27 '18 at 14:57
  • UPDATE: I managed to get the camera module working on the Pi 3B+; however I am not sure what I did. Afterwards, I transferred the SIM card from the Pi3B+ to a Pi Zero module to run the camera. I recevied the same error as before. I again tried changing the camera module, but no dice. This leads me to believe that I must have coded something that directly changed something on Pi board itself, as the exacts same SD card and camera module worked on the Pi 3B+ but not the Pi Zero. Any ideas how to get the camers working on the Pi Zero? – user94448 Dec 04 '18 at 15:35

0 Answers0