![VC MIPI OV9281 Скачать руководство пользователя страница 9](http://html.mh-extra.com/html/vc/mipi-ov9281/mipi-ov9281_how-to-set-up_857542009.webp)
1/17/2020
How to setup a VC MIPI OV9281 on a Raspberry PI Model 3B+
https://www.vision-components.com/fileadmin/external/documentation/hardware/VC_MIPI_OV9281_Raspberry_PI_Model_3BPlus/index.html
9/13
The demo itself is a program named vcmipidemo and its source code is mainly at the file vcmipidemo.c. However more programs are provided, namely the vcimgnetsrv, a
network image server, and its counterpart vcimgnetclient.py. The vcimgnetsrv is started as background service, and the vcmipidemo connects to it. Then you can use the
vcimgnetclient.py on your PC to view live captured images.
But for the first run it is better to just run the vcmipidemo and check if it shows the ascii representation. This works without any network cable attached. You can then output
the captured image to the framebuffer of the display by using the -f command line switch.
1. Change to the subdirectory named vc_mipi_demo/src.
2. The source directory contains a Makefile to compile the driver. Do so by calling:
make clean all
Just run the demo itself:
./vcmipidemo
or with framebuffer output:
./vcmipidemo -f
or with live view over ethernet:
./vcimgnetsrv &
./vcmipidemo
For live view over ethernet, execute the vcimgnetclient.py at the client (needs Python 2 and PyGTK).
3.6 Switching Sensor Configuration
The sensor driver provides different modes which support several features. They can be switched by changing values of sensor driver parameters.
To list available parameters of the sensor driver kernel module, use the following command:
modinfo vc_mipi_ov9281
The current parameter values of the loaded sensor driver module can be readout as content of a file named after the parameter name at the following directory:
/sys/module/vc_mipi_ov9281/parameters/
To change the sensor behaviour on the fly the drivers needs to be reloaded. First unload the platform driver (bcm2835-unicam) then the sensor driver (vc_mipi_ov9281),
followed by loading the platform driver (bcm2835-unicam) with possible other parameters, and finally loading the sensor driver (vc_mipi_ov9281) with its new parameter set.
Parameters can also be set for bootup time. To do so, add the desired value to the parameter at /boot/cmdline.txt; the syntax is:
moduleName.parameterName=parameterValue
Example
Parameters are shown after executing the following command:
modinfo vc_mipi_ov9281
Here is a part of a sample output which will be different at your setup:
⋮
parm: sensor_mode:VC Sensor Mode: 0=10bit_stream 1=8bit_stream 2=10bit_ext_trig 3=8bit_ext_trig (int)
⋮
Providing that the driver is loaded, the current value of the parameter sensor_mode can be displayed by executing:
cat /sys/module/vc_mipi_ov9281/parameters/sensor_mode
To change the sensor_mode to 0, execute the following commands:
sudo /sbin/modprobe -r bcm2835-unicam
sudo /sbin/modprobe -r vc_mipi_ov9281
sudo /sbin/modprobe bcm2835-unicam debug=3
sudo /sbin/modprobe vc_mipi_ov9281 sensor_mode=0
If you are happy with it, and you want to have this setting available directly after booting, add the following entry to the linux kernel commandline /boot/cmdline.txt:
vc_mipi_ov9281.sensor_mode=0