Raspberry Pi official camera detected=0 problem

The official camera of the Raspberry Pi often encounters various situations when it is connected to the Raspberry Pi. Today, the following problems occurred when connecting to OpenCV:

 As shown in the picture, I first checked the status of the Raspberry Pi, and found that the output is 1, but the input is 0. Under normal circumstances, it should be:

supported=1 detected=1.

Then I tried the ls /dev/video* command and found that there is no video0 device, which is not normal, the first one will be when connected normally

video0

So I started the journey of checking information and learning new technologies:

Solution 1: Enter raspi-config to open all settings

sudo raspi-config

At this time, you will enter the system configuration interface of the Raspberry Pi, select interface, and set all the contents to enable one by one.

(Note that after setting an enable, the interface will return to the previous level, and you need to enter the interface again)

After setting everything to enable, restart the machine

sudo shutdown -h now

At this time, use the following two commands to check whether the output is normal.

vcgencmd get_camera  #查看摄像头状态,正常时两个输出均为1
ls /dev/video*  #查看摄像头挂载情况,正常时第一个是video0

After it is normal at this time, you can use the luvcview command to view the camera screen

Solution 2: Check the camera insertion status

This is the problem with my camera. I tried the above method many times but it didn’t work. I solved it through this solution.

 When I disassembled the case, I found that I inserted the camera that should have been inserted in the 2 position into the 1 position. (Now that I think about it, I was so stupid)

As shown in the picture, next to the two sockets, CAMERA (camera) DISPLAY (display screen) is actually written. Of course, the camera must be plugged into the camera socket. Fortunately, I plugged it into the display port and did not damage the Raspberry Pi.

At the same time, pay attention to whether the cable is inserted backwards, the blue side of the camera should face the direction of the network port.

After troubleshooting, do the following:

Operation 1: Check the status of the camera

vcgencmd get_camera  #查看摄像头状态,正常时两个输出均为1
ls /dev/video*  #查看摄像头挂载情况,正常时第一个是video0

Output image:

 You can see that everything is fine in the output.

Operation 2: Use luvcview to view the camera screen

luvcview -s 720x480  #分辨率之间是字母x
#会自动创建新窗口,展示摄像头输出画面

Effect:

 If the content is wrong, please point it out in the comment area, and we will learn together.

Guess you like

Origin blog.csdn.net/qq_43323677/article/details/129233896