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
    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
    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
    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
    Apr 10, 2022 at 1:03

3 Answers 3

3

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
    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
    Oct 5, 2022 at 23:10
2

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
    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
    Apr 9, 2022 at 23:51
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.

Your Answer

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

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