rzeldent / esp32cam-rtsp

Simple RTSP (streaming image) server for the ESP32CAM. Easy configuration and monitoring through the web interface.
614 stars 107 forks source link

Exception when requesting snapshot #73

Closed fgolemo closed 1 year ago

fgolemo commented 1 year ago

Heyhey thanks so much for putting this firmware together!

I installed this on my Freenove Esp32-Wrover-Dev board and the wifi hotspot and config interface worked. But as soon as I try to click on the /snapshot link, the board throws an exception and reboots:

11:04:24.367 > entry 0x400805e4
11:04:24.789 > [     4][V][WiFiServer.h:42] WiFiServer(): WiFiServer::WiFiServer(port=80, ...)
11:04:24.795 > [     4][V][WebServer.cpp:87] WebServer(): WebServer::Webserver(port=80)
11:04:24.818 > [    33][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz
11:04:25.267 > [   481][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
11:04:25.291 > [   506][V][[   507][I][main.cpp:400] setup(): CPU Freq: 240 Mhz, 2 core(s)
11:04:25.297 > [   507][I][main.cpp:401] setup(): Free heap: 248568 bytes
11:04:25.302 > [   508][I][main.cpp:402] setup(): SDK version: v4.4.4
11:04:25.308 > [   512][I][main.cpp:403] setup(): Starting ESP32CAM-RTSP...
11:04:25.311 > [   517][V][main.cpp:408] setup(): PSRAM found and initialized
11:04:25.316 > Config version: 1.5
11:04:25.319 > Config size: 455
11:04:25.322 > Loading configurations
11:04:25.322 > [iwcAll]
11:04:25.325 > |-- [iwcSys]
11:04:25.325 > |   |-- 'iwcThingName' with value: 'ESP32CAM1'
11:04:25.330 > |   |-- 'iwcApPassword' with value: <hidden>
11:04:25.333 > |   |-- [iwcWifi0]
11:04:25.336 > |   |   |-- 'iwcWifiSsid' with value: 'Husbando'
11:04:25.338 > |   |   \-- 'iwcWifiPassword' with value: <hidden>
11:04:25.344 > |   \-- 'iwcApTimeout' with value: '30'
11:04:25.347 > |-- [iwcCustom]
11:04:25.350 > |   |-- [board]
11:04:25.350 > |   |   \-- 'bt' with value: 'WROVER KIT'
11:04:25.355 > |   |-- [camera]
11:04:25.355 > |   |   |-- 'fd' with value: '100'
11:04:25.358 > |   |   |-- 'fs' with value: 'VGA (640x480)'
11:04:25.363 > |   |   |-- 'q' with value: '12'
11:04:25.366 > |   |   |-- 'eps' with value: '0'
11:04:25.369 > |   |   |-- 'fb' with value: '1'
11:04:25.372 > |   |   |-- 'b' with value: '0'
11:04:25.375 > |   |   |-- 'c' with value: '0'
11:04:25.377 > |   |   |-- 's' with value: '0'
11:04:25.380 > |   |   |-- 'e' with value: 'Normal'
11:04:25.383 > |   |   |-- 'wb' with value: '1'
11:04:25.386 > |   |   |-- 'awbg' with value: '1'
11:04:25.388 > |   |   |-- 'wbm' with value: 'Auto'
11:04:25.394 > |   |   |-- 'ec' with value: '1'
11:04:25.397 > |   |   |-- 'aec2' with value: '1'
11:04:25.400 > |   |   |-- 'ael' with value: '0'
11:04:25.402 > |   |   |-- 'aecv' with value: '300'
11:04:25.405 > |   |   |-- 'gc' with value: '1'
11:04:25.408 > |   |   |-- 'agcg' with value: '0'
11:04:25.411 > |   |   |-- 'gcl' with value: '2X'
11:04:25.413 > |   |   |-- 'bpc' with value: '0'
11:04:25.419 > |   |   |-- 'wpc' with value: '1'
11:04:25.422 > |   |   |-- 'rg' with value: '1'
11:04:25.425 > |   |   |-- 'lenc' with value: '1'
11:04:25.427 > |   |   |-- 'hm' with value: '0'
11:04:25.430 > |   |   |-- 'vm' with value: '0'
11:04:25.433 > |   |   |-- 'dcw' with value: '1'
11:04:25.436 > |   |   \-- 'cb' with value: '0'
11:04:25.438 > |   \-- [io]
11:04:25.441 > |       \-- 'li' with value: '0'
11:04:25.444 > \-- [hidden]
11:04:25.444 > [   656][V][main.cpp:286] initialize_camera(): initialize_camera
11:04:25.450 > [   656][I][main.cpp:287] initialize_camera(): Camera config: WROVER KIT
11:04:25.455 > [   662][I][main.cpp:293] initialize_camera(): Frame size: VGA (640x480)
11:04:25.463 > [   668][I][main.cpp:295] initialize_camera(): JPEG quality: 12
11:04:25.469 > [   674][I][main.cpp:296] initialize_camera(): Frame duration: 100 ms
11:04:25.475 > [   680][I][main.cpp:300] initialize_camera(): Enable PSRAM: 0
11:04:25.480 > [   685][I][main.cpp:301] initialize_camera(): Frame buffers: 1
11:04:25.486 > [   691][I][main.cpp:312] initialize_camera(): PSRAM disabled
11:04:25.691 > [   906][V][esp32-hal-ledc.c:231] analogWrite(): GPIO 4 - Using Channel 15, Value = 0
11:04:25.696 > State changing from: 0 to 2
11:04:25.710 > [   925][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 0 - WIFI_READY
11:04:25.803 > Setting up AP: ESP32CAM1
11:04:25.803 > Use password: <hidden>
11:04:25.805 > [  1018][V][WiFiGeneric.cpp:392] _arduino_event_cb(): AP Started
11:04:25.811 > [  1019][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 10 - AP_START
11:04:26.371 > AP IP address: 192.168.4.1
11:04:26.371 > [  1588][V][WiFiGeneric.cpp:395] _arduino_event_cb(): AP Stopped
11:04:26.377 > [  1589][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 11 - AP_STOP
11:04:26.385 > [  1589][V][WiFiGeneric.cpp:392] _arduino_event_cb(): AP Started
11:04:26.391 > [  1596][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 10 - AP_START
11:04:26.399 > AP timeout (ms): 30000
11:04:26.399 > State changed from: 0 to 2
11:04:56.393 > State changing from: 2 to 3
11:04:56.404 > [ 31618][V][WiFiGeneric.cpp:395] _arduino_event_cb(): AP Stopped
11:04:56.409 > [ 31618][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 11 - AP_STOP
11:04:56.415 > [ 31622][V][WiFiGeneric.cpp:392] _arduino_event_cb(): AP Started
11:04:56.420 > E (45610) wifi_init_default: esp_wifi_get_mac failed with 12289
11:04:56.426 > Connecting to [Husbando[ 31631][V][WiFiGeneric.cpp:395] _arduino_event_cb(): AP Stopped
11:04:56.434 > [ 31626][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 10 - AP_START
11:04:56.443 > [ 31646][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 11 - AP_STOP
11:04:56.448 > ] (password is hidden)
11:04:56.451 > WiFi timeout (ms): 30000
11:04:56.465 > [ 31679][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 0 - WIFI_READY
11:04:56.471 > [ 31686][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW: 0.0.0.0
11:04:56.482 > [ 31684][V][WiFiGeneric.cpp:340] _arduino_event_cb(): STA Started
11:04:56.487 > [ 31692][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 2 - STA_START
11:04:56.495 > State changed from: 2 to 3
11:04:56.558 > [ 31772][V][WiFiGeneric.cpp:355] _arduino_event_cb(): STA Connected: SSID: Husbando, BSSID: d8:07:b6:a8:f3:a7, Channel: 10, Auth: WPA2_PSK
11:04:56.569 > [ 31773][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 4 - STA_CONNECTED
11:04:56.593 > [ 31807][V][WiFiGeneric.cpp:369] _arduino_event_cb(): STA Got New IP:192.168.0.60
11:04:56.599 > [ 31808][D][WiFiGeneric.cpp:1035] _eventCallback(): Arduino Event: 7 - STA_GOT_IP
11:04:56.607 > [ 31811][D][WiFiGeneric.cpp:1098] _eventCallback(): STA IP: 192.168.0.60, MASK: 255.255.255.0, GW: 192.168.0.1
11:04:56.615 > WiFi connected
11:04:56.618 > IP address: 192.168.0.60
11:04:56.623 > State changing from: 3 to 4
11:04:59.719 > Active mDNS services: 8 
11:04:59.719 > Accepting connection
11:04:59.722 > [ 34935][V][main.cpp:362] on_connected(): on_connected
11:04:59.733 > [ 34947][I][ArduinoOTA.cpp:141] begin(): OTA server at: esp32-70b8f6970048.local:3232
11:04:59.738 > [ 34947][V][main.cpp:353] start_rtsp_server(): start_rtsp_server
11:04:59.744 > [ 34949][V][WiFiServer.h:42] WiFiServer(): WiFiServer::WiFiServer(port=554, ...)
11:04:59.752 > [ 34956][I][rtsp_server.cpp:9] rtsp_server(): Starting RTSP server
11:04:59.758 > State changed from: 3 to 4
11:06:16.945 > Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
11:06:16.951 > 
11:06:16.951 > Core  1 register dump:
11:06:16.953 > PC      : 0x400e644f  PS      : 0x00060930  A0      : 0x801660a4  A1      : 0x3ffb2160  
11:06:16.962 > A2      : 0x00000000  A3      : 0x3ffe35d4  A4      : 0x00000000  A5      : 0x00000008  
11:06:16.970 > A6      : 0x00000000  A7      : 0x3ffc71d8  A8      : 0x800e644c  A9      : 0x3ffb2140  
11:06:16.976 > A10     : 0x3fff37ec  A11     : 0x3fff3fe0  A12     : 0x0000180c  A13     : 0x00000001  
11:06:16.984 > A14     : 0x00000004  A15     : 0x3ffb65c4  SAR     : 0x00000016  EXCCAUSE: 0x0000001c  
11:06:16.992 > EXCVADDR: 0x00000008  LBEG    : 0x4008b2fc  LEND    : 0x4008b312  LCOUNT  : 0xffffffff  
11:06:17.001 > 
11:06:17.001 > 
11:06:17.001 > Backtrace: 0x400e644c:0x3ffb2160 0x401660a1:0x3ffb2180 0x400e78ae:0x3ffb21a0 0x400e7a07:0x3ffb21e0 0x400e762d:0x3ffb2230 0x400e7668:0x3ffb2250 0x400d6e0e:0x3ffb2270 0x400eafad:0x3ffb2290
11:06:17.017 > 
11:06:17.017 > 
11:06:17.017 > 
11:06:17.017 > 
11:06:17.017 > ELF file SHA256: 05229580823fb274
11:06:17.021 > 
11:06:17.217 > Rebooting...
11:06:17.218 > ets Jul 29 2019 12:21:46
11:06:17.220 > 
11:06:17.220 > rst:0xc (SW_CPU_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
11:06:17.225 > configsip: 0, SPIWP:0xee
11:06:17.225 > clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
11:06:17.234 > mode:DIO, clock div:2
11:06:17.234 > load:0x3fff0030,len:1184
11:06:17.237 > load:0x40078000,len:13192
11:06:17.239 > load:0x40080400,len:3028
11:06:17.244 > entry 0x400805e4

Any idea what this could be? I've tried multiple settings including turning off PSRAM, setting the resolution to 640x480 and buffer to 1 but this still happens.

EDIT: the same thing happens when I try to open the RTSP stream in VLC.

rzeldent commented 1 year ago

Hi Florian,

I think something goes wrong when the camera is initialized/used. Have to configured the right board? To dig deeper into the logs, could you add the exception decoder to find out where exactly it fails?

monitor_filters = esp32_exception_decoder

This will decode the crash stack

https://community.platformio.org/t/how-do-i-use-esp32-exception-decoder/22789