Pi Zero IR Camera Not Working in Any App

Hi Folks,

I have installed and updated to the newest version of DietPi on a Pi Zero W, and I’m unable to get the camera working.

So far, I have done the following:

  1. Connected the IR camera plus 2 IR blasters to the ribbon cable and connected the cable to the Pi Zero W
  2. The IR blasters and the camera activity LED are lit showing the camera is getting power and is on
  3. Checked that the camera is enabled in the Diet Pi config app
  4. Installed RPiCam
  5. It seems that I’m running Bullseye, so I have run “libcamera-hello” but I get an error : -bash: libcamera-hello: command not found
  6. Tried running “raspistill -o testshot.jpg” but I get a series of errors :
    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
  7. Launched RPiCam and it gives a broken image icon at the top which flashes - the rest of the website seems to be OK
  8. Running vcgencmd get_camera gives : supported=1 detected=1, libcamera interfaces=0
  9. If I add camera_auto_detect=1 to config.txt and run vcgencmd get_camera it gives : supported=1 detected=0, libcamera interfaces=1
  10. Running now “raspistill -o testshot.jpg” gives : ERROR: the system should be configured for the legacy camera stack

I have also tried the Pi camera in Node Red and this also errors and does not create a photo.

So,it looks like the camera is connected correctly and being detected but I can’t get any photos out of it or get it work with any applications.

Any help as to how I get the camera working in RPiCam and Node Red would be most appreciated.

Thanks muchly!

Not sure if it is fitting, but you could have a look to following post https://dietpi.com/forum/t/libcamera-disable-legacy-camera-stack/6477/4

Hi Joulinar,

Thanks for your super quick reply.

I’ve tried following the final solution in the thread you suggest.

I had already completed the first 2 stages:

  1. Enable ‘8: RPi Camera’ at DietPi-Config/Display Options/
  2. added ‘camera_auto_detect=1’ to the /boot/config.txt

So I only had to complete stage 3:
3) Installed libcamera ‘apt install libcamera-apps-lite’

Once installed, I am getting a more favourable response from the libcamera-hello command :

[0:04:28.598068000] [1351]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3424-e68e0f1e
[0:04:28.984182000] [1362] ERROR CameraSensor camera_sensor.cpp:551 'ov5647 10-0036': Camera sensor does not support test pattern modes.
[0:04:29.543201000] [1362]  INFO RPI raspberrypi.cpp:1317 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unicam device /dev/media3 and ISP device /dev/media0
[0:04:29.563800000] [1351]  INFO Camera camera.cpp:1028 configuring streams: (0) 1296x972-YUV420
[0:04:29.573039000] [1362]  INFO RPI raspberrypi.cpp:747 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 1296x972-SGBRG10_1X10 - Selected unicam format: 1296x972-pGAA
[0:04:29.915213000] [1368]  INFO IPARPI raspberrypi.cpp:631 Request ctrl: Saturation = 1.000000
[0:04:29.921260000] [1368]  INFO IPARPI raspberrypi.cpp:631 Request ctrl: Contrast = 1.000000
[0:04:29.923811000] [1368]  INFO IPARPI raspberrypi.cpp:631 Request ctrl: Brightness = 0.000000
[0:04:29.926347000] [1368]  INFO IPARPI raspberrypi.cpp:631 Request ctrl: AwbMode = 0
[0:04:29.936141000] [1368]  INFO IPARPI raspberrypi.cpp:631 Request ctrl: Sharpness = 1.000000
[0:04:29.938533000] [1368]  INFO IPARPI raspberrypi.cpp:631 Request ctrl: ExposureValue = 0.000000
[0:04:29.940197000] [1368]  INFO IPARPI raspberrypi.cpp:631 Request ctrl: AeExposureMode = 0
[0:04:29.940705000] [1368]  INFO IPARPI raspberrypi.cpp:631 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[0:04:29.942227000] [1368]  INFO IPARPI raspberrypi.cpp:631 Request ctrl: AeMeteringMode = 0
[0:04:29.943720000] [1368]  INFO IPARPI raspberrypi.cpp:631 Request ctrl: NoiseReductionMode = 3

That said, neither Node Red nor RPiCam are able to capture an image. Is it because these applications are still programed to use the legacy system and not the new libcamera library?

Any thoughts on how I can get these applications working?

Thanks!

Please try to enable KMS:

/boot/dietpi/func/dietpi-set_hardware rpi-opengl vc4-kms-v3d
reboot