1

Simple question, but searching did not return an answer.

I have a Pi4 and a Pi Camera. This camera is not USB and does not appear in lsusb output when it is working.

# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

What command to give to show if the camera is connected correctly?

4
  • What OS? What Pi? What have YOU done to set it up?
    – Milliways
    Commented Apr 9, 2022 at 23:56
  • @Milliways My question is trying to be generic. In MY case I found I must have tugged the cable and partially pulled it from the onboard socket. However the question remains, mostly to assist future searchers in solving their problem.
    – Criggie
    Commented Apr 10, 2022 at 0:46
  • In which case the Question is useless - indeed worse than useless, it is misleading due to the changed camera stack in Bullseye which most users will have.
    – Milliways
    Commented Apr 10, 2022 at 0:57
  • @Milliways feel free to answer and/or downvote, or flag as appropriate then. Or if the answer exists in another question, flag as a duplicate.
    – Criggie
    Commented Apr 10, 2022 at 1:03

4 Answers 4

4

Most likely at this point in time you will need to run libcamera-hello to see if the camera is working.

Docs: https://www.raspberrypi.com/documentation/accessories/camera.html

Most examples are going to have you open sudo raspi-config and enable the legacy camera features. That's a good option if you are a beginner. However, there are a lot of ways to record images and videos with your pi/camera.

2
  • This host is running octoprint, and libcamera-hello is not installed. I'm specifically looking for command to show if the pi camera is connected/detected
    – Criggie
    Commented Apr 9, 2022 at 23:40
  • ...had to install libcamera-apps to get this. Looks like its not Picamera specific either, mine finds a USB-connected camera at /dev/video0 which is correct.
    – Criggie
    Commented Apr 9, 2022 at 23:51
4

From command line, you could use vcgencmd utility as shown below:

$ vcgencmd get_camera
supported=1 detected=1, libcamera interfaces=0

When no camera detected the output would be:

$ vcgencmd get_camera
supported=0 detected=0
2
  • Nice - thank you. I get "supported=1 detected=1" but not the interfaces part after the comma.
    – Criggie
    Commented Aug 12, 2022 at 23:22
  • 1
    the output differs due to Raspbian OS release. libcamera one is a new addition in Bullseye. BTW, you could also use Python package (pip install vcgencmd).
    – quantotto
    Commented Oct 5, 2022 at 23:10
1

There is nothing in dmesg to show whether the camera was detected or not.


Not connected/detected:

# raspistill -o output.jpg
mmal: Cannot read camera info, keeping the defaults for OV5647
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Camera is not detected. Please check carefully the camera module is installed correctly

Connected OK:

# raspistill -o output.jpg

# echo $?
0

# ll output.jpg 
-rw-r--r-- 1 root root 1672456 Apr 10 12:40 output.jpg

And there's a jpeg file created which is a valid snap from the picam.

0
1

I received two Camera Module 3 units recently, and one was not working.

dmesg reported them as-

  • working camera: [<timestamp>] imx708 10-001a: camera module ID 0x0301.
  • DOA camera: imx708 10-001a: failed to read chip id 708, with error -5
  • cable reversed: no messages about imx708

Using rpicam-still --list-cameras I got-

  • DOA camera: *** no cameras available ***
  • cable reversed: *** no cameras available ***
  • working camera:
    0 : imx708 [4608x2592 10-bit RGGB] (/base/soc/i2c0mux/i2c@1/imx708@1a)
        Modes: 'SRGGB10_CSI2P' : 1536x864 [120.13 fps - (768, 432)/3072x1728 crop]
                                 2304x1296 [56.03 fps - (0, 0)/4608x2592 crop]
                                 4608x2592 [14.35 fps - (0, 0)/4608x2592 crop]

By "cable reversed" I mean that I had the cable reversed on my Pi and/or camera. That, plus not having dtoverlay=imx708 in /boot/firmware/config.txt, led to confusion. I hadn't worked with ribbon cables much till now -- there needs to be a matching symbol, an "X" or something that helps newbies orient cable to socket. As it is, the orientation of shiny bits to socket/ribbon receiver is opposite when comparing Pi0 to on Cam 3. OK that that's how those work, but "X" please.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.