Raspberry Camera V1.3 no works with the new Stack

Camera model

Raspberry Pi Camera V1.3

What is the problem?

No video Black screen

first "webstream loading...."

then

Webcam stream not loaded

It might not be configured correctly or require authentication. You can change the URL of the stream under "Settings" > "Classic Webcam" > "Stream URL". If you don't have a webcam you can also just disable webcam support there.

Currently configured stream URL: /webcam/?action=stream

Red led from camera no glowing... short blink after reboot

In the old stack i set camera_auto_detect=0 and it works. Not in the new stack.

What did you already try to solve it?

fresh install now
udate & upgrade

pi@octoprint:~ $ libcamera-hello
Preview window unavailable
[0:00:49.841020136] [1026] INFO Camera camera_manager.cpp:297 libcamera v0.0.5+83-bde9b04f
[0:00:49.884196959] [1027] INFO RPI vc4.cpp:437 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unicam device /dev/media2 and ISP device /dev/media0
[0:00:49.884367427] [1027] INFO RPI pipeline_base.cpp:1101 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
[0:00:49.884971959] [1026] INFO Camera camera.cpp:840 Pipeline handler in use by another process
ERROR: *** failed to acquire camera /base/soc/i2c0mux/i2c@1/ov5647@36 ***

pi@octoprint:~ $ libcamera-hello --list-cameras
Available cameras

0 : ov5647 [2592x1944] (/base/soc/i2c0mux/i2c@1/ov5647@36)
Modes: 'SGBRG10_CSI2P' : 640x480 [30.00 fps - (0, 0)/0x0 crop]
1296x972 [30.00 fps - (0, 0)/0x0 crop]
1920x1080 [30.00 fps - (0, 0)/0x0 crop]
2592x1944 [30.00 fps - (0, 0)/0x0 crop]

pi@octoprint:~ $ vcgencmd get_camera
supported=1 detected=0, libcamera interfaces=1

192.168.178.57/webcam/?action=stream
"Server Error" on black screen

pi@octoprint:~ $ sudo systemctl status camera-streamer-libcamera.service
โ— camera-streamer-libcamera.service - camera-streamer libcamera
Loaded: loaded (/etc/systemd/system/camera-streamer-libcamera.service; disabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/camera-streamer-libcamera.service.d
โ””โ”€override.conf
Active: active (running) since Mon 2024-02-12 16:16:46 CET; 30min ago
Process: 521 ExecCondition=/bin/sh -c /usr/bin/libcamera-hello --list-cameras | grep -o '/base/soc/[^)]*' (code=exited, status=0/SUCCESS)
Process: 549 ExecCondition=/bin/sh -c ! ss -ltn src :$PORT | grep -q LISTEN (code=exited, status=0/SUCCESS)
Main PID: 554 (camera-streamer)
Tasks: 15 (limit: 1595)
CPU: 1.877s
CGroup: /system.slice/camera-streamer-libcamera.service
โ””โ”€554 /usr/bin/camera-streamer --http-port=8080 --camera-type=libcamera --camera-path=/base/soc/i2c0mux/i2c@1/ov5647@36 --camera-format=YUYV --camera-width=1920 --camera-height=1080 --camera-video.height=720 --camera-snapsh>

Feb 12 16:17:04 octoprint sh[554]: util/http/http.c: HTTP8080/3: Client disconnected 127.0.0.1.
Feb 12 16:17:54 octoprint sh[554]: util/http/http.c: HTTP8080/4: Client connected 127.0.0.1 (fd=7).
Feb 12 16:17:54 octoprint sh[554]: util/http/http.c: HTTP8080/4: Request 'GET' '/' 'action=stream'
Feb 12 16:17:56 octoprint sh[554]: util/http/http.c: HTTP8080/4: Client disconnected 127.0.0.1.
Feb 12 16:43:39 octoprint sh[554]: util/http/http.c: HTTP8080/5: Client connected 127.0.0.1 (fd=8).
Feb 12 16:43:39 octoprint sh[554]: util/http/http.c: HTTP8080/5: Request 'GET' '/' 'action=stream'
Feb 12 16:43:39 octoprint sh[554]: device/links.c: CAMERA:capture: Stale detected. Restarting streaming...
Feb 12 16:43:39 octoprint sh[554]: device/buffer_list.c: CAMERA:capture: Streaming stopped... Was 2 of 2 enqueud
Feb 12 16:43:39 octoprint sh[554]: device/buffer_list.c: CAMERA:capture: Streaming started... Was 2 of 2 enqueud
Feb 12 16:43:41 octoprint sh[554]: util/http/http.c: HTTP8080/5: Client disconnected 127.0.0.1.

I have testet 3 cameras and 4 Cables

Have you tried running in safe mode?

yes

Did running in safe mode solve the problem?

yes

Systeminfo Bundle

octoprint-systeminfo-20240212151454.zip (19.3 KB)

Additional information about your setup

OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible

Raspberry Pi 3 B+

I have exactly the same problem on my running from many years system.. with the webcam that was always working until yesterday..

I opened another topic here Raspberry PI3A Camera stopped working

apparently the problem is that mjpegstreamer is running.. so the camera is "busy"

[0:00:49.884971959] [1026] INFO Camera camera.cpp:840 Pipeline handler in use by another process
ERROR: *** failed to acquire camera /base/soc/i2c0mux/i2c@1/ov5647@36 ***

Question now is: how to disable mjpegstreamer?

Where can I deactivate this?

This service is not running.

take a look at the log /var/log/webcamd.log

This log file does not exist

Did you upgrade an older version or use the image with the new stack and restore the settings from a backup file?

If so you may be better off just creating a new installation from the Raspberry Pi Imager using the new stack and not restoring your backup file.

In my case it's an old installation (more then 2 years) upgraded all the times to latest version ..
It did work until 2 days ago..
see here Raspberry PI3A Camera stopped working - Get Help / Webcams - OctoPrint Community Forum

Any help on how to have it working again without reinstalling everything?
Which are the steps to setup just the webcam (raspicam)?
Thanks in advance

If you are not using the "new camera stack" OctoPi image, then you have a different problem/situation from the OP. mjpg streamer & webcamd are not in use in the new streaming stack. Please don't hijack their post to ask for help on yours.

Sorry Charlie.. I was asking help because, even if the situation may seems different (it's not a fresh installation) the error reported in this post is EXACTLY the same of my error.. so I assume it is the same issue (maybe I am wrong)..
What is the "new stack"?

I used the new clean image. No backup. Is freh installed.

How exactly is the new stack configured? Do I need both files in /boot/camera-streamer ? How are these configured? I see option='--xxxxx "aaa 123"' or option=--xxxxx "...... without ' it is poorly described. A working example config would be better. What you have to pay attention to is whether the /boot/ config. txt needs to be changed... etc. I have now reinstalled and don't want to go through the work of redoing everything again. Or is it Bullseye's fault that it doesn't work. There must be a reason why this pi camera v1.3 just doesn't work.

Hello i have the same problem with the new stack it works perfect with the old one

Hello @Dennis_Voss !

Then please also attach your systeminfo bundle to your next post.

Addressing @Tkaus's original post first:

  • Based on your systeminfo bundle, it appears that your camera is being correctly recognised and camera-streamer is running. However, there is the below message:

    Sep 22 02:24:37 octoprint sh[727]: [0:00:25.656052542] [835] ERROR RPI pipeline_base.cpp:1333 Camera frontend has timed out!
    Sep 22 02:24:37 octoprint sh[727]: [0:00:25.656086135] [835] ERROR RPI pipeline_base.cpp:1334 Please check that your camera sensor connector is attached securely.
    Sep 22 02:24:37 octoprint sh[727]: [0:00:25.656118271] [835] ERROR RPI pipeline_base.cpp:1335 Alternatively, try another cable and/or sensor.
    

    There is then attempts to stream, but the stream goes stale. Camera-streamer has a known bug that it can't properly recover from a stream going stale (which happens if it is not accessed within a certain time somehow), this is why the new stack is not the default yet. It produces the mentioned "server error" if you try and open the stream in your browser (outside OctoPrint). Known issue.

  • The only solution seen so far has been to restart the streamer. You can do this with the command sudo camera-streamer-control restart. It is not a guaranteed fix however. I will also note that it seems more common to find this issue with the Pi Cam V1, anecdotally.

  • For a camera connected to the CSI port on the Pi, you use the libcamera.conf file in /boot/camera-streamer. This is setup out of the box so it should "just work", without configuration. Configuration should be if you wish to change the resolution/fps etc. Obviously this is not always the case.

  • For a camera connected to the USB ports, any other *.conf files are used. The default one is designed to work with any camera that's connected to the USB ports, and you can customise. They are both intended "working example configs".

Thanks for the great details within this thread. I think I am seeing the same issue as the OP, unfortunately restarting the camera-streamer-control service did not seem to help for me.

I have a Pi 3B w/ a Camera v1.3. It has been running with the old stack for a couple of years, but I wanted to update to the new stack and possibly switch to a Pi Camera v3 or ArduCam I have lying around.

For my new camera stack install I created a fresh image and restored settings from a backup.

Upon boot I see the camera LED flash a few times, but then remains off and my stream seems down. Attempts to connect to the URLs seem to be rejected or return a Server Error.

Running libcamera-hello (after stopping camera-streamer service) indicates a similar frontend timeout error - bummer.

> pi@octopi:~ $ libcamera-hello
> Preview window unavailable
> [0:11:33.116823005] [1406] INFO Camera camera_manager.cpp:297 libcamera v0.0.5+83-bde9b04f
> [0:11:33.188698209] [1407] INFO RPI vc4.cpp:437 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unicam device /dev/media0 and ISP device /dev/media1
> [0:11:33.188812220] [1407] INFO RPI pipeline_base.cpp:1101 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
> [0:11:33.190147167] [1406] INFO Camera camera.cpp:1033 configuring streams: (0) 1296x972-YUV420
> [0:11:33.191039355] [1407] INFO RPI vc4.cpp:565 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 1296x972-SGBRG10_1X10 - Selected unicam format: 1296x972-pGAA
> [0:11:34.309576866] [1407] WARN V4L2 v4l2_videodevice.cpp:2007 /dev/video0[12:cap]: Dequeue timer of 1000000.00us has expired!
> [0:11:34.309786137] [1407] ERROR RPI pipeline_base.cpp:1333 Camera frontend has timed out!
> [0:11:34.309862908] [1407] ERROR RPI pipeline_base.cpp:1334 Please check that your camera sensor connector is attached securely.
> [0:11:34.309939106] [1407] ERROR RPI pipeline_base.cpp:1335 Alternatively, try another cable and/or sensor.
> ERROR: Device timeout detected, attempting a restart!!!

I stumbled onto this thread which seemed loosely related - but it seems to indicate a specific issue with the Pi 5. (When using the OV5647 model camera on Raspberry Pi 5B, an error is reported. - Raspberry Pi Forums)

Maybe I'll get really curious and plug in my ArduCam 16MP autofocus to see if it works.

Here's an attempt at my logs if interested...
octoprint-systeminfo-20240213210551.zip (59.0 KB)

I tested to restart the camera-streamer-control and it didn't resolve my problem. I have tested to disable camera auto detect dtoverlay in config.txt and add it manually but it didn't help.
octoprint-systeminfo-20240214105537.zip (25.3 KB)

I think that the raspberry camera v1.3 with 5M is not supported by libcamera.

I think that repo is more specifically camera-streamer than libcamera itself... so I'm not sure it's indicative to why libcamera tools from the terminal provide the same errors (frontend timeout) while not running the camera-streamer service.

A brief further glance makes it look like those (your link to githib) service files are example configs (not necessarily the fully supported list) and that the service config on my Pi is /etc/systemd/system/camera-streamer-libcamera.service.

I'm new to this effort, however, so could be wholly wrong :slight_smile:

I've tried everything I've read in the last 3 days without success.