Line 102:
Line 102:
=== V4L2 mode manual ===
=== V4L2 mode manual ===
+
We have saved the code for v4l2 mode in this [https://github.com/veyeimaging/raspberrypi_v4l2 github repository].
+
+
====Download the driver package====
+
<code>wget <nowiki>https://github.com/veyeimaging/raspberrypi_v4l2/releases/latest/download/raspberrypi_v4l2.tgz</nowiki></code>
+
====Install driver====
+
<code>tar -xzvf raspberrypi_v4l2.tgz</code>
+
+
<code>cd raspberrypi_v4l2/release/</code>
+
+
<code>chmod +x *</code>
+
+
<code>sudo ./install_driver.sh veye_mvcam</code>
+
+
==== Use the suitable veye_vbyone.dtbo ====
+
V-by-One has many configuration options, such as the MIPI rate, the number of MIPI lanes for the camera, the number of V-by-One-HS-TX output lanes, whether IO uses the local mode or remote mode, and the number of coaxial cables used.
+
+
The default configuration is as follows:
+
+
* MIPI rate: 1.5Gbps/lane
+
* Camera MIPI signal: 2 lanes
+
* IO mode: Near-end mode
+
* Number of coaxial cables: 1
+
+
Please note that these are the default settings, and they can be customized based on specific requirements or preferences.
+
+
You can choose the appropriate "veye_vbyone-[option].dtbo" file, rename it to "veye_vbyone.dtbo," and then copy it to the "/boot/overlay" directory.
+
+
Alternatively, if you need to use a different configuration for the V-by-One setup, simply refer to the [[Build drivers from source for rpi|camera driver source code compilation guide for the Raspberry Pi platform]]. Modify the "veye_vbyone.dts" file according to your requirements, recompile it to obtain the "veye_vbyone.dtbo" file, and then copy it to the "/boot/overlay" directory.
+
+
Once the installation is complete, reboot your Raspberry Pi to apply the changes.
+
+
====Uninstall the driver====
+
If you need to change to Legacy mode, or want to change to another camera module model driver, you must uninstall the current driver first.
+
+
<code>sudo ./uninstall_driver.sh veye_vbyone</code>
+
+
<code>sudo ./uninstall_driver.sh veye_mvcam</code>
+
====Check system status====
+
Take MV-MIPI-IMX178M as an example.
+
+
<code>dmesg | grep mvcam</code>
+
+
You can see the camera model and the version of the camera probed during the Linux boot phase.
+
+
<code>camera is: MV-MIPI-IMX178M</code>
+
+
<code>firmware version: 0x1080102</code>
+
+
And the /dev/video0 node exists, which proves that the camera status is normal.
+
====v4l2-ctl application examples====
+
Please refer to the corresponding section in the article on [[Mv series camera appnotes 4 rpi|How to use MV series camera modules on the Raspberry Pi platform]].
+
+
=== Legacy mode manual ===
+
We store the code for legacy patterns in this [https://github.com/veyeimaging/mvcam_raspberrypi github repository].
+
+
====Download the software package====
+
<code>git clone <nowiki>https://github.com/veyeimaging/mvcam_raspberrypi.git</nowiki></code>
+
+
Add executable permissions:
+
+
<code>chmod +x -R ./mvcam_raspberrypi/</code>
+
====Software package main content introduction====
+
camera_i2c_config:Automatically recognizes different Raspberry Pi board types and controls the power on pins to power the camera.
+
+
vbyone_i2c_init.sh: Script for initializing and configuring the V-by-One link.
+
+
mv_raspicam:Realize image preview, image saving and other functions.
+
+
mv_mipi_i2c.sh:Scripts for reading and setting camera parameters via i2c protocol.
+
+
==== Initialize the V-by-One link ====
+
First, execute the vbyone_i2c_init.sh script.
+
+
Instructions for using the vbyone_i2c_init.sh script:
+
+
<code>Use the I2C command to initialize the SERDES channel of V-by-One.</code>
+
+
<code>Usage: ./vbyone_i2c_init.sh</code>
+
+
<code>options:</code>
+
+
<code> -b [i2c bus num] i2c bus number,default 10</code>
+
+
<code> -n [coax number] coax number [1,2],default 1</code>
+
+
<code> -s [camera mipi datarate] 1500 means:1500Mbps/lan; 1188 means: 1188Mbps/lan</code>
+
+
<code> -l [camera lan number] 2 or 4</code>
+
+
<code> -r [io remote or local] 0 means use io locally(on TX side); 1 means use io remotely(on RX side)</code>
+
+
<code> -h print this help</code>
+
+
Once the V-by-One link is initialized, you can use the mv_mipi_i2c.sh script to read the camera's version number and confirm whether the camera registers are accessible correctly.
+
+
Please refer to [[Mv series camera appnotes 4 rpi|How to use MV series camera modules on the Raspberry Pi platform]] for more usage.
+
+
=== Local mode and Remote mode of IO ===
+
The IO of V-by-One-HS_KIT can be configured to local mode and remote. These two modes are only applicable to MV series cameras.
+
+
====Local mode====
+
Access the corresponding IO of the MV camera locally at the TX end of V-by-One.
+
{| class="wikitable"
+
!MV Cam pin
+
!TX pin
+
!function
+
|-
+
|TriggerIN_IO
+
|GPIO0
+
|trigger in
+
|-
+
|OUT_IO1
+
|GPIO2
+
|Strobe/userout
+
|-
+
|OUT_IO2
+
|GPIO3
+
|Strobe/userout/triggerout
+
|}
+
====Remote mode====
+
Remote access to the corresponding IO of the MV camera is possible at the RX end of V-by-One.
+
{| class="wikitable"
+
!MV Cam pin
+
!TX pin
+
!RX pin
+
!function
+
!Direction
+
|-
+
|TriggerIN_IO
+
|GPIO0
+
|GPIO0
+
|trigger in
+
|RX-->TX
+
|-
+
|OUT_IO1
+
|GPIO2
+
|GPIO2
+
|Strobe/userout
+
|TX-->RX
+
|-
+
|OUT_IO2
+
|GPIO3
+
|GPIO3
+
|Strobe/userout/triggerout
+
|TX-->RX
+
|}
+
+
=== Common issue ===
+
+
* Do not execute i2cdetect
+
+
After system initialization, avoid using the i2cdetect command to detect address devices, as it may disrupt the established SerDes link.
+
+
===Document History===
+
+
*2023-07-30
+
+
First release version.