Welcome to IMX 415 Camera Module repository
1. Camera Driver Course
RDK X5 Driving IMX415 Camera Tutorial
RDK X5 Driving IMX415 Camera Tutorial1. Scope of Application2. Hardware Connection3. Confirming the System Environment4. If Using an Older Version of the RDK X5 ROS Image to Drive the IMX4155. Manually Starting Three Nodes5.1 Start MIPI Camera5.2 Start JPEG Encoding Node5.3 Start WebSocket Service5.4 View in the Computer Browser6. One-Click Start Using camera.py7. Starting the Expansion Board Fan8. Frequently Asked Questions8.1 The Web Page Cannot Be Opened8.2 The Web Page Opens but There Is No Image8.3 The Image Orientation Is Wrong8.4 Failure to Drive the Camera on8.5 The Fan Does Not Spin
Note: Only the 3.5.0 system version image can drive it directly. You can also use our latest ROS image and the latest official RDK image to drive it directly. If you are using an older version of the RDK X5 ROS image and want to drive the IMX415, focus on Section 4.
Friendly reminder: If you need to add a bracket, you must align all 4 screws at the same time before tightening them.
Notes:
Contact surface position: The metal contacts at the end of the cable must face the spring contacts or contact array inside the FFC connector.
Blue reinforcement plate: The blue reinforcement plate is usually located on the non-contact surface of the cable. In standard installation, the metal contacts and the blue plate are usually on opposite sides of the cable.
Silkscreen marking: The surface with the silkscreen text (e.g., AWM-20624) on the cable 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 cable may burn out.
Then the other end connects to the metal contacts on the motherboard.


Notes: The IMX415 has a DIP switch on its side labeled IR-CUT, which is used to control the infrared function on and off. Setting it to the ON position turns on infrared, and the interface will appear reddish, which is normal. Setting it to the OFF position disables the infrared function, and the interface shows normal colors.

1. Scope of Application
This tutorial is applicable to:
- The RDK X5 development board.
- A system with TROS Humble environment installed, at the path
/opt/tros/humble/setup.bash. - The IMX415 MIPI CSI camera.
The rdk_x5/ repository does not provide an independent Linux kernel module. The IMX415 driver on the RDK X5 is provided by the mipi_cam camera stack that comes with TROS/BSP. When debugging, mainly check whether the three ROS nodes, namely the TROS environment, the camera node, and the WebSocket, start normally.
2. Hardware Connection
- Connect the IMX415 camera to the camera interface of the RDK X5 through the MIPI CSI FPC cable.
- Check whether the FPC cable direction is correct. The gold fingers should be fully inserted and the latch locked.
- If using an expansion board, confirm that the camera power supply and fan power supply are normal.
- Confirm that the RDK X5 and the computer are on the same LAN and accessible via
pingor SSH.
3. Confirming the System Environment
Execute on the RDK X5 terminal:
cat /etc/os-releaseuname -rls /opt/tros/humble/setup.bashCheck whether the TROS camera-related packages exist:
xxxxxxxxxxsource /opt/tros/humble/setup.bashros2 pkg list | grep -E 'mipi_cam|hobot_codec|websocket'If packages such as mipi_cam are missing, it means the TROS image is incomplete. You need to update or reflash the corresponding version of TROS/BSP.
The official latest image, our motherboard ROS image, and the older official clean image, then pay attention to the version
| Version | Query Method | |
|---|---|---|
| RDK X5 System Image Version | 3.5.0 and above | cat /etc/version |
| tros-humble-hobot-stereonet Package Version | 2.4.1 and above | apt list | grep tros-humble-hobot-stereonet/ |
| tros-humble-mipi-cam Package Version | 2.4.1 and above | apt list | grep tros-humble-mipi-cam/ |
- If the system image version does not meet the requirements, please refer to the corresponding section of the documentation for image flashing and refer to the following sections.
- If the package version does not meet the requirements, please execute the following commands to update:
xxxxxxxxxxsudo apt updatesudo apt install --only-upgrade tros-humble-hobot-stereonetsudo apt install --only-upgrade tros-humble-mipi-cam4. If Using an Older Version of the RDK X5 ROS Image to Drive the IMX415
- First use update to upgrade dependencies
xxxxxxxxxxsudo apt update- Then upgrade the system
xxxxxxxxxxsudo apt upgrade- Finally upgrade miniboot
xxxxxxxxxxsudo rdk-miniboot-updateWhile performing these operations, make sure there are no errors before proceeding to the next step. If there are errors, resolve them first and then proceed. It is recommended to use SSH for the upgrade, because the upgrade process may update VNC and the desktop may exit.
5. Manually Starting Three Nodes
5.1 Start MIPI Camera
Open Terminal 1:
xxxxxxxxxxsource /opt/tros/humble/setup.bashros2 launch mipi_cam mipi_cam.launch.pyIf the image orientation is wrong, you can add a rotation parameter:
xxxxxxxxxxsource /opt/tros/humble/setup.bashros2 launch mipi_cam mipi_cam.launch.py mipi_rotation:=180.05.2 Start JPEG Encoding Node
Open Terminal 2:
xxxxxxxxxxsource /opt/tros/humble/setup.bashros2 launch hobot_codec hobot_codec_encode.launch.pyThis node encodes the raw image into JPEG for display on the web page.
5.3 Start WebSocket Service
Open Terminal 3:
xxxxxxxxxxsource /opt/tros/humble/setup.bashros2 launch websocket websocket.launch.py websocket_image_topic:=/image_jpeg websocket_only_show_image:=true5.4 View in the Computer Browser
First obtain the IP of the RDK X5:
xxxxxxxxxxhostname -Iip addr show | grep -E 'inet 'Open in the computer browser:
xxxxxxxxxxhttp://<RDK Device IP Address>:8000Under normal circumstances, you can see the real-time IMX415 image.
6. One-Click Start Using camera.py
Copy the rdk_x5/camera.py from the repository to the RDK X5:
xxxxxxxxxxscp rdk_x5/camera.py user@<rdk-x5-ip>:~/Execute on the RDK X5:
xxxxxxxxxxpython3 ~/camera.pyThe script will start in sequence:
- The
mipi_camnode, which by default comes withmipi_rotation:=180.0. - The
hobot_codecJPEG encoding node. - The
websocketservice node.
The script will print the local IP and the web page address:
xxxxxxxxxxhttp://192.168.x.x:8000If there is a graphical desktop, the script will try to open the browser automatically; if there is no desktop, it will print the URL on the terminal, and you can access it manually in the computer browser.
To stop, press Ctrl+C, and the script will close the three ROS processes it started.
7. Starting the Expansion Board Fan
If the IMX415 camera expansion board has a fan, you can execute:
xxxxxxxxxxscp rdk_x5/fan.py user@<rdk-x5-ip>:~/xxxxxxxxxxpython3 ~/fan.pyThe script uses I2C bus 5, device address 0x0d, and register 0x08, and writes 0x01 to turn on the fan. If it reports that smbus is missing:
xxxxxxxxxxsudo apt updatesudo apt install python3-smbus i2c-tools8. Frequently Asked Questions
8.1 The Web Page Cannot Be Opened
Check whether port 8000 is listening:
xxxxxxxxxxss -tlnp | grep 8000Check whether all three terminals executed:
xxxxxxxxxxsource /opt/tros/humble/setup.bashCheck whether the RDK X5 and the computer are on the same LAN.
8.2 The Web Page Opens but There Is No Image
Check whether there is an image topic:
xxxxxxxxxxros2 topic list | grep imageros2 topic hz /imageIf /image has no data, first check the mipi_cam node log. Common causes are that the camera cable is not inserted correctly, the wrong camera interface is selected, or the TROS image lacks the corresponding sensor configuration.
8.3 The Image Orientation Is Wrong
Restart mipi_cam and change the rotation parameter to 0.0 or 180.0:
xxxxxxxxxxros2 launch mipi_cam mipi_cam.launch.py mipi_rotation:=0.08.4 Failure to Drive the Camera on
Check whether the system has been upgraded to the latest version. If not, follow the upgrade operations to perform the upgrade.
8.5 The Fan Does Not Spin
Confirm that python3 fan.py has been executed and check:
xxxxxxxxxxsudo i2cdetect -y 5If 0x0d does not exist, check the fan power supply, I2C wiring, and the expansion board driver.