rzeldent / esp32cam-ready

Plug and Play firmware for the esp32cam. Connect with RTSP (for example VLC). Easy installation: Flash, provision and connect!
145 stars 24 forks source link

Failed to get the frame on time #14

Closed JeffWDH closed 2 years ago

JeffWDH commented 2 years ago

Describe the bug When clicking "Single Frame" from the web interface the serial console reports "Failed to get the frame on time" and ESP32 crashes.

I have two seemingly identical ESP32CAMs, this code works on one but not the other. I've tried swapping the OV2640 with the working model and have the same results (remains working on the other one).

To Reproduce Steps to reproduce the behavior:

  1. Flash latest code from the repo to the ESP32CAM.
  2. Click "Single Frame"
  3. ESP32CAM crashes

Expected behavior Web interface should return a jpg snapshot.

Screenshots See terminal output below.

Desktop (please complete the following information):

Additional context

`` 8:58:33.605 > [I][espcam_webserver.cpp:23] begin(): Starting web server 08:59:35.836 > [I][espcam_webserver.cpp:102] handle_jpg(): handle_jpg 08:59:39.873 > [E][camera.c:1483] esp_camera_fb_get(): Failed to get the frame on time! 08:59:43.878 > [E][camera.c:1483] esp_camera_fb_get(): Failed to get the frame on time! 08:59:43.884 > Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled. 08:59:43.889 > Core 1 register dump: 08:59:43.892 > PC : 0x400d4e6b PS : 0x00060130 A0 : 0x800d1bbe A1 : 0x3ffb1de0
08:59:43.900 > A2 : 0x00000000 A3 : 0x3ffe5b68 A4 : 0x0000000b A5 : 0x3ffbddc0
08:59:43.910 > A6 : 0x3ffc324c A7 : 0x00000000 A8 : 0x800d4e68 A9 : 0x3ffb1dc0
08:59:43.917 > A10 : 0x3ffc301c A11 : 0x3ffe5b68 A12 : 0x00000060 A13 : 0x00000000
08:59:43.922 > A14 : 0x00ff0000 A15 : 0xff000000 SAR : 0x00000004 EXCCAUSE: 0x0000001c
08:59:43.931 > EXCVADDR: 0x00000000 LBEG : 0x4008e46d LEND : 0x4008e47d LCOUNT : 0xfffffffb
08:59:43.939 > 08:59:43.939 > ELF file SHA256: 0000000000000000 08:59:43.942 > 08:59:43.942 > Backtrace: 0x400d4e6b:0x3ffb1de0 0x400d1bbb:0x3ffb1e00 0x40161fc2:0x3ffb1e60 0x400d5d0a:0x3ffb1e80 0x400d5db9:0x3ffb1ea0 0x400d5e36:0x3ffb1ed0 0x400d5fda:0x3ffb1f20 0x400d2133:0x3ffb1f70 0x400d21e2:0x3ffb1f90 0x400db905:0x3ffb1fb0 0x40091056:0x3ffb1fd0 08:59:43.964 > 08:59:43.964 > Rebooting... 08:59:43.967 > ets Jun 8 2016 00:22:57 08:59:43.970 > 08:59:43.970 > rst:0xc (SW_CPU_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT) 08:59:43.973 > configsip: 0, SPIWP:0xee 08:59:43.976 > clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 08:59:43.981 > mode:DIO, clock div:1 08:59:43.984 > load:0x3fff0018,len:4 08:59:43.987 > load:0x3fff001c,len:1044 08:59:43.989 > load:0x40078000,len:10124 08:59:43.992 > load:0x40080400,len:5856 08:59:43.992 > entry 0x400806a8 08:59:45.189 > [I][main.cpp:38] setup(): CPU Freq = 240 Mhz 08:59:45.192 > [I][main.cpp:39] setup(): Starting ESP32Cam... 08:59:45.195 > [I][main.cpp:44] setup(): Initialize the camera 08:59:45.743 > [I][main.cpp:49] setup(): Instance_name: esp32cam-omitted 08:59:45.748 > [I][main.cpp:51] setup(): Connecting... 08:59:45.751 > I (1439) wifi:wifi driver task: 3ffbbcd4, prio:23, stack:3584, core=0 08:59:45.774 > I (3042) wifi:wifi firmware version: dc30037 08:59:45.775 > I (3043) wifi:config NVS flash: enabled 08:59:45.778 > I (3043) wifi:config nano formating: disabled 08:59:45.783 > I (3044) wifi:Init data frame dynamic rx buffer num: 32 08:59:45.786 > I (3049) wifi:Init management frame dynamic rx buffer num: 32 08:59:45.792 > I (3054) wifi:Init management short buffer num: 32 08:59:45.797 > I (3059) wifi:Init dynamic tx buffer num: 32 08:59:45.803 > I (3063) wifi:Init static rx buffer size: 1600 08:59:45.805 > I (3067) wifi:Init static rx buffer num: 16 08:59:45.808 > I (3071) wifi:Init dynamic rx buffer num: 32 08:59:45.900 > I (3170) wifi:mode : sta (omitted) 08:59:45.904 > [I][wifi_provisioning.cpp:17] connect(): Connecting 29 seconds left... 08:59:46.905 > [I][wifi_provisioning.cpp:17] connect(): Connecting 28 seconds left... 08:59:47.905 > [I][wifi_provisioning.cpp:17] connect(): Connecting 27 seconds left... 08:59:47.956 > I (5226) wifi:new:<11,0>, old:<1,0>, ap:<255,255>, sta:<11,0>, prof:1 08:59:47.961 > I (5227) wifi:state: init -> auth (b0) 08:59:48.004 > I (5274) wifi:state: auth -> assoc (0) 08:59:48.023 > I (5293) wifi:state: assoc -> run (10) 08:59:48.087 > I (5357) wifi:connected with omitted, aid = 10, channel 11, BW20, bssid = omitted 08:59:48.096 > I (5358) wifi:security type: 3, phy: bgn, rssi: -63 08:59:48.099 > I (5367) wifi:pm start, type: 1 08:59:48.103 > 08:59:48.146 > I (5416) wifi:AP's beacon interval = 102400 us, DTIM period = 1 08:59:48.905 > [I][wifi_provisioning.cpp:22] connect(): Connection result: 3 08:59:48.908 > [I][main.cpp:66] setup(): Connected! IP address: omitted 08:59:48.913 > [I][main.cpp:68] setup(): Starting servers... 08:59:48.919 > [I][espcam_webserver.cpp:20] begin(): Starting rtsp_server 08:59:48.925 > [I][rtsp_server.cpp:21] begin(): Starting RTSP server 08:59:48.927 > [E][ESPmDNS.cpp:148] addService(): Failed adding service rtsp.tcp. 08:59:48.936 > 08:59:48.936 > [I][espcam_webserver.cpp:23] begin(): Starting web server

rzeldent commented 2 years ago

Hi Jeff,

I think it is due to some hardware differences or defective hardare.

I see there is quite some time between the frames: 4 seconds. This is not normal and seems to be blocking: 08:59:39.873 > [E][camera.c:1483] esp_camera_fb_get(): Failed to get the frame on time! 08:59:43.878 > [E][camera.c:1483] esp_camera_fb_get(): Failed to get the frame on time!

What you could do is swap the camera's to see if if is caused by the board but more likely the the camera module. However you swapped them already. Then it should be the board. Maybe a power supply issue? Do you have the same problem when using RTSP?

Kind regards,

Rene

JeffWDH commented 2 years ago

Hello,

I have the same problem regardless of taking a snapshot or via rtsp. I have swapped the power supply and camera module with known working ones so it is looking like an issue on the ESP32 board itself... I used the exact same code on both but this one just doesn't work

If you don't have any ideas I guess I'll have to write this one off as not working

rzeldent commented 2 years ago

Hi Jeff,

No, no real ideas what could be the issue besides the esp32 board. You could try the stock EspressIf software or decrease the framerate in the source code, maybe the last helps for stability...

JeffWDH commented 2 years ago

Either way it doesn't look like an issue with your code so I'll close this issue. Thank you for your assistance with this.

rzeldent commented 2 years ago

You're welcome!