Difference between revisions of "VEYE Camera on Orange Pi's RK35XX Boards"
Line 1: | Line 1: | ||
+ | '''<big>How to use VEYE series cameras on Orange Pi's RK35XX board</big>''' | ||
+ | |||
[https://wiki.veye.cc/index.php/VEYE_Camera_on_Orange_Pi%27s_RK35XX_Boards/zh 查看中文] | [https://wiki.veye.cc/index.php/VEYE_Camera_on_Orange_Pi%27s_RK35XX_Boards/zh 查看中文] | ||
+ | === 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. | ||
+ | |||
+ | ==== Camera Module List ==== | ||
+ | {| class="wikitable" | ||
+ | !Series | ||
+ | !Model | ||
+ | !Status | ||
+ | |- | ||
+ | |VEYE Series | ||
+ | |VEYE-MIPI-IMX327S | ||
+ | |Done | ||
+ | |- | ||
+ | |VEYE Series | ||
+ | |VEYE-MIPI-IMX462 | ||
+ | |Done | ||
+ | |- | ||
+ | |VEYE Series | ||
+ | |VEYE-MIPI-IMX385 | ||
+ | |Done | ||
+ | |} | ||
+ | |||
+ | === 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. | ||
+ | |||
+ | ==== 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. | ||
+ | [[File:OrangePi CM4 to VEYE cam.jpg|center|thumb|600x600px|OrangePi CM4 to VEYE cam]] | ||
+ | |||
+ | ==== 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. | ||
+ | <br />[[File:OrangePi CM5 to all cam overview.jpg|center|thumb|600x600px|OrangePi CM5 to all cam overview|link=http://wiki.veye.cc/index.php/File:OrangePi_CM5_to_all_cam_overview.jpg]][[File:OrangePi CM5 to all cam backview.jpg|center|thumb|600x600px|OrangePi CM5 to all cam backview|link=http://wiki.veye.cc/index.php/File:OrangePi_CM5_to_all_cam_backview.jpg]] | ||
+ | ===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 [https://github.com/veyeimaging/rk35xx_orangepi/releases releases]. | ||
+ | |||
+ | === 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 [http://www.orangepi.org/orangepiwiki/index.php/Orange_Pi_CM4 OrangePi CM4 user manual] or the [http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-CM5.html OrangePi CM5 user manual] for instructions on flashing the system. Alternatively, you can use the general <code>dpkg</code> command to install the deb package. | ||
+ | |||
+ | ===Check system status=== | ||
+ | Run the following command to confirm whether the camera is probed. | ||
+ | |||
+ | <code>sudo dmesg | grep veye</code> | ||
+ | |||
+ | ==== CM4 ==== | ||
+ | The output message appears as shown below: | ||
+ | |||
+ | <code>veyecam2m 1-003b: camera id is veyecam2m</code> | ||
+ | |||
+ | <code>veyecam2m 1-003b: sensor is IMX462</code> | ||
+ | |||
+ | *Run the following command to check the presence of video node. | ||
+ | |||
+ | <code>ls /dev/video0</code> | ||
+ | |||
+ | The output message appears as shown below. | ||
+ | |||
+ | <code>video0</code> | ||
+ | |||
+ | The correspondence of the various information is as follows: | ||
+ | {| class="wikitable" | ||
+ | !CAM num | ||
+ | !I2C | ||
+ | !media node | ||
+ | !video node | ||
+ | |- | ||
+ | |1 | ||
+ | |1 | ||
+ | |veyecam2m 1-003b | ||
+ | |/dev/video0 | ||
+ | |} | ||
+ | |||
+ | ==== CM5 ==== | ||
+ | The CM5 supports the connection of up to 4 cameras. The dmesg information includes the following content: | ||
+ | |||
+ | <code>veyecam2m 3-003b: camera id is veyecam2m</code> | ||
+ | |||
+ | <code>veyecam2m 3-003b: sensor is IMX462</code> | ||
+ | |||
+ | <code>veyecam2m 4-003b: camera id is veyecam2m</code> | ||
+ | |||
+ | <code>veyecam2m 4-003b: sensor is IMX462</code> | ||
+ | |||
+ | <code>veyecam2m 5-003b: camera id is veyecam2m</code> | ||
+ | |||
+ | <code>veyecam2m 5-003b: sensor is IMX462</code> | ||
+ | |||
+ | <code>veyecam2m 6-003b: camera id is veyecam2m</code> | ||
+ | |||
+ | <code>veyecam2m 6-003b: sensor is IMX462</code> | ||
+ | |||
+ | The correspondence of the various information is as follows: | ||
+ | {| class="wikitable" | ||
+ | !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 | ||
+ | |} | ||
+ | ===Application examples=== | ||
+ | ====v4l2-ctl==== | ||
+ | In the following example, <code>/dev/video0</code> can be modified as needed to correspond to the video node of the camera you wish to operate. | ||
+ | |||
+ | =====Install v4l2-utils===== | ||
+ | <code>sudo apt-get install v4l-utils</code> | ||
+ | =====List the data formats supported by the camera===== | ||
+ | <code>v4l2-ctl --list-formats-ext</code> | ||
+ | =====Snap picture===== | ||
+ | <code>v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat='NV12' --stream-mmap --stream-count=100 --stream-to=nv12-1920x1080.yuv -d /dev/video0</code> | ||
+ | |||
+ | For RK3566, also: | ||
+ | |||
+ | <code>v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=UYVY --stream-mmap --stream-count=100 --stream-to=uyvy-1920x1080.yuv -d /dev/video0</code> | ||
+ | |||
+ | You can use software like YUV Player or Vooya to play the images. | ||
+ | |||
+ | =====Check frame rate===== | ||
+ | <code>v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=NV12 --stream-mmap --stream-count=-1 --stream-to=/dev/null -d /dev/video0</code> | ||
+ | |||
+ | ====yavta==== | ||
+ | <code>git clone <nowiki>https://github.com/veyeimaging/yavta.git</nowiki></code> | ||
+ | |||
+ | <code>cd yavta;make</code> | ||
+ | |||
+ | <code>./yavta -c1 -Fnv12-1920x1080.yuv --skip 0 -f NV12 -s 1920x1080 /dev/video0</code> | ||
+ | ====gstreamer==== | ||
+ | We provide several gstreamer routines that implement the preview, capture, and video recording functions. See the [https://github.com/veyeimaging/rk35xx_veye_bsp/tree/main/samples samples] directory on github for details. | ||
+ | ====Import to OpenCV==== | ||
+ | First install OpenCV: | ||
+ | |||
+ | <code>sudo apt install python3-opencv</code> | ||
+ | |||
+ | We provide several routines to import camera data into opencv. See the [https://github.com/veyeimaging/rk35xx_veye_bsp/tree/main/samples samples] directory on github for details. | ||
+ | ===Compile drivers and dtb from source code=== | ||
+ | https://github.com/veyeimaging/rk35xx_orangepi/tree/main/linux | ||
+ | |||
+ | ===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-290/327 i2c/|VEYE-MIPI-327 I2C]] | ||
+ | |||
+ | === References === | ||
+ | |||
+ | *OrangePi CM4 | ||
+ | |||
+ | http://www.orangepi.org/orangepiwiki/index.php/Orange_Pi_CM4 | ||
+ | |||
+ | *OrangePi CM5 | ||
+ | |||
+ | http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-CM5.html | ||
+ | ===Document History=== | ||
+ | |||
+ | *2024-01-09 | ||
+ | |||
+ | Release 1st version. | ||
<br /> | <br /> |
Latest revision as of 15:22, 9 January 2025
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.