VEYE Camera on Orange Pi's RK35XX Boards
How to use VEYE series cameras on Orange Pi's RK35XX board
1 Overview
VEYE series cameras are the video streaming mode MIPI cameras we designed. This article takes OrangePi CM4 and CM5 board as an example to introduce how to connect VEYE series cameras to RK3566/RK3568/RK3588 system.
We provide drivers for Linux.
1.1 Camera Module List
Series | Model | Status |
---|---|---|
VEYE Series | VEYE-MIPI-IMX327S | Done |
VEYE Series | VEYE-MIPI-IMX462 | Done |
VEYE Series | VEYE-MIPI-IMX385 | Done |
2 Hardware Setup
We use the official baseboards of the Orange Pi CM4 and CM5, which both provide a 15-pin connector compatible with Raspberry Pi. This allows us to install our cameras directly onto their mainboards without the need for an adapter board.
2.1 Connection of Camera and OrangePi CM4 Board
The two are connected using 15-pin FFC cables with opposite-facing contacts, please pay attention to the orientation of the contact surfaces.
Note that only the CAM1 shown in the image below supports VEYE cameras.
2.2 Connection of Camera and OrangePi CM5 Board
The two are connected using 15-pin FFC cables with opposite-facing contacts; please pay attention to the orientation of the contact surfaces.
The OrangePi CM5 supports up to four VEYE cameras. The following diagram shows the hardware connection method for simultaneously connecting multiple cameras.
3 Introduction to github repositories
https://github.com/veyeimaging/rk35xx_veye_bsp
https://github.com/veyeimaging/rk35xx_orangepi
includes:
- driver source code
- i2c toolkits
- application demo
In addition, a compiled linux kernel installation package is provided in the releases.
4 Upgrade the Ubuntu system
We provide a flashing image for the release system, as well as a deb package for the Linux kernel.
Refer to the OrangePi CM4 user manual or the OrangePi CM5 user manual for instructions on flashing the system. Alternatively, you can use the general dpkg
command to install the deb package.
5 Check system status
Run the following command to confirm whether the camera is probed.
sudo dmesg | grep veye
5.1 CM4
The output message appears as shown below:
veyecam2m 1-003b: camera id is veyecam2m
veyecam2m 1-003b: sensor is IMX462
- Run the following command to check the presence of video node.
ls /dev/video0
The output message appears as shown below.
video0
The correspondence of the various information is as follows:
CAM num | I2C | media node | video node |
---|---|---|---|
1 | 1 | veyecam2m 1-003b | /dev/video0 |
5.2 CM5
The CM5 supports the connection of up to 4 cameras. The dmesg information includes the following content:
veyecam2m 3-003b: camera id is veyecam2m
veyecam2m 3-003b: sensor is IMX462
veyecam2m 4-003b: camera id is veyecam2m
veyecam2m 4-003b: sensor is IMX462
veyecam2m 5-003b: camera id is veyecam2m
veyecam2m 5-003b: sensor is IMX462
veyecam2m 6-003b: camera id is veyecam2m
veyecam2m 6-003b: sensor is IMX462
The correspondence of the various information is as follows:
CAM num | I2C | media node | video node |
---|---|---|---|
1 | 4 | veyecam2m 4-003b | /dev/video22 |
2 | 3 | veyecam2m 3-003b | /dev/video33 |
3 | 5 | veyecam2m 5-003b | /dev/video11 |
4 | 6 | veyecam2m 6-003b | /dev/video0 |
6 Application examples
6.1 v4l2-ctl
In the following example, /dev/video0
can be modified as needed to correspond to the video node of the camera you wish to operate.
6.1.1 Install v4l2-utils
sudo apt-get install v4l-utils
6.1.2 List the data formats supported by the camera
v4l2-ctl --list-formats-ext
6.1.3 Snap picture
v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat='NV12' --stream-mmap --stream-count=100 --stream-to=nv12-1920x1080.yuv -d /dev/video0
For RK3566, also:
v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --stream-mmap --stream-count=100 --stream-to=uyvy-1920x1080.yuv -d /dev/video0
You can use software like YUV Player or Vooya to play the images.
6.1.4 Check frame rate
v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=NV12 --stream-mmap --stream-count=-1 --stream-to=/dev/null -d /dev/video0
6.2 yavta
git clone https://github.com/veyeimaging/yavta.git
cd yavta;make
./yavta -c1 -Fnv12-1920x1080.yuv --skip 0 -f NV12 -s 1920x1080 /dev/video0
6.3 gstreamer
We provide several gstreamer routines that implement the preview, capture, and video recording functions. See the samples directory on github for details.
6.4 Import to OpenCV
First install OpenCV:
sudo apt install python3-opencv
We provide several routines to import camera data into opencv. See the samples directory on github for details.
7 Compile drivers and dtb from source code
https://github.com/veyeimaging/rk35xx_orangepi/tree/main/linux
8 i2c script for parameter configuration
Because of the high degree of freedom of our camera parameters, we do not use V4L2 parameters to control, but use scripts to configure parameters.
https://github.com/veyeimaging/rk35xx_veye_bsp/tree/main/i2c_cmd
using -b option to identify which bus you want to use.
- VEYE series
Video Control Toolkits Manual :VEYE-MIPI-327 I2C
9 References
- OrangePi CM4
http://www.orangepi.org/orangepiwiki/index.php/Orange_Pi_CM4
- OrangePi CM5
10 Document History
- 2024-01-09
Release 1st version.