Cannot run raspistill on octoprint

Camera model
Arudocam manual focus

What is the problem?
I can't seem to run the program to manually focus the camera. The step I'm stuck on is to run raspistill. I keep getting "failed to enable component: ENOSPC". It's important to note that I am able to see the webcam feed in octoprint.

pi@octopi:~ $ raspistill -t 0
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

What did you already try to solve it?

  1. Could it be my hardware connection?
    I don't think so:
pi@octopi:~ $ vcgencmd get_camera
supported=1 detected=1
  1. Could it be my memory availability?
    I don't think so. I tried changing the alloted memory in the cmdline.txt from 128 to 256 but it didn't work. I changed it back but now I can't find the instructions, so I can't try again to verify I did it right.

  2. Could it be that the camera is not enabled in raspi-config?
    No, I enabled it there.

  3. Here's what I think is the problem: I read that only one process can control the camera at a time. Could this be it?
    I've been trying to figure out what other process might be controlling the camera, but I can't figure out which one, which is why I'm posting here. My leading theory is mjpg_streamer, but I can't figure out how to kill it. I did

sudo killall mjpg_streamer

After I do this, mjpg_streamer is still running in ps aux. I also tried to kill Octoprint, but I'm still not able to do raspistill.

Logs (/var/log/webcamd.log, syslog, dmesg, ... no logs, no support)

I'm honestly not sure what logs would be relevant. I'm happy to provide some if necessary.

Additional information about your setup (OctoPrint version, OctoPi version, ...)
Running on Raspberry Pi 3 Model B Plus Rev 1.3
env.plugins.pi_support.octopi_version : 0.18.0
env.plugins.pi_support.throttle_state : 0x80008
env.python.pip : 20.3.3
env.python.version : 3.7.3
env.python.virtualenv : true
octoprint.safe_mode : false
octoprint.version : 1.5.3
printer.firmware : Marlin Creality 3D

Hello @ebodes !

I think at first you have a thermal issue:

This may also be the issue for your problem.

I'm not familiar with this, are you? I'm not sure how to investigate further. Here's some ideas, can you tell me if any of these are viable?

Could this be solved by relocated my Pi? It's not in a particularly hot location, but it is in a case (see picture). Should I try removing it from the case?

I'm running about ten plug-ins, including the spaghetti detective. Is it worth disabling some of these to try to limit the temp?

Is this somethings that could be solved by getting a newer Pi? I heard that the 4 runs pretty hot, too, but would it be better equipped to run octopi and all my plugins?

Edit: one more option: I have an extra small heatsink, could that cool my Pi in any meaningful amount?

I just checked my temp:

pi@octopi:~ $ vcgencmd measure_temp
temp=61.2'C

The case has some ventilation openings, so some air can flow.

You could mount that small heatsink to the CPU, yes.
A small fan would help too.

Ok, so I disabled several plug-ins, added the heatsink and am running a fan over my pi and I'm no longer throttled.

pi@octopi:~ $ vcgencmd get_throttled
throttled=0x0
pi@octopi:~ $ vcgencmd measure_temp
temp=36.5'C

However, I'm still getting the same problem when I run raspistill:

pi@octopi:~ $ raspistill -t 0
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 really think the problem is because something else is using the camera and the camera can only be used my one process at a time, but I can't figure out what process might be using it or how to stop it.

Any ideas?

also uses the cam. Have you disabled it too?

Yes, it's disabled. But it's important to note that I tried actually stopped the entire octoprint service with:

sudo service octoprint stop

And I was still unable to fix it. I think there are other background services that use the camera, such as mjpg_streamer, and I can't figure out how to kill them.

sudo systemctl stop webcamd

pi@raspberrypi:~ $ sudo service webcamd stop
Failed to stop webcamd.service: Unit webcamd.service not loaded.

Still failed brother :frowning:

Hi there.
I also had this issue and fixed it due to 5 hours ).
Here is my fix:

  1. sudo nano /boot/config.txt
  2. add dtoverlay=imx708 as new line to the end of the file
  3. sudo reboot
    imx708 it is driver for my camera module 3 based on the following doc: https://www.raspberrypi.com/documentation/computers/camera_software.html#if-you-do-need-to-alter-the-configuration
    I think it will help you )