Line 139:
Line 139:
Since the two modes cannot co-exist, Legacy mode needs to be turned off when using V4L2 mode.
Since the two modes cannot co-exist, Legacy mode needs to be turned off when using V4L2 mode.
−
===Configuring global variables===
−
For the convenience of later descriptions, global variables are configured here according to the sensor size.
−
−
*MV-MIPI-IMX178M
−
−
<code>export WIDTH=3088</code>
−
−
<code>export HEIGHT=2064</code>
−
−
<code>export FPS=22</code>
−
−
*MV-MIPI-SC130M
−
−
<code>export WIDTH=1280</code>
−
−
<code>export HEIGHT=1024</code>
−
−
<code>export FPS=108</code>
−
−
* MV-MIPI-IMX296M
−
−
<code>export WIDTH=1440</code>
−
−
<code>export HEIGHT=1088</code>
−
−
<code>export FPS=60</code>
−
−
*MV-MIPI-IMX287M
−
−
<code>export WIDTH=704</code>
−
−
<code>export HEIGHT=544</code>
−
−
<code>export FPS=319</code>
−
−
*MV-MIPI-IMX265M
−
−
<code>export WIDTH=2048</code>
−
−
<code>export HEIGHT=1544</code>
−
−
<code>export FPS=45</code>
−
−
*MV-MIPI-IMX264M
−
−
<code>export WIDTH=2432</code>
−
−
<code>export HEIGHT=2056</code>
−
−
<code>export FPS=28</code>
−
−
*RAW-MIPI-SC132M
−
−
<code>export WIDTH=1024</code>
−
−
<code>export HEIGHT=1280</code>
−
−
<code>export FPS=120</code>
−
−
*RAW-MIPI-IMX462M
−
−
<code>export WIDTH=1920</code>
−
−
<code>export HEIGHT=1088</code>
−
−
<code>export FPS=60</code>
−
−
*RAW-MIPI-AR0234M
−
−
<code>export WIDTH=1920</code>
−
−
<code>export HEIGHT=1200</code>
−
−
<code>export FPS=60</code>
−
−
*RAW-MIPI-SC535M
−
−
<code>export WIDTH=2448</code>
−
−
<code>export HEIGHT=2048</code>
−
−
<code>export FPS=100</code>
===V4L2 mode manual===
===V4L2 mode manual===
We have saved the code for v4l2 mode in this [https://github.com/veyeimaging/raspberrypi_v4l2 github repository].
We have saved the code for v4l2 mode in this [https://github.com/veyeimaging/raspberrypi_v4l2 github repository].
Line 270:
Line 188:
And the /dev/video0 node exists, which proves that the camera status is normal.
And the /dev/video0 node exists, which proves that the camera status is normal.
+
+
==== '''State Detection and Environment Variable Configuration''' ====
+
[https://github.com/veyeimaging/raspberrypi_v4l2/tree/main/mv_tools_rpi Here], we provide an <code>mv_probe.sh</code> script that automatically detects the connected camera and configures environment variables with its default model, width, height, frame rate, and other information.
+
+
Usage:
+
+
<code>source ./mv_probe.sh</code>
+
+
A typical output:
+
+
<code>$ source ./mv_probe.sh</code>
+
+
<code>The mvcam driver is loaded on i2c-10, but the camera is not detected!</code>
+
+
<code>Found veye_mvcam camera on i2c-11.</code>
+
+
<code>Setenv CAMERAMODEL = MV-MIPI-SC535M</code>
+
+
<code>Setenv FPS = 49</code>
+
+
<code>Setenv HEIGHT = 2048</code>
+
+
<code>Setenv WIDTH = 2432</code>
+
+
You can verify the environment variable output using:
+
+
<code>echo $CAMERAMODEL</code>
+
+
Note that these environment variables are only valid for the current session.
+
+
'''Important Notes:'''
+
+
* This script requires the <code>mvcam</code> driver version '''1.1.06 or later'''.
+
* If your driver version is '''earlier than 1.1.06''' or you need to use different width, height, or frame rate values, refer to the camera module manual and manually configure the following environment variables. Otherwise, subsequent programs may not function correctly.
+
+
Example:
+
+
<code>export WIDTH=2432</code>
+
+
<code>export HEIGHT=2048</code>
+
+
<code>export FPS=50</code>
==== Raspberry Pi 5 Setting ====
==== Raspberry Pi 5 Setting ====