Pi cam woes - just not streaming ;(

What is the problem?

My Raspberry Pi Webcam does not seem to be working (with or without octoprint)

What did you already try to solve it?

I have tried turning the pi in first then plugging the camera in, and vice versa. I have checked to make sure the “cable” was plugged in the right way.

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)

Latest octoprint
Raspberry pi 3B+
Ender 3

I’ve articulated it better elsewhere, and will not have a chance to check for specific settings until after work.

Hopefully the Facebook pic helps.

What type of camera we're talking about?

On the one hand you write "does not seem to be working (with or without octoprint)" so I would asume it's a USB webcam, because the Raspi cam cannot work without a Raspi.

On the other hand you write "I have checked to make sure the “cable” was plugged in the right way" so I would asume it's a Raspi cam, because here is the direction of the flat cable mandatory.

And - in case it's a Raspi cam - "turning the Raspi on first then plugging the camera in" is not realy the recommended, healthy way ...

Ok, I’m sorry if I did I did not call it by it’s correct name, but it is a raspi cam.

In regards to your second comment, no, plugging it in while the unit is on may not be the best method, but when you’ve exhausted all other methods, you try and get “creative”.

The Pi camera needs to be enabled using raspi-config

Unless you are running OctoPi, in which case the image already ships with the camera being enabled.

The pi cam has already been configured. :frowning:

Things to check:

  • ensure you have a genuine pi cam, not some cheap knock off that needs weird drivers or anything
  • /var/log/webcamd.log - might tell you if the webcam server is even seeing the camera
  • output of vcgencmd get_camera - will tell you if the Pi is seeing the camera (and if it's indeed enabled)
  • where you plugged in the cam on the Pi - there are two connectors on there, if you plug the camera into the one that says "Display" at the back of the board it won't work, you need to use the "Camera" port more towards the front:
  • the orientation of the cabling - metallic side must face towards the pins inside the connector. On the Pi that's towards the back if I remember correctly, not towards the USB connectors.
  • are all connectors locked and the cable inserted straight?
  • if possible: different cable, different Pi, different camera (to rule out hardware failure)
1 Like

The things I can answer when I'm not at home:

The orientation is correct, it is in the correct connector, and all of the connectors are locked and the cable is straight.

https://www.amazon.com/gp/product/B075149PWB/ref=oh_aui_search_detailpage?ie=UTF8&psc=1 is the specific camera I purchased. Forgive me if a link like this is not allowed.

I will attempt /var/log/webcamd.log and the output of vcgencmd get_camera when I get home, but also on my way home, I may pick up a Logitech C270 HD Webcam and use the USB drive, then return the camera.

I did a write-up for the Pi NoIR camera v2 with lots of photos, if that helps. Each photo indicates correct orientation of the ribbon cable before insertion.

After reviewing the photos, do the raspistill -o first-light.jpg thing.

pi@ender3:~ $ /var/log/webcamd.log
-bash: /var/log/webcamd.log: Permission denied

pi@ender3:~ vcgencmd get_camera supported=1 detected=1 pi@ender3:~

Well, the "denied" worries me, but the fact that (I think) it locates a camera is a good sign!

pi@ender3:~ $ raspistill -o first-light.jpg
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 don't have something else installed which also tries to use the camera, like motion, do you?

How about this?

The GitHub project page for the camera software mentions

Error : ENOSPC displayed. Camera is probably running out of GPU memory. Check config.txt in the /boot/ folder. The gpu_mem option should be at least 128.
This issue states that this error can occur due to a conflict with the drivers for 1-Wire (W1) modules if the modules are not loaded in the right order.

This post on the RPi forums says the problem can be fixed by switching the pin used for 1-Wire to pin 18:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait bcm2708.w1_gpio_pin=18
As of may 2016, the GPU_MEM=128 is no longer enough. Increasing it from 128 to 144 made the error go away.

Nothing that I would have installed knowingly. If I did, do I just do a clean install?

Okay, if you didn't add anything, maybe it's that second suggestion regarding the GPU_MEM as seen in the troubleshooting section.

Well, I’m still interested in troubleshooting the camera before returning it, if people will stick with me, but in the interim, I bought a Logitech webcam, and it literally plug and played...

Is it possible when I was doing my initial configuration, that I set up the system to recognize a webcam, and not the pi cam?

Possibly, I dunno.

If you're up for it, I personally use two Raspi Pi webcams on mine. One now is sort of mobile. I just place it anywhere that I need to second a "second opinion", if you will. If I'm spooling from the back of the printer, I'll usually point it there to make sure that nothing's trying to cross-link and die.

So there's a side-facing camera which shows itself on the Webcam tab and I've got the second camera's output as the temperature graph's background, as seen below.


This isn't a command, it's a log file. You'll need to cat or less it.

cat /var/log/webcamd.log

raspistill failing is normal if the webcam daemon has already detected the camera and is serving data from it. Which makes it actually sounds like everything should be working. What happens if you go to http://<your pi>:8080 in your browser (replacing <your pi> with however you'd go about accessing OctoPrint itself,octopi.local`, an IP address, ...)