VC MIPI OV9281 Скачать руководство пользователя страница 9

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

3.5   Running the Demo

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.

3.5.1   Compile the programs

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 

3.5.2   Execute the demo

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

Содержание MIPI OV9281

Страница 1: ...ing sign alerts of possible pitfalls to avoid Please pay careful attention to sections marked with this sign This is a sign for an example Trademarks Linux Debian the Tux logo Vivado Xilinx and Zynq ARM Cortex Windows XP Total Commander Tera Term Motorola HALCON Vision Components are registered Trademarks All trademarks are the property of their respective owners Raspberry Pi and Raspbian are also...

Страница 2: ...e Setup 3 1 Install necessary Raspbian packages 3 2 Get the driver and demo code 3 3 Driver Installation 3 4 First Image Acquisition Test 3 5 Running the Demo 3 5 1 Compile the programs 3 5 2 Execute the demo 3 6 Switching Sensor Configuration 4 Troubleshooting and Background Information 4 1 Q A 4 2 Driver Knowledge 4 2 1 Providing the device tree overlay 4 2 2 Set up the I C bus for driver sensor...

Страница 3: ...A at 5V 2 Hardware Setup 2 1 Hardware Pre Check Install Raspbian First step is to install Raspbian from https www raspberrypi org downloads raspbian The driver is known to work with the kernel version 4 14 so download the appropriate Raspbian version Raspbian Stretch Lite is sufficient and this guide expects this version to be installed not only for the framebuffer output handling For more install...

Страница 4: ... site looks different Install Raspbian by following the instructions provided there The display shows a login prompt after successful installation If this is not the case you have to check your Raspbian installation The most relevant information to succeed can be found at the Raspbian website or at the web Raspbian showing login screen user is usually pi with password raspberry 2 2 Connect the MIP...

Страница 5: ...d insert the cable and press their lid back when mounted correctly You should then not be able to pull the cable out Open the MIPI module socket put in the cable close the MIPI module socket Warning The connection at this type of socket is not protected against bad alignment so always check the orthogonality and if it is bent correct it Also watch out for the right orientation of the cable The MIP...

Страница 6: ...able to the CAMERA socket at the raspberry Pi equally left bad right good Warning Do not connect other devices to the I C bus named VC since it can affect the communication between the camera sensor and the driver For example running the touch screen of the Raspberry PI 7 inch display will lead to communication problems between driver and camera sensor The display may work with the following line ...

Страница 7: ...itching the system on Raspbian showing login screen user is usually pi with password raspberry 3 Software Setup 3 1 Install necessary Raspbian packages Before beginning with the installation do the following steps first This requires your Raspberry PI to already have an internet connection otherwise you have to install the packages mentioned manually search the web for the procedure needed 1 Updat...

Страница 8: ...ed archive named vc_mipi_driver_raspberryPi3_ov9281 2 The directory with the sources contains a Makefile to compile the driver Do so by calling make clean all 3 Calling make the following way will install the kernel module in your current kernel module path make install 4 Follow the instructions displayed by the make command this may be similar to the following lines ADD dtparam i2c_vc on and dtov...

Страница 9: ...r 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 Firs...

Страница 10: ...nnected to the I C bus 0 For example the touch screen controller of the Raspberry PI display may not be connected Check the orientation of the cable at the sensor side as well as at the cpu side Also check if the cable and the sockets are orthogonal 4 2 Driver Knowledge The following tasks have to be done to do an image acquisition with the camera sensor Information about the new sensor hardware a...

Страница 11: ...eal time operating system RTOS on the GPU This RTOS looks into the file boot config txt It loads a default Kernel device tree and patches it by overlaying the device tree parts listed by the dtoverlay entries at the file boot config txt To add information about the new sensor this config file needs the following entry dtoverlay vc_mipi_ov9281 The device tree will then be modified by the overlay at...

Страница 12: ...les by yourself 1 Change to the subdirectory named vc_mipi_driver_raspberryPi3_ov9281 2 The source directory contains a Makefile to compile the driver Do so by calling make clean all The directory then contains the driver as two modules They must be copied to their places vc_mipi_ov9281 ko to lib modules uname r kernel drivers media i2c bcm2835 unicam ko to lib modules uname r kernel drivers media...

Страница 13: ...rent line cma 128M After reboot the kernel message line beginning with Memory will show an additional entry 131072K cma reserved Example After reboot you can show the line by executing the following command dmesg grep Memory Here is a sample output which will look slightly different at your setup 0 000000 Memory 817108K 970752K available 7168K kernel code 576K rwdata 2076K rodata 1024K init 698K b...

Отзывы: