Jump to content

Armbian 5.25 on OrangePI PC: The gc2035 video camera doesn't work


IgZero

Recommended Posts

It turns out that after a few hours of running motion the captured image have a green tint (not like the above sample at 1600x1200, just a normal image with almost no red-blue components). Since I'm using the beta repository I though it was a problem of the kernel of the day, in fact updating and rebooting solved the issue.

It turns out that's enough to stop and start motion to get a normally coloured image.

Do you think it's an hardware or driver issue?

Link to comment
Share on other sites

On 01.09.2017 at 6:36 PM, garlic said:

I had solved this problem by my friend.

Run this script


sunxi-pio -m "PG11<1><0><1><1>"
modprobe gc2035
modprobe vfe_v4l2

The most import is that don't load gc2035 & vfe_v4l2 before. So you had better remove it in /etc/modules

This is my /etc/modules


#w1-sunxi
#w1-gpio
#w1-therm
#gc2035
#vfe_v4l2
#sunxi-cir
#v4l2loopback

you may see /dev/video0, but when you reboot, it lose again

I add my scrip to /etc/rc.local

this is my /etc/rc.local


sunxi-pio -m "PG11<1><0><1><1>"
modprobe gc2035
modprobe vfe_v4l2
sleep 5
modprobe v4l2loopback devices=2
/root/vidcopy/vidcopy -w 640 -h 480 -r 30 -i /dev/video0 -o /dev/video1 -f UYVY
sleep 5
/root/vidcopy/vidcopy -w 640 -h 480 -r 30 -i /dev/video1 -o /dev/video2 -f UYVY
exit 0

Thanks my friend: "虚耗"

It's not helped for me. Armbian 5.31 don't want to make camera active.

Why you work with PG11 pin? Maybe here is the difference beetween OPi PC and OPi One? It's likely PE11 in OPi One.

Anyway, /dev/video0 is not created.

 

Link to comment
Share on other sites

Anyone, please, help me to activate camera. It's not power up at all. What address line needs to make HIGH to turn it on??

I was add to rc.local:

sunxi-pio -m "PD14<1><default><default><1>"
sunxi-pio -m "PE14<1><default><default><1>"
sunxi-pio -m "PE15<1><default><default><0>"
sunxi-pio -m "PA17<1><default><default><1>"
sunxi-pio -m "PG11<1><0><1><1>"
modprobe gc2035
modprobe vfe_v4l2

But still have not /dev/video0, and have:

[    5.358154] [CSI_ERR][GC2035]sensor_read err at sensor_detect!
[    5.358170] [CSI_ERR][GC2035]chip found is not an target chip.
Camera connected right. Seller said it works under Armbian 5.20. What is the different in initialization??

Is anyone have script.bin of Armbian 5.20 for OPi One? I can't find old images. The older only 5.25.

And who can say what means <drive level> at sunxi-pio command? Is it different voltage levels (1.5,1.8,2.8,3.3)?

Thanks!

 

Link to comment
Share on other sites

I think it is driver problem, but I can misstake.

The thing is,  if I turn on lines below in rc.local, when driver starts it's turns off - no power, reset is low.

sunxi-pio -m "PG11<1><0><1><1>" #AVDD,DOVDD,DVDD
sunxi-pio -m "PE15<1><0><1><0>" #Power_Down
sunxi-pio -m "PE14<1><0><1><1>" #reset

 

Please, can anybody give me some advice to fix it?

Link to comment
Share on other sites

On 05.11.2017 at 5:04 PM, olivluca said:

AFAIK drive level refers to the current that a gpio configured as output can supply, unfortunately I don't remember where I read it and cannot find the documentation right now.

Thanks olivluca! But as I understand all service signals ok.

Two questions:

1. Can I see camera on a i2c bus when do i2cdetect - y 0/1?

2. What address on twi is right? I have =120 in my script.bin, but tryed to change on = 0x78. Or it is the same?

Thanks!

 

Link to comment
Share on other sites

Ok guys, I found the answer!

1. DO NOT touch /etc/modules. Leave it like that:

#w1-sunxi
#w1-gpio
#w1-therm
#gc2035
#vfe_v4l2
2.  rc.local:

modprobe gc2035 hres=0
modprobe vfe_v4l2

sunxi-pio -m "PG11<1><0><1><1>" #DOVDD
sunxi-pio -m "PE15<1><0><1><0>" #Power_Down
sunxi-pio -m "PE14<1><0><1><1>" #reset

 

And it works!

$fswebcam -r 1600x1200 -p YUV420P /home/dimak/qwe.jpg

I got image.

Thanks for all!!!

Link to comment
Share on other sites

On 08.11.2017 at 12:17 PM, Dmitriy Voitenko said:

I try this method.

But /dev/video0 ... 

No such file or directory.

Armbian 5.31 LTS 3.3.113

After reconect fpc cable and reboot camera work.

Thank your.

Reboot is necessarily!

rc.local applyes parametrs at boot.

Link to comment
Share on other sites

Following this thread I got an Orange Pi Zero Plus 2 H3 with Armbian 5.35 jessie working.

 

My rc.local file looks like:

 

sunxi-pio -m "PA8<1><0><1><1>" #DOVDD
sunxi-pio -m "PE15<1><0><1><0>" #Power_Down
sunxi-pio -m "PE14<1><0><1><1>" #reset
  
modprobe gc2035
modprobe vfe_v4l2
sleep 5
modprobe v4l2loopback

 

Link to comment
Share on other sites

On 4.11.2017 at 12:43 PM, Dimak said:
  On 1.9.2017 at 5:36 PM, garlic said:

I had solved this problem by my friend.

Run this script


sunxi-pio -m "PG11<1><0><1><1>"
modprobe gc2035
modprobe vfe_v4l2

The most import is that don't load gc2035 & vfe_v4l2 before. So you had better remove it in /etc/modules

This is my /etc/modules


#w1-sunxi
#w1-gpio
#w1-therm
#gc2035
#vfe_v4l2
#sunxi-cir
#v4l2loopback

you may see /dev/video0, but when you reboot, it lose again

I add my scrip to /etc/rc.local

this is my /etc/rc.local


sunxi-pio -m "PG11<1><0><1><1>"
modprobe gc2035
modprobe vfe_v4l2
sleep 5
modprobe v4l2loopback devices=2
/root/vidcopy/vidcopy -w 640 -h 480 -r 30 -i /dev/video0 -o /dev/video1 -f UYVY
sleep 5
/root/vidcopy/vidcopy -w 640 -h 480 -r 30 -i /dev/video1 -o /dev/video2 -f UYVY
exit 0

Thanks my friend: "虚耗"

did you tried this one? according to schematics there shouldn't be a difference between OPi One and OPi PC Plus

Link to comment
Share on other sites

Thanks for the reply. im using OPI Lite as i've mentioned before. i've tried the scripts you point to, but i didnt menage to  

modprobe v4l2loopback devices=2

i cannot install the module. I stuck on make and make and install part of importing. But i thought v4l2loopback just forwards the dev/video0 signal to dev/video1 virtual path, but after running your script i still cannot find dev/Video0 device.

Link to comment
Share on other sites

Thank you!!

 

20 hours ago, chwe said:

sure?

gc2035_motion.jpg.08ae1999edc98d798e177fa91dd5d56c.jpgOPi PC+ just weeks ago... 

 

I didn't connect the camera properly! :)

I had the my OPi One away in the basement connected on the network and today that I visited it again I realized what was happening.

Thanks for indicating the exact message from @informer15 that made it work, and made me realize that it should work!

Here is the output from my camera!

OPi One, Armbian 5.36, Kernel 3.4.113

thanks.png

Link to comment
Share on other sites

Hint: check the orientation of your cable!

 

Hi guys, I also came here after purchasing a cheap orangepione + camera, had the same error dmesg but all the GPIO magic did not work for me. Then I checked the camera connection and the cable end at the camera board was flipped - it came pre-assembled and I assumed it was right, but it wasn't. Google with image search and verify your cable connection. My cable had blue markers, they are facing up now (before it was flipped at the camera side). 

 

hope it helps.

 

 

 

 

 

Link to comment
Share on other sites

The actual better ending to this story is not a post of the working camera but actually the underlying issue in the first place.

I'm not a newb but I also don't know every schema of every board I own. Does the cable connect N/E/S/W on OPi/NPi/RPi/BPi? 
Perhaps include a picture of the correct orientation of the connected camera's ribbon cable? No one seems to ever talk about that.

 

Not going to spend the next 4 hours yakshaving the cam across 6+ boards, 3 OS's in an attempt to port, decipher posts and problem solve. Multiply every attempt by 3 because I wonder "is the camera actually connected properly?".  Just to document [accurately on GitHub] a more universal method for all.

Moderators hate it when they go out of their way to provide software solutions to newbs with simple hardware problems.  Strike that, reverse it.

ce524a5408ce9f30c9246ac975060799f76696fd

Link to comment
Share on other sites

i run an orange pi one , with the camera module

 

sudo modprobe gc2035
sudo modprobe vfe_v4l2

 

works but 

sudo modprobe v4l2loopback

>modprobe: FATAL: Module v4l2loopback not found in directory /lib/modules/3.4.113-sun8i

 

so i ran "sudo apt install v4l2loopback-dkms"

reboot

 

sudo modprobe v4l2loopback

>modprobe: FATAL: Module v4l2loopback not found in directory /lib/modules/3.4.113-sun8i

 

result is the same , some tips ???
 

uname -a
>Linux orangepione 3.4.113-sun8i #18 SMP PREEMPT Wed Jan 24 22:10:49 CET 2018 armv7l armv7l armv7l GNU/Linux
 

Link to comment
Share on other sites

Hello,

 

I'm trying to use the CSI Orange Pi camera on orange Pi PC+, with motionEye, with Armbian Legacy Ubuntu desktop stable for OrangePiPC+ ( 5.38 | armhf | armv7l | 3.4.113-sun8i ) here is the armbianmonitor -u http://ix.io/YDB

 

I wasn't able to use the camera but running with this in the terminal, it works ! Thanks.

 

su root
sunxi-pio -m "PG11<1><0><1><1>"
modprobe gc2035
modprobe vfe_v4l2

However, when I reboot it is not working, and I have to reenter these commands.

 

Doing this :

su root
nano /etc/rc.local

I tried all the modification described in this thread (copy past, without modifying it, and alwas leaving the "exit 0" at the end) of rc.local but it's not working by defaut, I have to manually enter 

su root
sunxi-pio -m "PG11<1><0><1><1>"
modprobe gc2035
modprobe vfe_v4l2

in order to use the camera.

 

Someone have any tips on how can I make the  camera working by default ? Maybe I have to adapt the commands of the rc.local ? If yes, someone know I can find some information in order to adapt it ?

 

@StuxNet here a photo : https://lightpics.net/i/PyuE

 

Thanks

Link to comment
Share on other sites

Ok I think I have understood the problem :

There is a difference between boot and reboot...

nano /etc/rc.local is for booting but not for reboot.

So if I add :

sunxi-pio -m "PG11<1><0><1><1>" 
modprobe gc2035
modprobe vfe_v4l2
exit 0

to /etc/rc.local with root user AND I shutdown the system, it's working, If iI just reboot, it's not working after having edited  /etc/rc.local , we have to shutdown and boot...

Link to comment
Share on other sites

On 11/9/2017 at 12:22 PM, olivluca said:

 

I'm getting weird results with motion:

 

If I set 800x600 the image is OK but flipped horizontally

If I set 640x480 the image is OK

if I set 1600x1200 this is what I get:

imatge.thumb.png.1af6cc465106cb8c152794188acf2caa.png

 

Any news/hint on this issue? (fswebcam-gc2035 does the same)

Link to comment
Share on other sites

I compiled the module from here https://github.com/avafinger/gc2035 (gc2035.c, without trying to apply the patch in the same repository) and it works much better than the one included in armbian (though it has other quirks, see below).

I tried many of the advertised resolutions and they all work:

  • 640 x 480 (flipped horizontally)
  • 800x600 (ok)
  • 1280x720 (slightly washed up)
  • 1600x1200 (too much for motion)

Let's see if it lasts or if it causes more problems, but if nobody is going to fix the current driver I propose to revert to the older one.

 

Link to comment
Share on other sites

I'am also trying to get this run all day long. I tried all the things in this post and finally found out, that I have connection problems of the ribbon cable. I' am using the OPi Lite and therefore I need to connect the camera on one side withe blank contacts of the ribbon facing the pcb and on the other side facing away from the pcb, like in the attached pic.

3-orange-pi-lite-camera-.jpg

Measuring on the camera pcb I found out that the 5v on the outer lines doesn't arrive. What am I doing wrong? Removing the blck plastic part and positioning the ribbon loose i could measure the 5V. But still I get the error :

 

[   26.658416] [CSI_ERR][GC2035]sensor_read err at sensor_detect!
[   26.658436] [CSI_ERR][GC2035]chip found is not an target chip.

 

Maybe you have an advice for me? I am almost throwing everything in the trash.

 

Best regards 

Link to comment
Share on other sites

On 9/2/2018 at 5:57 PM, jps said:

Excuse my clumsiness, but I don't know what to do with the files in https://github.com/avafinger/gc2035

 

To compile it as an out of tree module I had to borrow some files from the full kernel source (I don't remember the details though, it's been a while). However

 

 

On 9/2/2018 at 5:57 PM, jps said:

.. i can not make the camera work in last Armbian. Thanks any help...

 

if by latest armbian you mean the one based on the 4.x kernel, I don't think it has the required csi driver.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines