Skip to main content

Working with Raspberry Pi

Hardware Connection

Raspberry Pi 4

Connected to Raspberry Pi 4

Raspberry Pi 5

Connected to Raspberry Pi 5

CM 4 / 5 Expansion Board

Connected to CM 4 / 5 Expansion Board

Raspberry Pi Zero 2W

Connected to Raspberry Pi Zero 2W

tip

The images above are for demonstration purposes only. This product does not include the above mainboards or kits.

Software Environment Configuration and Testing

Update System

To ensure the camera works properly, please use the latest version of the Raspberry Pi OS and run the following commands to update.

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

If using only one camera, connect it to the CAM1 port.

Configure the config.txt File

  • Use the nano tool to open and edit the /boot/firmware/config.txt file.

    sudo nano /boot/firmware/config.txt
  • Locate the line camera-auto-detect=1 and change it to camera_auto_detect=0.

  • At the end of the file, add the line dtoverlay=imx477. If multiple cameras are connected, you can specify the cam0 or cam1 parameters, for example:

    dtoverlay=imx477,cam0
    dtoverlay=imx477,cam1
  • After configuration, save the file and reboot the system with sudo reboot.

Test the Camera

  • After rebooting, run sudo rpicam-hello --list-cameras to check if the camera is detected.
  • With a display connected, you can preview the camera feed with sudo rpicam-hello -t 0.

For more information about rpicam commands, please refer to Raspberry Pi Camera Tool Guide.