Difference between revisions of "Template:RPI Camera Quick Start"

From Waveshare Wiki
Jump to: navigation, search
 
(70 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Hardware Connection==
 
==Hardware Connection==
<font color=red>'''To test the Camera, you need to connect a HDMI display or a DIS display for previewing.'''</font> <br />
+
<font color=red>''' To test the Camera, you need to connect a HDMI display or a DIS display for previewing.'''</font> <br />
 
+
The connectors of the DSI interface (display) and the CSI interface (camera) look the same, please take care of it when you connect the camera. The CSI interface is placed between the Audio jack and the HDMI port. The CSI connector of Pi zero is beside the Power interface. If you use the Compute Module, please check the actual place of the carrier board. <br/>
The connectors of the DSI interface (display) and the CSI interface (camera) look the same, please take care of it when you connect the camera. The CSI interface is placed between the Audio jack and the HDMI port. the CSI connector of Pi zero is beside the Power interface. If you use Compute Module, please check the actual place of the carrier board.  
+
*Connect to Raspberry Pi 5
*Connect ot Pi Zero Series
+
: Place the metal surface of the FPC cable towards the wired network port, then connect to the CSI port. The Pi5 has two CSI ports; either port can be used for connection.
 +
{{#switch:{{FULLPAGENAME}}
 +
|Pi5-IMX219 =
 +
:[[File:Pi5-IMX219-77-details-5.jpg|500px]]
 +
|
 +
:[[File:Pi5-IMX219-77-details-5.jpg|500px]]
 +
}}
 +
*Connect to Pi Zero Series
 +
: Place the metal surface of the FPC downward, then connect it to the CSI port.
 +
{{#switch:{{FULLPAGENAME}}
 +
|OV5647-70 5MP OIS Camera =
 +
: The camera cannot be directly connected to the Pi Zero.
 +
|RPi Camera (B)=
 +
:[[File:RPI_Camera_Zero-2.jpg|500px]]
 +
|RPi Camera (E)=
 +
:[[File:RPi-Camera-E-7.jpg|500px]]
 +
|RPi Camera (F)=
 +
:[[File:RPi-Camera-F-5.jpg|500px]]
 +
|RPi Camera (G)=
 +
:[[File:RPi-Camera-G-5.jpg|500px]]
 +
|RPi Camera (H)=
 +
:[[File:RPi-Camera-H-5.jpg|500px]]
 +
|RPi Camera (I)=
 +
:[[File:RPi-Camera-I-5.jpg|500px]]
 +
|RPi Camera (M)=
 +
:[[File:RPi-Camera-M-5.jpg|500px]]
 +
|RPi Zero V1.3 Camera=
 +
:[[File: RPI Zero Camera Quick Start01.jpg|500px]]
 +
|Raspberry Pi Camera Module 3=
 +
:[[File:Raspberry-Pi-Camera-Module3.jpg|500px]]
 +
|RPi FPC Camera=
 +
: This product does not support access to Pi Zero.
 +
|RPi FPC Camera (B)=
 +
: This product does not support access to Pi Zero.
 +
|RPi IR-CUT Camera=
 +
:[[File:RPi-IR-CUT-Camera-6.jpg|500px]]
 +
|RPi IR-CUT Camera (B)=
 +
:[[File:RPi-IR-CUT-Camera-B-8.jpg|500px]]
 +
|OV9281-110 Camera=
 +
:[[File:OV9281-110-Camera-4.jpg|500px]]
 +
|OV9281-120 Camera=
 +
:[[File:OV9281-120-Camera-4.jpg|500px]]
 +
|OV9281-160 Camera=
 +
:[[File:OV9281-160-Camera-4.jpg|500px]]
 +
|IMX290-83 IR-CUT Camera=
 +
:[[File: IMX290-83 IR-CUT01.jpg|500px]]
 +
|IMX378-190 12.3MP Camera=
 +
:[[File:RPI Camera Zero2.jpg|500px]]
 +
|Raspberry Pi HQ Camera=
 +
:[[File:IMX290-83 IR-CUT77.jpg|500px]]
 +
|Raspberry Pi Global Shutter Camera=
 +
:[[File:Raspberry-Pi-Global-Shutter-Camera-details-11-3.jpg|500px]]
 +
|
 +
:[[File:RPi_Camera_Connect_Zero.png|500px]]
 +
}}
 +
*Connect to other Raspberry Pi boards
 +
: Place the metal side of the cable towards the HDMI port and connect to the CSI port.
 +
{{#switch:{{FULLPAGENAME}}
 +
|OV5647-70 5MP OIS Camera =
 +
:[[File:OV5647-70-5MP-OIS-Camera-5.jpg|500px]]
 +
|RPi Camera (B)=
 +
:[[File:RPi_Camera_Pi4-2.jpg|500px]]
 +
|RPi Camera (E)=
 +
:[[File:RPi-Camera-E-6.jpg|500px]]
 +
|RPi Camera (F)=
 +
:[[File:RPi-Camera-F-4.jpg|500px]]
 +
|RPi Camera (G)=
 +
:[[File:RPi-Camera-G-4.jpg|500px]]
 +
|RPi Camera (H)=
 +
:[[File:RPi-Camera-H-4.jpg|500px]]
 +
|RPi Camera (I)=
 +
:[[File:RPi-Camera-I-4.jpg|500px]]
 +
|RPi Camera (M)=
 +
:[[File:RPi-Camera-M-4.jpg|500px]]
 +
|RPi FPC Camera=
 +
:[[File:RPi-FPC-Camera-5.jpg|500px]]
 +
|RPi FPC Camera (B)=
 +
:[[File: RPI Camera FPC Quick Start.jpg|500px]]
 +
|RPi IR-CUT Camera=
 +
:[[File:RPi-IR-CUT-Camera-7.jpg|500px]]
 +
|RPi IR-CUT Camera (B)=
 +
:[[File:RPi-IR-CUT-Camera-B-7.jpg|500px]]
 +
|Raspberry Pi Camera Module 3=
 +
:[[File:Raspberry-Pi-Camera-Module36.jpg|500px]]
 +
|RPi Zero V1.3 Camera=
 +
: This product does not support other Raspberry Pi motherboards.
 +
|OV9281-110 Camera=
 +
:[[File:OV9281-110-Camera-55..jpg|500px]]
 +
|OV9281-120 Camera=
 +
:[[File:OV9281-120-Camera-5.jpg|500px]]
 +
|OV9281-160 Camera=
 +
:[[File:OV9281-160-Camera-550.jpg|500px]]
 +
|IMX290-83 IR-CUT Camera=
 +
:[[File: IMX290-83 IR-CUT02.jpg|500px]]
 +
|IMX378-190 12.3MP Camera=
 +
:[[File:RPi Camera Pi42.jpg|500px]]
 +
|Raspberry Pi HQ Camera=
 +
:[[File:IMX290-83 IR-CUT277.jpg|500px]]
 +
|Raspberry Pi Global Shutter Camera=
 +
:[[File:Raspberry-Pi-Global-Shutter-Camera-details-11-1.jpg|500px]]
 +
|
 +
:[[File:RPi_Camera_Connect_Pi4.png|500px]]
 +
}}
 +
<!-- 
 +
*Connect to Pi Zero Series
 
: The metal surface of the flexible cable is downward, then connect to the CSI interface.
 
: The metal surface of the flexible cable is downward, then connect to the CSI interface.
 
:[[File:RPI_Camera_Zero2.jpg|500px]]
 
:[[File:RPI_Camera_Zero2.jpg|500px]]
Line 9: Line 113:
 
: The metal surface of the flexible cable is toward the HDMI interface, then connect to the CSI interface.
 
: The metal surface of the flexible cable is toward the HDMI interface, then connect to the CSI interface.
 
:[[File:RPi_Camera_Pi42.jpg|500px]]
 
:[[File:RPi_Camera_Pi42.jpg|500px]]
 
 
<!--   
 
<!--   
 
==Camera configuration==
 
==Camera configuration==
Line 49: Line 152:
 
==About the model==
 
==About the model==
 
{|class="wikitable"
 
{|class="wikitable"
! Photosensitive chip model !! Supported Raspberry Pi board model !! Supported driver type
+
! Photosensitive Chip Model !! Supported Raspberry Pi Board Model !! Supported Driver Type
 
|-
 
|-
 
| OV5647 || All Raspberry Pi boards || libcamera / Raspicam
 
| OV5647 || All Raspberry Pi boards || libcamera / Raspicam
Line 55: Line 158:
 
| OV9281 || All Raspberry Pi boards || libcamera
 
| OV9281 || All Raspberry Pi boards || libcamera
 
|-
 
|-
| IMX219 (Raspberry Pi official) || All Raspberry Pi boards || libcamera / Raspicam
+
| IMX219 (Official Raspberry Pi) || All Raspberry Pi boards || libcamera / Raspicam
 
|-
 
|-
| IMX219 (third party) || Raspberry Pi Compute Module || libcamera
+
| IMX219 (Third party) || Raspberry Pi Compute Module || libcamera
 
|-
 
|-
| IMX290/ IMX327 || All Raspberry Pi boards || libcamera
+
| IMX290/IMX327 || All Raspberry Pi boards || libcamera
 
|-
 
|-
 
| IMX378 || All Raspberry Pi boards || libcamera
 
| IMX378 || All Raspberry Pi boards || libcamera
 
|-
 
|-
| IMX477 (Raspberry Pi official) || All Raspberry Pi boards || libcamera / Raspicam
+
| IMX477 (Official Raspberry Pi) || All Raspberry Pi boards || libcamera / Raspicam
 +
|-
 +
| IMX477 (Third party) || Raspberry Pi Compute Module || libcamera
 +
|-
 +
|IMX519||All Raspberry Pi boards||libcamera (driver required)
 
|-
 
|-
| IMX477 (third party) || Raspberry Pi Compute Module || libcamera
+
|IMX708 (Raspberry Pi Camera Module 3)||All Raspberry Pi boards ||libcamera
 
|-
 
|-
|IMX519||All Raspberry Pi boards||libcamera (needs to install driver)
+
|IMX296 (Raspberry Pi Global Camera)||All Raspberry Pi boards||libcamera
 
|}
 
|}
  
==Enable Camera Interface==
+
 
If you are using the latest bullseye image, the camera interface has been enabled by default, so you can skip the modification steps.<br/>
+
==Test Camera ==
*Open the Raspberry Pi terminal and use the command to enter the setting interface
+
=== Software Configuration ===
sudo raspi-config
+
If you are using the latest Raspberry Pi Camera Module 3 or Raspberry Pi Global Shutter Camera, you need to run the following command to update the system (network connection is required). <br/>
*Set up the camera
+
<pre>
Select Interface Options -> Camera -> Yes -> Finish -> Yes<br/>
+
sudo apt-get update -y
*Reboot the Raspberry Pi
+
sudo apt-get upgrade-
==Test Camera(Bullseyes OS)==
+
</pre>
'''Configure'''<br/>
+
<!--
 
If you use OV9281, IMX290, IMX378, or non-Raspberry Pi official IMX219 and IMX477 cameras, you need to configure the config.txt file separately.
 
If you use OV9281, IMX290, IMX378, or non-Raspberry Pi official IMX219 and IMX477 cameras, you need to configure the config.txt file separately.
 
<pre>
 
<pre>
 
sudo nano /boot/config.txt
 
sudo nano /boot/config.txt
 
</pre>
 
</pre>
Find "camera-auto-detect=1" and modify it to "camera_auto_detect=0"
+
-->
 +
If you do not use an official Raspberry Pi camera, you need to configure the "config.txt " file. If you use the latest Bookworm system, you need to configure /boot/firmware/config.txt.
 +
<pre>
 +
sudo nano /boot/config.txt
 +
#If using the bookworm system
 +
sudo nano /boot/firmware/config.txt
 +
</pre>
 +
Find "camera-auto-detect=1" and modify it to "camera_auto_detect=0".
 
</pre>
 
</pre>
 
At the end of the file, add the following setting statements according to the camera model.
 
At the end of the file, add the following setting statements according to the camera model.
 
{|class="list" border=1
 
{|class="list" border=1
! model !! set statement
+
! Model !! Set Statement
 
|-
 
|-
 
|OV9281 || dtoverlay=ov9281
 
|OV9281 || dtoverlay=ov9281
 
|-
 
|-
|IMX290/IMX327 || dtoverlay=imx290,clock-frequency=37125000
+
|IMX290/IMX327 || dtoverlay=imx290, clock-frequency=37125000
 
|-
 
|-
 
|IMX378 || dtoverlay=imx378
 
|IMX378 || dtoverlay=imx378
Line 98: Line 212:
 
|-
 
|-
 
|IMX477 || dtoverlay=imx477
 
|IMX477 || dtoverlay=imx477
 +
|-
 +
|IMX708||dtoverlay=imx708
 
|}
 
|}
 
+
'''Binocular Camera Configuration'''<br/>
; Open the Raspberry Pi terminal and enable the camera preview:
+
*Currently, both the CM4 and Raspberry Pi 5 support the connection of two cameras.
 +
*If you want to simultaneously connect to two cameras, you can designate the cameras by adding 'cam0' and 'cam1' after the corresponding camera configuration statements.
 +
**For example, the imx219 is connected to the cam0 interface and the ov5647 camera is connected to the cam1 interface.
 
<pre>
 
<pre>
sudo libcamera-hello -t 0
+
dtoverlay=imx219,cam0
 +
dtoverlay=ov5647,cam1
 
</pre>
 
</pre>
If you want to close the preview window, you can directly combine the keys Alt-F4, or click x to close. You can also go back to the terminal interface and terminate the program with Ctrl+c. <br />
 
  
==Test Camera(Buster OS)==
+
===Test Camera Commands===
Open a terminal and test the camera with the following command:
+
'''Enter the Raspberry Pi and enable the camera to preview:'''
 +
sudo libcamera-hello -t 0
 +
If you want to close the preview window, you can directly press the keys "Alt-F4", or click "x" to close. Also, you can return to the terminal interface and press Ctrl-c to end the demo.<br/>
 +
Note: if using "Camera Module 3", the auto-focus function is enabled.<br/>
 +
'''Test Binocular Camera'''<br/>
 +
*When testing the binocular camera, you need to add "--camera" to specify the camera. If you do not add this parameter, "cam0" is specified by default.
 
<pre>
 
<pre>
sudo raspistill -t 0
+
sudo libcamera-hello -t 0 --camera 0
 +
sudo libcamera-hello -t 0 --camera 1
 
</pre>
 
</pre>
If you want to close the preview windows, you can use Ctrl-C to stop the appliation.
 

Latest revision as of 10:23, 15 March 2024

Hardware Connection

To test the Camera, you need to connect a HDMI display or a DIS display for previewing.
The connectors of the DSI interface (display) and the CSI interface (camera) look the same, please take care of it when you connect the camera. The CSI interface is placed between the Audio jack and the HDMI port. The CSI connector of Pi zero is beside the Power interface. If you use the Compute Module, please check the actual place of the carrier board.

  • Connect to Raspberry Pi 5
Place the metal surface of the FPC cable towards the wired network port, then connect to the CSI port. The Pi5 has two CSI ports; either port can be used for connection.
Pi5-IMX219-77-details-5.jpg
  • Connect to Pi Zero Series
Place the metal surface of the FPC downward, then connect it to the CSI port.
RPi Camera Connect Zero.png
  • Connect to other Raspberry Pi boards
Place the metal side of the cable towards the HDMI port and connect to the CSI port.
RPi Camera Connect Pi4.png


About the model

Photosensitive Chip Model Supported Raspberry Pi Board Model Supported Driver Type
OV5647 All Raspberry Pi boards libcamera / Raspicam
OV9281 All Raspberry Pi boards libcamera
IMX219 (Official Raspberry Pi) All Raspberry Pi boards libcamera / Raspicam
IMX219 (Third party) Raspberry Pi Compute Module libcamera
IMX290/IMX327 All Raspberry Pi boards libcamera
IMX378 All Raspberry Pi boards libcamera
IMX477 (Official Raspberry Pi) All Raspberry Pi boards libcamera / Raspicam
IMX477 (Third party) Raspberry Pi Compute Module libcamera
IMX519 All Raspberry Pi boards libcamera (driver required)
IMX708 (Raspberry Pi Camera Module 3) All Raspberry Pi boards libcamera
IMX296 (Raspberry Pi Global Camera) All Raspberry Pi boards libcamera


Test Camera

Software Configuration

If you are using the latest Raspberry Pi Camera Module 3 or Raspberry Pi Global Shutter Camera, you need to run the following command to update the system (network connection is required).

sudo apt-get update -y
sudo apt-get upgrade-

If you do not use an official Raspberry Pi camera, you need to configure the "config.txt " file. If you use the latest Bookworm system, you need to configure /boot/firmware/config.txt.

sudo nano /boot/config.txt
#If using the bookworm system
sudo nano /boot/firmware/config.txt

Find "camera-auto-detect=1" and modify it to "camera_auto_detect=0".

At the end of the file, add the following setting statements according to the camera model.

Model Set Statement
OV9281 dtoverlay=ov9281
IMX290/IMX327 dtoverlay=imx290, clock-frequency=37125000
IMX378 dtoverlay=imx378
IMX219 dtoverlay=imx219
IMX477 dtoverlay=imx477
IMX708 dtoverlay=imx708

Binocular Camera Configuration

  • Currently, both the CM4 and Raspberry Pi 5 support the connection of two cameras.
  • If you want to simultaneously connect to two cameras, you can designate the cameras by adding 'cam0' and 'cam1' after the corresponding camera configuration statements.
    • For example, the imx219 is connected to the cam0 interface and the ov5647 camera is connected to the cam1 interface.
dtoverlay=imx219,cam0
dtoverlay=ov5647,cam1

Test Camera Commands

Enter the Raspberry Pi and enable the camera to preview:

sudo libcamera-hello -t 0

If you want to close the preview window, you can directly press the keys "Alt-F4", or click "x" to close. Also, you can return to the terminal interface and press Ctrl-c to end the demo.
Note: if using "Camera Module 3", the auto-focus function is enabled.
Test Binocular Camera

  • When testing the binocular camera, you need to add "--camera" to specify the camera. If you do not add this parameter, "cam0" is specified by default.
sudo libcamera-hello -t 0 --camera 0
sudo libcamera-hello -t 0 --camera 1