未检测到 Raspi 相机

问题描述 投票:0回答:1

我的 raspi 未检测到我的相机。跑步时:

vcgencmd get_camera

在终端中输出:

supported=0 detected=0, libcamera interfaces=0

我非常有信心它已正确插入。我不小心将其插入了 raspi 上的“显示”带状电缆连接器,并且相机亮起以表明它正在通电,但是当我将其插入正确的“相机”带状连接器时,相同的指示灯不会出现。

当我运行“sudo raspi-config”并进入接口选项时,没有“相机”选项,只有“旧版相机”。即使启用旧版相机,它仍然无法检测到。

我购买的相机是“Freenove Camera Module for RPi (8MP)”

我想我已经尝试获取我需要的所有更新,例如运行“sudo apt update”和“sudo apt update”以及安装软件包“pip3 install picamera”,但似乎没有任何效果。

这是一些测试代码:

import picamera

class CameraTest:
    def __init__(self):
        self.camera = picamera.PiCamera()

    def capture_image(self, filename):
        self.camera.capture(filename)

    def close(self):
        self.camera.close()

if __name__ == "__main__":
    try:
        camera_test = CameraTest()
        camera_test.capture_image("test_image.jpg")
        print("Image captured successfully.")
    except Exception as e:
        print("An error occurred:", e)
    finally:
        camera_test.close()

这是错误:

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)
An error occurred: Camera is not enabled. Try running 'sudo raspi- 
config' and ensure that the camera has been enabled.
Traceback (most recent call last):
File "/home/ben6brewer/Desktop/Greenhouse/CamTest.py", line 21, in
camera_test.close()
NameError: name 'camera_test' is not defined
raspberry-pi camera detection raspberry-pi4 firmware
1个回答
0
投票

我在 Pi Zero 2 W 上也得到支持 = 0 检测到 = 0,libcamera 接口 = 0,但相机与 libcamera-still -o test.jpg 一起工作正常。它可以捕获图像和视频。因此,请尝试 libcamera-still -o test.jpg 并查看相机是否已经正常工作。

© www.soinside.com 2019 - 2024. All rights reserved.