donny681 / ESP32_CAMERA_QR

Apache License 2.0
628 stars 226 forks source link

ov2640 not initializing with SXGA mode #3

Closed chegewara closed 4 years ago

chegewara commented 5 years ago

I am trying to initialize camera with mode SXGA or UXGA and i am getting errors:

SCCB_Write [ff]=00 failed
SCCB_Write [e0]=04 failed
SCCB_Write [da]=18 failed
SCCB_Write [d7]=03 failed
SCCB_Write [e1]=77 failed
SCCB_Write [44]=0c failed
SCCB_Write [e0]=00 failed
SCCB_Write [ff]=00 failed
SCCB_Write [44]=63 failed
FangJiJun commented 5 years ago

Hello, I have the same problem now,How do you solve this problem?thank you

chegewara commented 5 years ago

I did not. I was not able to run OV2640 with resolution higher than SVGA if i remember, or i got only artifacts.

FangJiJun commented 5 years ago

Are you still trying to do this?can you speak Chinese?

chegewara commented 5 years ago

Sorry i dont speak chinese.

You can try to ask on this repository: https://github.com/espressif/esp-who

esp-eye board also is using ov2640.

FangJiJun commented 5 years ago

The problem that caused may be that RESET in the code corresponds to PWDN of OV2640. I've got the image of UXGA. you can refer to this code , only need to do is modify the pins,and RESET pin set HIGH. https://github.com/m5stack/m5stack-cam-psram

chegewara commented 5 years ago

Thanks, i will check it.

kisel commented 5 years ago

Had the same issue with UXGA mode. This fork worked for me(/jpg & /jpg_stream work fine): https://github.com/tmrttmrt/ESP32_CAMERA_QR/commit/1192823e1751434340717309931a63b1009c3621

jcyfkimi commented 5 years ago

The problem that caused may be that RESET in the code corresponds to PWDN of OV2640. I've got the image of UXGA. you can refer to this code , only need to do is modify the pins,and RESET pin set HIGH. https://github.com/m5stack/m5stack-cam-psram

There's more than pins, the root cause of this issue is that the SRAM is not enough for SXGA/UXGA frame buffers, it's only 520KB SRAM and by calculation, SXGA resolution needs more than 1200KB as frame buffers, the PSRAM must be involved in the project if you want to achieve large resolution pictures, and also you need to consider the read/write speed of the PSRAM.

akshayvernekar commented 5 years ago

@kisel I am getting frame buffer allocation error , what is the SRAM on your esp32 ? EDIT : Apparently the camera module has a 4MB PRAM enabling it solved the issue .

Maoweicao commented 4 years ago

Maybe set Enable malloc on external SPI memory for FreeRTOS to slove this problem,see https://docs.espressif.com/projects/esp-idf/zh_CN/stable/api-reference/system/himem.html and https://github.com/espressif/esp-idf/tree/v3.2.2/examples/system/himem I test to slove it success,but the picture aren't what I want,it look like aren't what I want.Maybe should setting camera config again,OV2640 can work normal. 说起来可以通过启用ESP32使用外置SPI完成malloc功能来解决这个问题,具体看上面那两个链接,我试过之后发现可以正常用,但是照片看起来很怪,是那种彩虹条纹的照片,可能是摄像头时间搞得不对。