Page 1 of 1

ESP32-CAM sends corrupted picture

Posted: Wed Apr 15, 2020 3:03 pm
by dima0905
I installed subj with ov2640 for watching but sometimes I obtain corrupted in such way picture (loss horiz sync?)
133ea1936fe4f22bdc0ca448f0502e2333005.jpg
133ea1936fe4f22bdc0ca448f0502e2333005.jpg (13.76 KiB) Viewed 10590 times
What is the cause of this? What is the reason? Does it bug of camera?

XCLK 20Mhz. no divided on PLL resl 640x480

Re: ESP32-CAM sends corrupted picture

Posted: Sun Apr 19, 2020 10:27 am
by simonliu009
I'm having the same issue. I think it is because the SPI RAM speed is not fast enough?
My setting:

Code: Select all

    
   .frame_size = FRAMESIZE_UXGA,   //QQVGA-UXGA Do not use sizes above QVGA when not JPEG
    .jpeg_quality = 3,
resolution is 1600x1200.
When I use a lower resolution with low quality without allocating frame buffer from SPI RAM, the image seems fine. Or at least the chances of getting corrupted images are much less.(Haven't tested it for long time yet.)
I took over 60,000 photos with ESP32-CAM (not Ai-thinker version, but a copy), around 1% of them are corrupted.
20200417154540.jpg
20200417154540.jpg (403.13 KiB) Viewed 10479 times
20200417155641.jpg
20200417155641.jpg (430.47 KiB) Viewed 10479 times
20200418132853.jpg
20200418132853.jpg (404.69 KiB) Viewed 10479 times

Re: ESP32-CAM sends corrupted picture

Posted: Sun Apr 19, 2020 11:59 am
by dima0905
I suspect that LEDC which feeds XCLK and I2C use the various timers and it can cause synchronization issues. I've been playing with the ov2640 registers and noticed that as less errors as higher PCLK. Now I check structure of obtained JPEG and skip corrupted. It allows avoiding 80% spoiled pictures.

Re: ESP32-CAM sends corrupted picture

Posted: Wed Jul 01, 2020 3:32 pm
by dima0905
It was solved by a very strange way. I just added the call of ESP_ERROR_CHECK(esp_wifi_set_ps(WIFI_PS_NONE)); after ESP_ERROR_CHECK( esp_wifi_start() );
No one corrupted picture hasn't appeared since while.

Re: ESP32-CAM sends corrupted picture

Posted: Mon Aug 03, 2020 5:47 pm
by barsoom
I am completelly new on ESP32. I used the example of the esp32-cam, and i have all the images corrupted when using the higher resolution. In the better case, the upper half of the image is correct, but the lower if black or other color.
I readed your solution what, may be could help me as well, but o do not know where you added the call "ESP_ERROR_CHECK(esp_wifi_set_ps(WIFI_PS_NONE));"
I do not found the "ESP_ERROR_CHECK( esp_wifi_start() );" in the sketch. Is it in a library? Where should i apply your solution?
Thanks in advance.

Re: ESP32-CAM sends corrupted picture

Posted: Thu Oct 08, 2020 6:52 am
by Fiskelin
I have also got corrupted jpeg for ov2640 camera. Can anyone help in this issue? Attached is the corrupted jpeg