Jump to content

OV5640 Orange Pi Pc Plus


kreston

Recommended Posts

Armbianmonitor:

Dear friends! Please help me! What am I doing wrong?

 

I have Orange Pi Pc Plus. I am using Armbian. 4 months ago I bought a CSI camera OV5640 from Steven Zhao:

https://www.aliexpress.com/item/32869355445.html

With expansion board!

 

It's working under Android, but /dev/video0 does not appear in Armbian!

 

~$ sudo uname -a
Linux smart 3.4.113-sun8i #2 SMP PREEMPT Wed May 8 15:09:43 CEST 2019 armv7l armv7l armv7l GNU/Linux



:~$ sudo modprobe ov5640

:~$ sudo modprobe vfe_v4l2



:~$ dmesg | grep -i ov56
[ 6555.158751] [OV5640@lex]init_sensor - frame_rate: 0, max_win_size: 11
[ 6563.092176] [OV5640@lex]CSI_SUBDEV_PWR_ON!
[ 6563.160043] [OV5640@lex]sensor_init 0x0
[ 6563.160851] [OV5640@lex]sensor read retry=2
[ 6563.160862] [OV5640@lex]error at sensor_detect
[ 6563.160870] [OV5640@lex]chip found is not an target chip.
[ 6563.160880] [OV5640@lex]CSI_SUBDEV_PWR_OFF!

 

I don't tried to make drivers from source code ...

May be need other driver, that not included in the distr?

script.fex

Link to comment
Share on other sites

If i recall correctly you need to set (enable) a pin on  u-boot load time and specific to your PC Plus and OV5640.

 

Have you tried to set the pin on u-boot boot.cmd?

Something like:

 

# OPI-PC camera (set PG11 for gc2035)
gpio set PL10
gpio set PA17
#gpio set PG11

 

This error message typically tells you the board cannot find the attached sensor.

Possible causes are:

 

*  Sensor Not powered correctly (see which pin or píns should be set at boot)

Make sure theses lines are for the OV5640 and PC Plus.

vip_dev0_power_en = port:PA17<1><default><default><1>
vip_dev0_reset = port:PE14<1><default><default><1>
vip_dev0_pwdn = port:PE15<1><default><default><0>

* i2c is already in use, double check your Fex file and disable the correct twi, this seems to be OK in your FEX but try:

 

[twi1]
twi_used = 0
twi_scl = port:PA18<3><default><default><default>
twi_sda = port:PA19<3><default><default><default>

[twi2]
twi_used = 0
twi_scl = port:PE12<3><default><default><default>
twi_sda = port:PE13<3><default><default><default>

 

Link to comment
Share on other sites

Dear @@lex, I tried set different pin on u-boot boot.cmd... But this does not give a result ...  dev/video0 does not appear!

 

If i right understand, My board is Orange Pi PC Plus v 1.1. I don't know where can I to found number of board version! And I proceed from that is version 1.1...
For my schematic PL10 look so:             PL10/S_PWM/S_PL_EINT10 ---V2--->> PWR-LED
According schematic:                              PE15 ----C5--->>CSI-STBY-EN

But in my fex file:                                    vip_dev0_pwdn = PE15<1><default><default><0>   //may it be wrong??

Orange_pi-pc_plus_v1_1_schemetic.pdf OV5640_datasheet.pdf

Link to comment
Share on other sites

4 hours ago, kreston said:

tried set different pin

What different pin?

 

My working recipe for OV5640 + Orange Pi PC Plus + legacy kernel:

 

fex:

[csi0]
vip_dev0_mname = "ov5640"

Run following commands each time or add to /etc/rc.local

sunxi-pio -m "PG11<1><0><1><1>"
modprobe ov5640 (dmesg: [OV5640@lex]init_sensor - frame_rate: 0, max_win_size: 11)
modprobe vfe_v4l2 (multiple lines in dmesg and then /dev/video0 appears)

dmesg

[  207.918084] [OV5640@lex]init_sensor - frame_rate: 0, max_win_size: 11
[  230.644298] [ISP] isp platform_id = 5!
[  230.662302] [OV5640@lex]CSI_SUBDEV_PWR_ON!
[  230.730036] [OV5640@lex]sensor_init 0x0
[  230.768753] [OV5640@lex]CSI_SUBDEV_STBY_ON!
[  230.768764] [OV5640@lex]sensor_s_release_af
[  230.780030] [OV5640@lex]disalbe oe!
[  230.801648] [OV5640@lex]CSI_SUBDEV_STBY_OFF!
[  230.837794] [OV5640@lex]enable oe!
[  230.850068] [OV5640@lex]sensor_init 0x0
[  230.890663] [OV5640@lex]sensor_s_ctrl id: 9963797 - value: 1
[  230.903089] [OV5640@lex]sensor_s_vflip  = 1
[  230.903115] [OV5640@lex]sensor_s_ctrl id: 9963796 - value: 1
[  230.915584] [OV5640@lex]sensor_s_hflip  = 1
[  230.916508] [OV5640@lex]CSI_SUBDEV_STBY_ON!
[  230.916532] [OV5640@lex]sensor_s_release_af
[  230.929022] [OV5640@lex]disalbe oe!

 

test the capture:

fswebcam -r 1600x1200 -D 3 -p YUV420P aaa.jpg

 

Link to comment
Share on other sites

55 minutes ago, mostly said:

Run following commands each time or add to /etc/rc.local


sunxi-pio -m "PG11<1><0><1><1>"
modprobe ov5640 (dmesg: [OV5640@lex]init_sensor - frame_rate: 0, max_win_size: 11)
modprobe vfe_v4l2 (multiple lines in dmesg and then /dev/video0 appears)

 

 

Dear friend, @mostly! Thank you very much!!!!! I don't know why, but dev/video0 does appeared!!!! And this is working!!! Yes!  I'm happy !!!  Now can I try opencv!!!!

Thank @@lex too for help and answer!!!

Link to comment
Share on other sites

I captured video over vlc! It's working fine. I want to try translate video over ffmpeg.

Dear friends!  If someone know answers on my questions, please write here: 

1) how to change fps and resolutions? only ffmpeg? can I to make it over hardware?

2) how to flip image of camera? I'm making simple robot for fun! And me need move camera with servo-motor.

3) how work AF?

 

P.S.

I don't know why, but I can't to use  $fswebcam...

There is error:  "Error setting pixel format. VIDIOC_S_FMT: Operation not permitted."

Link to comment
Share on other sites

Guys!
These are my actions for make CSI-camera OV-5640  on ORANGE PI PC PLUS work:


1) change fex-file

vip_dev0_mname = "ov5640"
vip_dev0_power_en = port:PA17<1><default><default><1>
vip_dev0_reset = port:PE14<1><default><default><1>
vip_dev0_pwdn = port:PE15<1><default><default><0>

 

2) Add next commands to /etc/rc.local

sunxi-pio -m "PG11<1><0><1><1>" #DOVDD

modprobe ov5640
modprobe vfe_v4l2

3) Add this to /boot/boot.cmd

 gpio set PG11
 gpio set PA17

 

 

It's short way to the Purpose for Orange Pi Pc Plus with original 5Mp Ov5640 CSI camera from developer!

This recipe can save someone a lot of time.

 

P.S.

It's working on legacy kernel! And I don't tried run it on others kernels...

It's my system:

~$uname -a
Linux smart 3.4.113-sun8i #2 SMP PREEMPT Wed May 8 15:09:43 CEST 2019 armv7l armv7l armv7l GNU/Linux

 

P.P.S.

Streaming video works well under ffmpeg, but has a 3-5 second delay! How it may be fixed - I don't know... May be someone know tool or way for make delay less, than 1 second???
I'm searching exit from this situation...

Link to comment
Share on other sites

On 12/28/2019 at 7:41 AM, kreston said:

Guys!
These are my actions for make CSI-camera OV-5640  on ORANGE PI PC PLUS work:


1) change fex-file



vip_dev0_mname = "ov5640"
vip_dev0_power_en = port:PA17<1><default><default><1>
vip_dev0_reset = port:PE14<1><default><default><1>
vip_dev0_pwdn = port:PE15<1><default><default><0>

 

2) Add next commands to /etc/rc.local



sunxi-pio -m "PG11<1><0><1><1>" #DOVDD

modprobe ov5640
modprobe vfe_v4l2

3) Add this to /boot/boot.cmd



 gpio set PG11
 gpio set PA17

 

 

It's short way to the Purpose for Orange Pi Pc Plus with original 5Mp Ov5640 CSI camera from developer!

This recipe can save someone a lot of time.

 

P.S.

It's working on legacy kernel! And I don't tried run it on others kernels...

It's my system:



~$uname -a
Linux smart 3.4.113-sun8i #2 SMP PREEMPT Wed May 8 15:09:43 CEST 2019 armv7l armv7l armv7l GNU/Linux

 

P.P.S.

Streaming video works well under ffmpeg, but has a 3-5 second delay! How it may be fixed - I don't know... May be someone know tool or way for make delay less, than 1 second???
I'm searching exit from this situation...

 

 

Hi!

Im trying to make this work... OV5640 recently bought and an OPI PC PLUS...

 

How do I edit the fex file?

 

Thank you!

Link to comment
Share on other sites

2 hours ago, Cristobal Galleguillos Hart said:

 

 

Hi!

Im trying to make this work... OV5640 recently bought and an OPI PC PLUS...

 

How do I edit the fex file?

 

Thank you!

You are on your own in this case.

Support for stone-age legacy kernel using fex files has been dropped two years ago.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines