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.
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”.
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)
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:~ $ 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
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:
/boot/cmdline.txt: 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.
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?
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 normalif 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, ...)