Changes

Jump to navigation Jump to search
Line 1: Line 1:  
[[VEYE MIPI 290/327 for Raspberry Pi/zh|查看中文]]
 
[[VEYE MIPI 290/327 for Raspberry Pi/zh|查看中文]]
   −
'''How to Use Veye Mipi Camera with Raspberry Pi'''
+
'''[[VEYE-MIPI-290/327 for Raspberry Pi|<big><big><big><big>How to use VEYE-MIPI-X series camera module on Raspberry Pi(legacy mode)</big></big></big></big>]]'''
    
===Introduction===
 
===Introduction===
VEYE-MIPI-290/327 is a is a special camera module which is compatible with RASPBERRY PI. It use SONY STARVIS sensor——IMX290/IMX327 and has excellent ISP functions build-in.The output format is stanard UYVY stream. It is very easy to use it with RASPBERRY PI.Of course, she also has some subtle differences with the official version. She only support 1080p resolution,and i2c cmd is different.
+
VEYE-MIPI-X is a is a special camera module which is compatible with RASPBERRY PI. It use SONY STARVIS sensor——IMX290/IMX327 and has excellent ISP functions build-in.The output format is stanard UYVY stream. It is very easy to use it with RASPBERRY PI.Of course, she also has some subtle differences with the official version. She only support 1080p resolution,and i2c cmd is different.
    
Theoretically,VEYE Camera Modules support all Raspberry Pi. For performance reasons, I recommend you use 3,3+,4 version.  This article uses Raspberry Pi 3B as an example to explain how the VEYE-MIPI-290/327 camera module working with  Raspberry Pi.  It also explain the specials  of RPI Computer Module and Zero using VEYE Camera Module.  
 
Theoretically,VEYE Camera Modules support all Raspberry Pi. For performance reasons, I recommend you use 3,3+,4 version.  This article uses Raspberry Pi 3B as an example to explain how the VEYE-MIPI-290/327 camera module working with  Raspberry Pi.  It also explain the specials  of RPI Computer Module and Zero using VEYE Camera Module.  
    +
=== About piOS---Bullseye ===
 +
The latest system of Raspberry Pi - bullseye has removed the support of raspicam by default. But we still have 2 ways to use it.
 +
 +
* 1, Use the legacy version of the OS, that is, do not upgrade to Bullseye.
 +
 +
https://www.raspberrypi.com/software/operating-systems/
 +
 +
* 2, Open legacy camera support in raspi-config on Bullseye. We have upgraded the program to accommodate this usage.
 +
 +
<blockquote><u>If you want to add the legacy camera interfaces to Bullseye, please click your update icon in the taskbar to update. Then open a terminal (Ctrl-Alt-T) and type ‘sudo raspi-config’, go to ‘Interface Options’ and then ‘Legacy Camera’, and reboot. These camera interfaces are deprecated, and we are not supporting them going forwards.</u></blockquote>https://www.raspberrypi.com/news/new-old-functionality-with-raspberry-pi-os-legacy/
 +
 +
By the way, Use this cmd to check your system version:
 +
 +
<code>lsb_release -a</code>
 
===Hardware Setup===
 
===Hardware Setup===
 
'''Essentials You Need:'''
 
'''Essentials You Need:'''
Line 20: Line 34:  
*Startup RaspberryPi.
 
*Startup RaspberryPi.
   −
<br />[[File:Veye-raspberry 3m.jpg|center|thumb|600x600px|Connect VEYE to RPI]][[File:Veye-Wiring scheme01.jpg|center|thumb|600x600px|Connect VEYE to RPI (part1)]]<br />[[File:Veye 290-327Wiring scheme00.jpg|center|thumb|600x600px|Connect VEYE(mini adaptor board) to RPI (part2)]]
+
{| class="wikitable"
 +
!VEYE-MIPI-IMX327S and RPI Connection
 +
VEYE-MIPI-IMX462 and RPI Connection
 +
 
 +
VEYE-MIPI-IMX385 and RPI Connection
 +
!VEYE-MIPI-IMX327S FPC WIRE Connection
 +
VEYE-MIPI-IMX462 FPC WIRE Connection
 +
 
 +
VEYE-MIPI-IMX385 FPC WIRE Connection
 +
|-
 +
|[[File:RaspberryPi 3B+ -VEYE-MIPI-IMS327S 01.jpg|alt=|center|thumb|400x400px]]
 +
|[[File:RaspberryPi 3B+ -VEYE-MIPI-IMS327S 02.jpg|alt=|center|thumb|400x400px]]
 +
|}
 +
<br />
 +
{| class="wikitable"
 +
!VEYE-MIPI-327E and RPI Connection
 +
!VEYE-MIPI-327E FPC and PWR WIRE Connection
 +
|-
 +
|[[File:ADP-E 001.jpg|alt=|center|thumb|400x400px]]
 +
|[[File:ADP-E 003.jpg|alt=|center|thumb|400x400px]]
 +
|}
 +
<br />
 +
{| class="wikitable"
 +
!VEYE-MIPI-327B and RPI Connection
 +
!VEYE-MIPI-327B FPC and PWR WIRE Connection
 +
|-
 +
|[[File:Veye-raspberry 3m.jpg|center|thumb|400x400px|alt=]]
 +
|[[File:Veye 290-327Wiring scheme00.jpg|center|thumb|400x400px|alt=]]
 +
|}
 +
 
 
===RaspberryPi System Setup and Configuration===
 
===RaspberryPi System Setup and Configuration===
   Line 44: Line 87:  
====Toolkits Overview====
 
====Toolkits Overview====
 
[[File:Rpi github overview.jpg|alt=|center|thumb|600x600px|Software Tookits on github]]
 
[[File:Rpi github overview.jpg|alt=|center|thumb|600x600px|Software Tookits on github]]
Software toolkits contains threeparts. ''veye_raspcam'' is raspcam alike Video Stream Toolkits, D_mipi_rpi is D-SDK Video Stream Toolkits, ''i2c_cmd'' is Video Control Toolkits.
+
Software toolkits contains three parts. ''veye_raspcam'' is raspcam alike Video Stream Toolkits, D_mipi_rpi is D-SDK Video Stream Toolkits, ''i2c_cmd'' is Video Control Toolkits.
    
*Video Stream Tookkits provides real-time display, capture, video recording, etc.
 
*Video Stream Tookkits provides real-time display, capture, video recording, etc.
Line 69: Line 112:  
If t is -1, Show continuous Real-time display to HDMI output,full screen.
 
If t is -1, Show continuous Real-time display to HDMI output,full screen.
   −
*veye_raspivid  
+
*veye_raspivid
    
<code>./veye_raspivid -t 5000 -o ~/test.h264</code>
 
<code>./veye_raspivid -t 5000 -o ~/test.h264</code>
Line 76: Line 119:     
At the same time,Dispaly real-time video to HDMI output.(use ''-n'' if you do not want preview)
 
At the same time,Dispaly real-time video to HDMI output.(use ''-n'' if you do not want preview)
 +
 +
*veye_raspivid (stream over TCP using gstreamer)
 +
 +
'''''RPI side'''''
 +
 +
<code>./veye_raspivid -b 4000000 -t 0 -o -  | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host=x.x.x.x port=5000</code>
 +
 +
H.264 encoding on bitrate 4Mbps,forever,listen on TCP port 5000.
 +
 +
'''''PC side,using gstreamer(Powershell recommended)'''''
 +
 +
<code>gst-launch-1.0 -v tcpclientsrc host=x.x.x.x port=5000 ! gdpdepay ! rtph264depay ! avdec_h264 ! autovideosink sync=false</code>
 +
 +
x.x.x.x is RPI IP address
 +
 +
'''''gstreamer''''' windows version download.
 +
 +
*veye_raspivid (stream over UDP using gstreamer)
 +
 +
'''''PC side,using gstreamer(Powershell recommended)'''''
 +
 +
<code>gst-launch-1.0 -v udpsrc port=5321 ! gdpdepay ! rtph264depay ! avdec_h264 ! autovideosink sync=false</code>
 +
 +
'''''RPI side'''''
 +
 +
<code>./veye_raspivid -b 4000000 -t 0 -o -  | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! udpsink host=x.x.x.x port=5000 sync=false</code>
 +
 +
H.264 encoding on bitrate 4Mbps.
 +
 +
x.x.x.x is HOST PC IP address.You need to run the pc-side program first and then run the Raspberry Pi-side program.
    
*veye_raspivid  (direct tcp stream with '''netcat,gstreamer''' etc..)
 
*veye_raspivid  (direct tcp stream with '''netcat,gstreamer''' etc..)
Line 133: Line 206:  
Capturing one image every 50 milliseconds and save to /dev/shm directory(which is in DDR).1920*1080 BMP format.
 
Capturing one image every 50 milliseconds and save to /dev/shm directory(which is in DDR).1920*1080 BMP format.
    +
<code>./veye_raspistill -k -o ~/test%d.jpg -t 0</code>
 +
 +
Display video to HDMI,capture jpg image using keyboard,Enter to capture,X Enter to quit.
 +
 +
veye_raspistill support preview,-n will not preview。
 
====D-SDK Toolkits Manual====
 
====D-SDK Toolkits Manual====
 
It contains three parts: C language SDK(libdmipicam.so),C language sample,Python language sample.
 
It contains three parts: C language SDK(libdmipicam.so),C language sample,Python language sample.
Line 139: Line 217:  
<code>sudo apt-get update && sudo apt-get install libopencv-dev</code>
 
<code>sudo apt-get update && sudo apt-get install libopencv-dev</code>
   −
<code>sudo apt-get install python-opencv</code>
+
<code><s>sudo apt-get install python-opencv</s></code>
 +
 
 +
<code>sudo apt-get install python3-opencv</code>
    
<code>sudo apt-get install libzbar-dev</code>
 
<code>sudo apt-get install libzbar-dev</code>
Line 150: Line 230:  
*compile:
 
*compile:
   −
<code>./build</code>
+
<code>./buildme</code>
    
*install:
 
*install:
Line 221: Line 301:  
Shows how to get yuv stream,transfer to opencv format and display it.
 
Shows how to get yuv stream,transfer to opencv format and display it.
 
===Video Control Toolkits Manual===
 
===Video Control Toolkits Manual===
On Raspberry Pi, I2C-0 is used by GPU. We use I2C-1 as control bus for VEYE Camera Module. We provide a Shell Script — camera_i2c_config— to config pin usage.
+
On Raspberry Pi, We use I2C-0 as control bus for VEYE Camera Module. We provide a Shell Script — camera_i2c_config— to config pin usage.
    
Video Control Toolkits Manual : [[VEYE-MIPI-290/327 i2c/|VEYE-MIPI-290/327 i2c]]
 
Video Control Toolkits Manual : [[VEYE-MIPI-290/327 i2c/|VEYE-MIPI-290/327 i2c]]
<br />
+
 
 +
The new version of PiOS use i2c-10. If i2c-10 doesn't work, try -b 0.
 +
 
 
===RPI Computer Module and RPI Zero Additional Info===
 
===RPI Computer Module and RPI Zero Additional Info===
    
====Overview====
 
====Overview====
RPI CM and Zero have a different MIPI CSI-2 port with standard RPI. And CM has can support dual cameras. Here I use a VEYE-MIPI-290/327 and a RPI CM3 as an example.
+
RPI CM and Zero have a different MIPI CSI-2 port with standard RPI. And CM has can support dual cameras.  
   −
PS: I use a Computer Module IO Board Plus designed by [http://www.waveshare.net/ WAVESHARE ELECTRONICS]. The official CMIO Board is similar.
+
For CM3, I use a Computer Module IO Board Plus designed by [http://www.waveshare.net/ WAVESHARE ELECTRONICS]. The official CMIO Board is similar.
 +
 
 +
For CM4,I use official CMIO board.
    
====Hardware Setup====
 
====Hardware Setup====
Line 238: Line 322:  
*Connect the VEYE Camera Module the CSI-2 port using FFC Cable('''type A''').
 
*Connect the VEYE Camera Module the CSI-2 port using FFC Cable('''type A''').
 
*Connect Dupont Line as shown below. VEYE-MIPI-290/327 need an addtional power.
 
*Connect Dupont Line as shown below. VEYE-MIPI-290/327 need an addtional power.
*CM3 can support dual cameras.
+
*CM can support dual cameras.
   −
=====Connecting I2C to CMIO=====
+
=====Connecting I2C to CM3=====
    
*CAM1:
 
*CAM1:
Line 257: Line 341:     
For WAVESHARE CMIO board, as shown below.
 
For WAVESHARE CMIO board, as shown below.
 +
[[File:Adpter with VEYE-MIPI-290-327 front.jpg|center|thumb|Adpter with VEYE-MIPI-290-327 front|alt=|600x600px]]
 +
[[File:Adpter with VEYE-MIPI-290-327 back.jpg|center|thumb|Adpter with VEYE-MIPI-290-327 back|alt=|600x600px]]
 +
<br />
 
[[File:Veye-computer module.jpg|center|thumb|600x600px|RPI CM2 to dual VEYE modules]]
 
[[File:Veye-computer module.jpg|center|thumb|600x600px|RPI CM2 to dual VEYE modules]]
   Line 262: Line 349:  
[[File:Veye computermodule Wiring scheme00.jpg|center|thumb|600x600px|RPI CM2 to dual VEYE modules(Part1)]]
 
[[File:Veye computermodule Wiring scheme00.jpg|center|thumb|600x600px|RPI CM2 to dual VEYE modules(Part1)]]
 
[[File:Veye computer moduleWiring scheme01.jpg|center|thumb|600x600px|RPI CM2 to dual VEYE modules(Part2)]]
 
[[File:Veye computer moduleWiring scheme01.jpg|center|thumb|600x600px|RPI CM2 to dual VEYE modules(Part2)]]
 +
 +
===== Connecting camera to CM4 =====
 +
[[File:Raspberry Pi CM4 system connect.jpg|alt=Raspberry Pi CM4 system connect|center|thumb|800x800px|'''Raspberry Pi CM4 system connect''']]
 
<br />
 
<br />
   
====System Setup and Configuration====
 
====System Setup and Configuration====
 
For RPI official CMIO board, please refer to [https://www.raspberrypi.org/documentation/hardware/computemodule/cm-emmc-flashing.md Link].
 
For RPI official CMIO board, please refer to [https://www.raspberrypi.org/documentation/hardware/computemodule/cm-emmc-flashing.md Link].
Line 285: Line 374:  
Implement H.264 format encoding and record for 5 seconds from camera 1,Record the stream data to file ~/test.h264.<br />
 
Implement H.264 format encoding and record for 5 seconds from camera 1,Record the stream data to file ~/test.h264.<br />
 
====Video Control Toolkits====
 
====Video Control Toolkits====
Downloading dt-blob.bin file from link,and upload it to /root/,reboot RPI.  
+
Downloading dt-blob.bin file from [https://www.raspberrypi.org/documentation/hardware/computemodule/dt-blob-dualcam.bin link],rename to dt-blob.bin and upload it to /boot/,reboot RPI.
 +
 
 +
===== CM3 =====
 +
CM3 use I2C-1 to control 2 cameras,It is time-sharing multiplexing.  
    
<code>./camera_i2c_config [cameranum]</code>
 
<code>./camera_i2c_config [cameranum]</code>
Line 297: Line 389:  
|1
 
|1
 
|CAM1
 
|CAM1
|}<code>./veye_mipi_i2c.sh -b [i2c bus num]</code>
+
|}<code>./veye_mipi_i2c.sh -b 1</code>
 +
 
 +
===== CM4 =====
 +
The CM4 module uses two I2C to communicate with two cameras respectively.
 +
 
 +
<code>./camera_i2c_config</code>
 
{| class="wikitable"
 
{| class="wikitable"
 
!i2c bus num
 
!i2c bus num
Line 305: Line 402:  
|CAM0
 
|CAM0
 
|-
 
|-
|1
+
|10
 
|CAM1
 
|CAM1
|}<br />Other options see : [[VEYE-MIPI-290/327 i2c/zh|VEYE-MIPI-290/327 i2c]]
+
|}
 +
<code>./veye_mipi_i2c.sh -b [i2c bus num]</code><br />Other options see : [[VEYE-MIPI-290/327 i2c/zh|VEYE-MIPI-290/327 i2c]]
 
===FFC Cable Remarks===
 
===FFC Cable Remarks===
  

Navigation menu