ArduCAM / ArduCAM_USB_Camera_Shield

This is the repository for ArduCAM USB Camera Shield
126 stars 70 forks source link

OV5642 cfg nor json file seem to work #57

Open Frans66 opened 6 years ago

Frans66 commented 6 years ago

Trying to run Python3 version of USB master for windows and Linux_x86. Both show same issue. Output from Windows version:

color mode 0
Serial: ÿÿÿÿ-ÿÿÿÿ-ÿÿÿÿ
Capture began, rtn_val =  0
Error capture image, rtn_val =  65317
Error capture image, rtn_val =  65314
Error capture image, rtn_val =  65314
Error capture image, rtn_val =  65314

Also new Windows USBTest program shows same issue. Old Windows USB Test program works flawlessly though. Can you please indicate what I'm doing wrong?

ArduCAM commented 6 years ago

Would you please send me the hardware setup photos to admin@arducam.com ?

Frans66 commented 6 years ago

While making the pictures I noticed camera hardware after a while didn't react at all to any version of software. USB board does, but camera doesn't. I'll first order new hardware and see if that solves the issue

ArduCAM commented 6 years ago

Please don't order any new board before sending me the your hardware setup then I will give you some suggestions.

Hydrorion commented 5 years ago

Good Morning Everyone,

I am sorry but I almost have the same issues indicating the following message : "Error capture image, rtn_val = 65317". I've been looking for a while about it on different topics but without any conclusion. Do you guys have any leads or solution to fix it ?

I am working on ArduCAM AR0134 global shutter camera with Linux UBUNTU 16.04 thanks to a Jetson TX2 and I try to launch the device on ROS.

Thank you for your attention and have a nice day !

Sincerely,

trimera commented 5 years ago

Hi, also the same problem with OV5642. Hardware below: 20190213182420 Thanks!

ArduCAM commented 5 years ago

@guthubing I can't tell the version of the USB camera shield, is it Rev.B, Rev.C or Rev.D? To diagnose the problem, you can open the camera from the windows GUI, and try to read the OV5642 sensor register address 0x000A and 0x000B, it should read 0x56, and 0x42 respectively. I need you feedback to isolate this issue, before we go ahead to next level.

ArduCAM commented 5 years ago

@guthubing you can also try other config files from: www.arducam.com/downloads/modules/industrial/Config/OV5642

trimera commented 5 years ago

@ArduCAM Thanks for reply. It is Arducam USB2.0 Camera Shield, not Arducam shield. I tried the camera with windows GUI. The value that is read by RegAddr. 0x000A/B is 0x0. Besides, it doesn't work with the notice "USB transfer data index error". image I checked also the USB cable, connection and driver, which work well during the test.

trimera commented 5 years ago

@ArduCAM And by trying the python demo code ArduCam_Py_Demo.py the result looks like this: ('color mode', 0) Serial: -- ('Capture began, rtn_val = ', 0L) ('Error capture image, rtn_val = ', 65317L) ('Error capture image, rtn_val = ', 65314L) ('Error capture image, rtn_val = ', 65314L) ('Error capture image, rtn_val = ', 65314L)

With the new config you provided to me it seems not working: Traceback (most recent call last): File "C:\Users\xuexi\Dropbox\Abschlussarbeit\Arducam\ArduCAM_USB_Camera_Shield-master\ArduCAM_USB_Camera_Shield-master\Windows\Python\Streaming_demo\ArduCam_Py_Demo.py", line 221, in if camera_initFromFile(config_file_name): File "C:\Users\xuexi\Dropbox\Abschlussarbeit\Arducam\ArduCAM_USB_Camera_Shield-master\ArduCAM_USB_Camera_Shield-master\Windows\Python\Streaming_demo\ArduCam_Py_Demo.py", line 53, in camera_initFromFile config = json.load(open(fialeName,"r")) File "C:\Python27\lib\json__init.py", line 291, in load **kw) File "C:\Python27\lib\json\init__.py", line 339, in loads return _default_decoder.decode(s) File "C:\Python27\lib\json\decoder.py", line 364, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Python27\lib\json\decoder.py", line 382, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded thanks.

ArduCAM commented 5 years ago

@guthubing sorry I made a mistake. the ID register address is 0x300A and 0x300B, please try it again and get back to me about the result.

trimera commented 5 years ago

@ArduCAM It works this time. image image

ArduCAM commented 5 years ago

@guthubing Since the I2C access is good, which means the camera can be detected. you can also try other config files from: www.arducam.com/downloads/modules/industrial/Config/OV5642 especially the YUV setting?

trimera commented 5 years ago

@ArduCAM It doesn't work for the new config file: C:\Users\xuexi>python C:\Users\xuexi\Dropbox\Abschlussarbeit\Arducam\ArduCAM_USB_Camera_Shield-master\ArduCAM_USB_Camera_Shield-master\Windows\Python\Streaming_demo\ArduCam_Py_Demo.py C:\Users\xuexi\Dropbox\Abschlussarbeit\Arducam\ArduCAM_USB_Camera_Shield-master\ArduCAM_USB_Camera_Shield-master\python_config\OV5642_QVGA_YUV_54fps.json Traceback (most recent call last): File "C:\Users\xuexi\Dropbox\Abschlussarbeit\Arducam\ArduCAM_USB_Camera_Shield-master\ArduCAM_USB_Camera_Shield-master\Windows\Python\Streaming_demo\ArduCam_Py_Demo.py", line 221, in if camera_initFromFile(config_file_name): File "C:\Users\xuexi\Dropbox\Abschlussarbeit\Arducam\ArduCAM_USB_Camera_Shield-master\ArduCAM_USB_Camera_Shield-master\Windows\Python\Streaming_demo\ArduCam_Py_Demo.py", line 53, in camera_initFromFile config = json.load(open(fialeName,"r")) File "C:\Python27\lib\json__init.py", line 291, in load **kw) File "C:\Python27\lib\json\init__.py", line 339, in loads return _default_decoder.decode(s) File "C:\Python27\lib\json\decoder.py", line 364, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Python27\lib\json\decoder.py", line 382, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded

ArduCAM commented 5 years ago

@guthubing I mean you copy these config files to the Config folder of the Windows GUI tool and test on our GUI first before moving to python or other platform. And please try the OV5642 YUV setting first, make sure if it is working.

trimera commented 5 years ago

@ArduCAM The OV5642 YUV could work with strange color: image But the other 3 config files can not work with warning "USB transfer data index error".

ArduCAM commented 5 years ago

@guthubing it is working now, please press the button on the lower right corner to switch the display mode to get the correct color. You still didn't tell me the board revision of your USB2 camera board.

trimera commented 5 years ago

@ArduCAM Thanks!. It is USB 2.0 shield Rev.B.

ArduCAM commented 5 years ago

Change the display mode, is it working correctly? We will check the work around for Rev.B hardware for JPEG config files soon.

trimera commented 5 years ago

@ArduCAM It works generally well, with warning "bad frame recieved". Besides, how could I expand the resolution from 320x240 to original 2592x1944 of OV5642? thanks.

ArduCAM commented 5 years ago

@guthubing I added another full 5MP YUV config OV5642_YUV_1944.cfg in the link: www.arducam.com/downloads/modules/industrial/Config/OV5642 You can try that .

trimera commented 5 years ago

@ArduCAM Unfortunatly it doesn't work with YUV_1944 file. After clicking open button, there's only still image from last capturing with warning "bad frame recieved" appearing 2~3 times per second. When the camera is closed and restarted again, there's warning "USB device create error", no matter what config file it is now. So I have to reconnect the USB again. grafik

ArduCAM commented 5 years ago

@guthubing please be patient, we will work that today and give you update.

ArduCAM commented 5 years ago

@guthubing I am still working on the maximum resolution config file. In the mean time, would you please help me check if the following config files work, they only work for REV.B board. www.arducam.com/downloads/modules/industrial/Config/OV5642/OV5642_QVGA_JPEG_REVB.cfg www.arducam.com/downloads/modules/industrial/Config/OV5642/OV5642_JPEG_720p_REVB.cfg www.arducam.com/downloads/modules/industrial/Config/OV5642/OV5642_JPEG_1080p_REVB.cfg

ArduCAM commented 5 years ago

@guthubing I found there is still some bugs on Rev.B board. The above confg file, you have to open->close and open again then click play to get the video out.

ArduCAM commented 5 years ago

@guthubing The following config for 5MP, but you have to load the smaller resolution config file and open then close and load this config: www.arducam.com/downloads/modules/industrial/Config/OV5642/OV5642_JPEG_QSXGA_TEST.cfg The Rev.B board is quite old, and has some incompaitibility issues, now we have update the board to REV.D.

trimera commented 5 years ago

@ArduCAM OV5642_QVGA_JPEG_REVB.cfg could work for only few seconds, they it stopped with warning "USB transfer time out error". OV5642_JPEG_720p_REVB.cfg worked well. For OV5642_JPEG_1080p_REVB.cfg there's image, but unrecognizable. Some part of the image break into pieces and come out randomly.

trimera commented 5 years ago

@ArduCAM OV5642_JPEG_QSXGA_TEST.cfg did work, but with about 1 fps, which is far from 5fps in description. Is it config file matter or I have to get a new version, for a better fps?

trimera commented 5 years ago

@ArduCAM Could you send me the link of OV5642 full resolution config file formal edition once you finish it? Thanks!

amalhub commented 5 years ago

Hi @guthubing / @ArduCAM I'm having the same problem. Can you please share the config files with me, please? The given links are not working anymore to download the cfg files. Specially looking for (OV5642_JPEG_720p_REVB.cfg)