yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
IMX 415 Camera Module📖
1. Jetson Orin Nano‑NX Usage Course
  • 1. Camera Driver Course
  • 2.1 Advanced AI Vision-Traffic Detection—DeepStream environment
  • 2.2 Advanced AI Vision-Traffic Detection—Four types of detection(traffic)
  • 3. YOLO11 Object Detection
  • 4. YOLO26 Object Detection
  • 5. Mediapipe Environment
  • 6. Mediapipe Hand Detection
  • 7. MediaPipe Face Detection
  • 8. MediaPipe Face Effects
  • 9. MediaPipe 3D Object Recognition
  • 10. MediaPipe Virtual Brush
  • 11. MediaPipe Gesture Recognition
  • 12. MediaPipe Finger Control
  • 13. MediaPipe Posture Estimation
  • 14. MediaPipe Face Mask
  • 15. MediaPipe Overall Detection
  • 16. MediaPipe Green Scene Rremoval(Human)
  • 17. QR code recognition
2. Raspberry Pi 5 Usage Course
  • 1. Camera Driver Course
  • 2. Advanced AI Vision-Human Pose Estimation
  • 3. Target Detection
  • 4. QR Code
  • 5. Face Detection
  • 6. Color Recognition
  • 7. YOLO11 Object Detection
  • 8. YOLO26 Object Detection
  • 9. MediaPipe Face Effects
  • 10. MediaPipe Face Detection
  • 11. MediaPipe 3D Object Recognition
  • 12. MediaPipe Virtual Brush
  • 13. MediaPipe Finger Control
  • 14. MediaPipe Gesture Recognition
3. RDK X5 Usage Course
  • 1. Camera Driver Course
  • 2. Target Detection Algorithm-FCOS
  • 3. Target Detection Algorithm-YOLOv5s
  • 4. YOLO26 Object Detection
4. Camera Bracket Installation (Optional Video)
  • Installation Video
Download
  • Code
  • SystemFile
  • 3D_Model_File
  • Hardware_Info
Download ZIP

Welcome to IMX 415 Camera Module repository

1. Camera Driver Course

Raspberry Pi 5 IMX415 Camera Driver Tutorial

 

1. Applicable Scope2. Hardware Description3. Step 1: Confirm the Kernel Version4. Method 1: Directly Use the Pre-compiled Product in the Repository5. Method 2: Compile on the Pi 55.1 Install Compilation Dependencies5.2 Prepare the Source Code5.3 Compile the Kernel Module5.4 Compile the Device Tree Overlay5.5 Install the Compiled Products6. Modify /boot/firmware/config.txt7. Verify the Camera7.1 Preview the Camera7.2 Take a Photo7.2.1 rpicam-still7.3 Video Recordingrpicam-vidError Solution7.4 Web Page Camera Preview7.4.1 Run the Script7.4.2 Web Page Access8. 6.12 Kernel Backup Usage9. Re-adaptation When Switching Other Raspberry Pi Kernels10. Common Problems10.1 After installation, modinfo imx415 shows the old path or the old version10.2 An error of Invalid module format or disagrees about version of symbol is reported when loading10.3 The overlay does not take effect11. Notes

Friendly reminder: If you want to add a bracket, you need to insert all 4 screws at the same time first, and then tighten the screws.

Notes:

  • Contact surface position: The metal contacts at the end of the ribbon cable must face the spring contacts or contact array inside the FFC connector.

  • Blue stiffener: The blue stiffener plate is usually located on the non-contact surface of the ribbon cable. In a standard installation, the metal contacts and the blue plate are usually located on opposite sides of the ribbon cable.

  • Silkscreen marking: The plane where the silkscreen text on the ribbon cable (such as AWM-20624) is located is usually the back side. During installation, it should face away from the contact surface (the gold or silver metal part).

    The metal must face the side against the PCB, otherwise the ribbon cable may burn out.

    Then connect the other end to the metal contacts of the main board.

    04d6c1b405c14f9ca2a52b1d1a4047d2

    8190ba52dc8242a69aa0410b274b12ab

    Note: On the IMX415 side, there is a DIP switch labeled IR-CUT, which is used to control the infrared function on and off. Set it to the ON position to turn on the infrared. It is normal for the screen to appear reddish. Set it to the OFF position to turn off the infrared function, and the screen will show normal colors.

    image-20260826192050072

1. Applicable Scope

This tutorial uses the kernel version of the latest official image as an example, namely the 6.18.34 kernel. The network drive also provides the imx415.ko and imx415.dtbo files compiled for the 6.6.31 and 6.12.25 kernels corresponding to our factory image. Check your corresponding kernel and download the corresponding kernel files for the operation.

This tutorial is applicable to:

  • Raspberry Pi 5.
  • Current kernel 6.18.34+rpt-rpi-2712, source branch rpi-6.18.y.
  • The IMX415 driver and overlay in the repository pi5/src/.
  • The pre-compiled products for 6.18.34+rpt-rpi-2712 in pi5/6.18.34/imx415/.
  • If your system is still 6.12.25+rpt-rpi-2712, use pi5/backup-rpi-6.12/ instead.

Repository file version relationship:

FileKernel VersionPurpose
pi5/6.18.34/imx415/src6.18 sourceCompile and use on 6.18.34
pi5/6.18.34/imx415/imx415.ko and pi5/6.18.34/imx415/imx415.dtbo6.18.34Pre-compiled product for 6.18.34, can be installed directly
pi5/6.12.25/imx415/6.12 sourceCompile and use on 6.12.25
pi5/6.12.25/imx415/imx415.ko and pi5/6.12.25/imx415/imx415.dtbo6.12.25Pre-compiled product for 6.12.25, can be installed directly
pi5/6.6.31/imx415/6.6.31Compile and use on 6.6.31
pi5/6.6.31/imx415/imx415.ko and pi5/6.6.31/imx415/imx415.dtbo6.6.31Pre-compiled product for 6.6.31, can be installed directly

2. Hardware Description

  • The IMX415 module connects to the MIPI CSI interface of the Pi 5.
  • The default I2C address in the repository pi5/src/imx415.dtsi is 0x1a.

3. Step 1: Confirm the Kernel Version

uname -r

Common version:

xxxxxxxxxx
6.18.34+rpt-rpi-2712

If other versions are output, first confirm whether the current kernel matches the repository source. When the kernel version does not match, the driver may report Invalid module format or fail to load.

4. Method 1: Directly Use the Pre-compiled Product in the Repository

Only when uname -r is exactly 6.18.34+rpt-rpi-2712 can you directly use:

xxxxxxxxxx
pi5/6.18.34/imx415/imx415.ko
pi5/6.18.34/imx415/imx415.dtbo

Copy the files to the Pi 5:

xxxxxxxxxx
scp pi5/6.18.34/imx415/imx415.ko pi@<pi-ip>:~/
scp pi5/6.18.34/imx415/imx415.dtbo pi@<pi-ip>:~/

You can refer to the file transfer tutorial for the transfer. The purpose of this step is mainly to transfer the files to your main board for convenient operation. Transfer them to the corresponding directory, and the subsequent commands also need to be modified according to your actual path.

Install on Pi 5:

​x
sudo mkdir -p /lib/modules/$(uname -r)/updates/dkms
sudo cp ~/imx415.ko /lib/modules/$(uname -r)/updates/dkms/
sudo depmod -a
​
sudo cp ~/imx415.dtbo /boot/firmware/overlays/

If the system uses the old path /boot/overlays/, copy to:

xxxxxxxxxx
sudo cp ~/imx415.dtbo /boot/overlays/

Verify the module version:

xxxxxxxxxx
modinfo imx415 | grep -E 'filename|vermagic'

Expected:

xxxxxxxxxx
filename: /lib/modules/6.18.34+rpt-rpi-2712/updates/dkms/imx415.ko
vermagic: 6.18.34+rpt-rpi-2712 SMP preempt mod_unload modversions aarch64

5. Method 2: Compile on the Pi 5

It is recommended to compile yourself to avoid inconsistency between the pre-compiled product and the current kernel source.

5.1 Install Compilation Dependencies

xxxxxxxxxx
sudo apt update
sudo apt install git make gcc bc bison flex libssl-dev device-tree-compiler \
    raspberrypi-kernel-headers libcamera-dev libcamera-apps

Check whether the kernel header files are available:

xxxxxxxxxx
ls /lib/modules/$(uname -r)/build

If /lib/modules/$(uname -r)/build does not exist, first install raspberrypi-kernel-headers, or download the complete kernel source.

5.2 Prepare the Source Code

On the Pi 5:

xxxxxxxxxx
mkdir -p ~/imx415
cd ~/imx415

Copy the files under the repository pi5/src/ to this directory:

xxxxxxxxxx
imx415.c
imx415.dtsi
imx415-overlay.dts
Makefile
sync-from-kernel.sh

5.3 Compile the Kernel Module

xxxxxxxxxx
make modules

Equivalent command:

xxxxxxxxxx
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules

After success, it generates:

xxxxxxxxxx
imx415.ko

5.4 Compile the Device Tree Overlay

xxxxxxxxxx
make dtbo

If /lib/modules/$(uname -r)/build lacks the complete DTS directory, you need to download the complete kernel source:

xxxxxxxxxx
git clone --depth 1 --branch rpi-6.18.y \
    https://github.com/raspberrypi/linux ~/linux

If your own Raspberry Pi differs from the one we provide, you can also directly download the files from https://github.com/raspberrypi/linux to obtain them.

xxxxxxxxxx
linux/drivers/media/i2c/imx415.c
linux/arch/arm/boot/dts/overlays/imx415.dtsi
linux/arch/arm/boot/dts/overlays/imx415-overlay.dts

The Makefile and sync-from-kernel.sh must be in the same directory as imx415.c, imx415.dtsi, and imx415-overlay.dts.

Or you can go to this webpage to download the files of the corresponding version, and then transfer them to the main board.

Then use the complete kernel source path to compile the dtbo:

xxxxxxxxxx
make dtbo KERNEL_SRC=/home/pi/linux

After success, it generates:

xxxxxxxxxx
imx415.dtbo

5.5 Install the Compiled Products

xxxxxxxxxx
sudo cp imx415.ko /lib/modules/6.18.34+rpt-rpi-2712/
sudo cp imx415.ko /lib/modules/6.18.34+rpt-rpi-2712/kernel/drivers/media/i2c/
sudo cp imx415.dtbo /boot/firmware/overlays/
cd /lib/modules/6.18.34+rpt-rpi-2712/kernel/drivers/media/i2c/
sudo xz -z imx415.ko
sudo depmod -a

Confirm the module again:

xxxxxxxxxx
modinfo imx415 | grep -E 'filename|vermagic'

The vermagic must contain the current uname -r.

6. Modify /boot/firmware/config.txt

xxxxxxxxxx
sudo nano /boot/firmware/config.txt

Single camera:

xxxxxxxxxx
[all]
dtoverlay=imx415,cam0

Dual camera:

xxxxxxxxxx
[all]
dtoverlay=imx415,cam0
dtoverlay=imx415,cam1

image-20260821141658062

After saving, reboot:

xxxxxxxxxx
sudo reboot

7. Verify the Camera

After the operation and reboot, view the media devices:

xxxxxxxxxx
ls -l /dev/video*

Test the image:

xxxxxxxxxx
rpicam-hello -t 0

For multiple cameras, you can specify:

xxxxxxxxxx
rpicam-hello -t 0 --camera 1

7.1 Preview the Camera

xxxxxxxxxx
rpicam-hello

Entering this command in the terminal will display the preview window for about 5 seconds.

xxxxxxxxxx
rpicam-hello -t 0

Running this command in the terminal will keep displaying the preview window. You can exit using the window close button and the Ctrl+C key!

7.2 Take a Photo

xxxxxxxxxx
rpicam-jpeg -o test.jpg

Display a 5-second preview, then capture the image and save it as the test.jpg file.

xxxxxxxxxx
rpicam-jpeg -o test.jpg -t 2000 --width 640 --height 480

Display a 2-second preview, then capture the image and save it as the test.jpg file. The width of the image is 640 pixels and the height is 480 pixels.

7.2.1 rpicam-still

This command can be used to save files in different formats:

xxxxxxxxxx
rpicam-still -e png -o test.png
rpicam-still -e bmp -o test.bmp
rpicam-still -e rgb -o test.data
rpicam-still -e yuv420 -o test.data
  • Raw image capture
xxxxxxxxxx
rpicam-still -r -o test.jpg
  • Time-lapse shooting

Continuously capture images at an interval of 2 seconds, with a total capture duration of 30 seconds, and save each image with a filename format similar to image0001.jpg:

xxxxxxxxxx
rpicam-still -t 30000 --timelapse 2000 -o image%04d.jpg

7.3 Video Recording

rpicam-vid

A command used to record video on the Raspberry Pi using a camera module.

Example: Record 10 seconds of video and write it to the test.h264 file.

xxxxxxxxxx
rpicam-vid -t 10000 -o test.h264

Play the video

xxxxxxxxxx
vlc test.h264

Note: If the test.h264 file cannot be played and an error is reported, please try the following method to solve it.

Error Solution

Modify the frame rate at which H264 plays per second.

image-20231212203607442

image-20231212203645482

image-20231215142018906

7.4 Web Page Camera Preview

Use a Python script file to implement a web page preview of the camera image.

7.4.1 Run the Script

Code path: /home/pi/Camera_Web_Preview/

xxxxxxxxxx
cd /home/pi/Camera_Web_Preview/
python3 mjpeg_server.py

image-20240102192836885

7.4.2 Web Page Access

Devices on the same local area network can enter :8000 in a browser to view the real-time camera image!

xxxxxxxxxx
Example:
Raspberry Pi IP: 10.42.0.1
Web page access: 10.42.0.1:8000

image-20240102193907445

xxxxxxxxxx
If you want to set it to start automatically on boot, you can search for information online and set this script file to start automatically on boot!

8. 6.12 Kernel Backup Usage

If the current kernel of the Pi 5 is:

xxxxxxxxxx
6.12.25+rpt-rpi-2712

Use pi5/backup-rpi-6.12/:

xxxxxxxxxx
mkdir -p ~/imx415
cd ~/imx415

Copy the source code under pi5/backup-rpi-6.12/, then:

xxxxxxxxxx
make modules
make dtbo

If the headers lack DTS:

xxxxxxxxxx
git clone --depth 1 --branch rpi-6.12.y https://github.com/raspberrypi/linux ~/linux
make dtbo KERNEL_SRC=/home/pi/linux

The installation and configuration steps are the same as for 6.18.

9. Re-adaptation When Switching Other Raspberry Pi Kernels

Prepare a complete kernel source that matches the current kernel, then:

xxxxxxxxxx
cd ~/imx415
make modules KERNEL_SRC=/home/pi/linux
make dtbo

Note: pi5/src/imx415.c has been adapted to the devm_v4l2_sensor_clk_get interface of 6.18. If you sync from the 6.12 source to the 6.18 kernel, you need to refer to the driver in the 6.18 kernel, and you cannot directly mix the old source.

10. Common Problems

10.1 After installation, modinfo imx415 shows the old path or the old version

Execute:

xxxxxxxxxx
modinfo imx415 | grep -E 'filename|vermagic'

If it shows 6.6.31 or 6.12.25, it means the system loaded the old module. Delete the old file and install the matching version:

xxxxxxxxxx
sudo rm -f /lib/modules/$(uname -r)/updates/dkms/imx415.ko
sudo cp imx415.ko /lib/modules/$(uname -r)/updates/dkms/
sudo depmod -a

10.2 An error of Invalid module format or disagrees about version of symbol is reported when loading

The kernel module does not match the current kernel version. Recompile using the source corresponding to the current uname -r.

10.3 The overlay does not take effect

Check:

xxxxxxxxxx
ls -l /boot/firmware/overlays/imx415.dtbo
cat /boot/firmware/config.txt | grep dtoverlay
dmesg | grep -i overlay

You must reboot after modifying config.txt.

11. Notes

  • Do not directly install pi5/imx415.ko or pi5/imx415.dtbo on 6.18.34. Download or compile the kernel files of the corresponding version and install them onto the corresponding version.
  • After a kernel upgrade, imx415.ko and imx415.dtbo must be recompiled.
  • After installing to /lib/modules/$(uname -r)/updates/dkms/, you must execute sudo depmod -a.
  • The dtbo path should be selected as /boot/firmware/overlays/ or /boot/overlays/ according to the actual boot partition of the system.
QR code recognition
Advanced AI Vision-Human Pose Estimation

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文