ESP32-CAM sends corrupted picture

dima0905
Posts: 5
Joined: Mon Jan 20, 2020 8:48 pm

ESP32-CAM sends corrupted picture

Postby dima0905 » Wed Apr 15, 2020 3:03 pm

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 10535 times
What is the cause of this? What is the reason? Does it bug of camera?

XCLK 20Mhz. no divided on PLL resl 640x480

simonliu009
Posts: 6
Joined: Mon May 20, 2019 1:12 am

Re: ESP32-CAM sends corrupted picture

Postby simonliu009 » Sun Apr 19, 2020 10:27 am

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 10424 times
20200417155641.jpg
20200417155641.jpg (430.47 KiB) Viewed 10424 times
20200418132853.jpg
20200418132853.jpg (404.69 KiB) Viewed 10424 times

dima0905
Posts: 5
Joined: Mon Jan 20, 2020 8:48 pm

Re: ESP32-CAM sends corrupted picture

Postby dima0905 » Sun Apr 19, 2020 11:59 am

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.

dima0905
Posts: 5
Joined: Mon Jan 20, 2020 8:48 pm

Re: ESP32-CAM sends corrupted picture

Postby dima0905 » Wed Jul 01, 2020 3:32 pm

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.

barsoom
Posts: 1
Joined: Mon Aug 03, 2020 5:42 pm

Re: ESP32-CAM sends corrupted picture

Postby barsoom » Mon Aug 03, 2020 5:47 pm

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.

Fiskelin
Posts: 10
Joined: Wed Oct 03, 2018 7:09 am

Re: ESP32-CAM sends corrupted picture

Postby Fiskelin » Thu Oct 08, 2020 6:52 am

I have also got corrupted jpeg for ov2640 camera. Can anyone help in this issue? Attached is the corrupted jpeg
Attachments
corruptedPhoto.jpg
corruptedPhoto.jpg (525.17 KiB) Viewed 8033 times

Who is online

Users browsing this forum: No registered users and 31 guests