remibert / pycameresp

Motion detection with image notification for Esp32CAM and Esp32 flasher with GUI based on esptool.py.
Other
71 stars 20 forks source link

ESP32-CAM keep rebooting using V15 firmware. #6

Closed magixyu closed 1 year ago

magixyu commented 1 year ago

Sorry to bother you. I used the latest version of the V15 firmware for my ESP32-CAM, then it keeps rebooting:

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:4540
ho 0 tail 12 room 4
load:0x40078000,len:12788
load:0x40080400,len:4176
entry 0x40080680
Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x40095257  PS      : 0x00060930  A0      : 0x800d8d73  A1      : 0x3ffd7320  
A2      : 0x00000000  A3      : 0x00000000  A4      : 0x0000bb9b  A5      : 0x00000000  
A6      : 0x3ffd732c  A7      : 0x00000bb9  A8      : 0x800d839c  A9      : 0x3ffd72f0  
A10     : 0x3ffc5338  A11     : 0x3ffba104  A12     : 0x00000003  A13     : 0x00000008  
A14     : 0x00000000  A15     : 0x4009efe0  SAR     : 0x0000001d  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00000000  LBEG    : 0x4009525e  LEND    : 0x40095269  LCOUNT  : 0x00000000  

Backtrace:0x40095254:0x3ffd7320 0x400d8d70:0x3ffd7330 0x400d5402:0x3ffd7350

ELF file SHA256: a3e309c0229d34e1

Rebooting...
ets Jul 29 2019 12:21:461

my ESP32 info:

esptool.exe --chip esp32 chip_id
esptool.py v4.5
Found 3 serial ports
Serial port COM5
Connecting.....
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: c0:49:ef:f0:f3:e8
Uploading stub...
Running stub...
Stub running...
Warning: ESP32 has no Chip ID. Reading MAC instead.
MAC: c0:49:ef:f0:f3:e8
Hard resetting via RTS pin...
remibert commented 1 year ago

Hello,

I do not detect any problem with the V15 on the esp32cam that I own. Can try flashing with CamFlasher following these values (with erase flash also). Try with a more powerful power supply. 

Le 2 mars 2023 à 14:10, Tristan Yu @.***> a écrit :

Sorry to bother you. I used the latest version of the V15 firmware for my ESP32-CAM, then it keeps rebooting:

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:4540 ho 0 tail 12 room 4 load:0x40078000,len:12788 load:0x40080400,len:4176 entry 0x40080680 Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.

Core 1 register dump: PC : 0x40095257 PS : 0x00060930 A0 : 0x800d8d73 A1 : 0x3ffd7320
A2 : 0x00000000 A3 : 0x00000000 A4 : 0x0000bb9b A5 : 0x00000000
A6 : 0x3ffd732c A7 : 0x00000bb9 A8 : 0x800d839c A9 : 0x3ffd72f0
A10 : 0x3ffc5338 A11 : 0x3ffba104 A12 : 0x00000003 A13 : 0x00000008
A14 : 0x00000000 A15 : 0x4009efe0 SAR : 0x0000001d EXCCAUSE: 0x0000001d
EXCVADDR: 0x00000000 LBEG : 0x4009525e LEND : 0x40095269 LCOUNT : 0x00000000

Backtrace:0x40095254:0x3ffd7320 0x400d8d70:0x3ffd7330 0x400d5402:0x3ffd7350

ELF file SHA256: a3e309c0229d34e1

Rebooting... ets Jul 29 2019 12:21:461 my ESP32 info:

esptool.exe --chip esp32 chip_id esptool.py v4.5 Found 3 serial ports Serial port COM5 Connecting..... Chip is ESP32-D0WD-V3 (revision v3.0) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz MAC: c0:49:ef:f0:f3:e8 Uploading stub... Running stub... Stub running... Warning: ESP32 has no Chip ID. Reading MAC instead. MAC: c0:49:ef:f0:f3:e8 Hard resetting via RTS pin... — Reply to this email directly, view it on GitHub https://github.com/remibert/pycameresp/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP3HE2BZVWALAUC7QMAF3RTW2CL2ZANCNFSM6AAAAAAVNLQ2EA. You are receiving this because you are subscribed to this thread.

magixyu commented 1 year ago

I used the CamFlasher which is from this repository: image image

The result is the same.

magixyu commented 1 year ago

Have another try, the firmware GENERIC_SPIRAM-firmware.bin works for me. not sure why...

magixyu commented 1 year ago

image image

remibert commented 1 year ago

Hello,when does the crash occur? (which trace are displayed at startup). if there is a power failure, when opening the camera or the wifi, it can reboot.Does v14 work ?CordialementRémiLe 3 mars 2023 à 06:46, Tristan Yu @.***> a écrit :

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

magixyu commented 1 year ago

V14 doesn't work either. When install the ESP32CAM firmware(V14 and V15), it will be in reboot loop. I also tried the GENERIC_SPIRAM-firmware.bin, I can enter the REPL, but looks the camera doesn't work. I installed the original(factory) firmware with Arduino, it works fine. So the issue should not be the board.

magixyu commented 1 year ago

Is this the root cause? Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.

remibert commented 1 year ago

If the V14 does not work better it is that there is a hardware difference compared to my ESP32CAM (On the V15 I had gone back to a very old version of idf to correct an access point problem with the camera).

The crash "seems" to be at the very beginning (and on a null pointer see EXCVADDR), I suspect a mismatch in spram size on your esp32CAM.

The difference between the GENERIC_SPIRAM and ESP32CAM firmware is in the way of allocating ram :

If they have mounted 2mb RAM on the ESP32CAM, it should then produce a crash. Afterwards if this is the case, it will be necessary to do some tests to allocate a sufficient quantity to the camera.

Could you tell me when you load a GENERIC_SPIRAM, how much ram is displayed at boot? And send me the line that contains "Memory: allocated=xxxK free=xxxM total=xxxM used=xxx%", if you see less than 3.91MB is the root of problem.

Can you give me the link where you bought your esp32cam?

Le 3 mars 2023 à 15:44, Tristan Yu @.***> a écrit :

Is this the root cause? Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled.

— Reply to this email directly, view it on GitHub https://github.com/remibert/pycameresp/issues/6#issuecomment-1453635174, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP3HE2H7BCBN4LFBUZJAMKTW2H7UNANCNFSM6AAAAAAVNLQ2EA. You are receiving this because you commented.

magixyu commented 1 year ago
esptool.exe --chip esp32 flash_id
esptool.py v4.5
Found 3 serial ports
Serial port COM6
Connecting....
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: c0:49:ef:f0:f3:e8
Uploading stub...
Running stub...
Stub running...
Manufacturer: c8
Device: 4016
Detected flash size: 4MB
Hard resetting via RTS pin...
Memory : allocated=51.28K free=1.90M total=1.95M used=2.56%

Looks the data is mismatch. esptools shows the memory is 4MB but looks the firmware show it is 2M(1.95).

what's the problem with this chip?

Thanks for your time on helping this. Very appericate.

Tristan

magixyu commented 1 year ago

using espressif dwonloader, it shows 4M: image

magixyu commented 1 year ago

I tried the micropython_camera_feeeb5ea3_esp32_idf4_4.bin from https://github.com/lemariva/micropython-camera-driver. It works and I got the following to compare:

MicroPython v1.18-74-gfeeeb5ea3 on 2022-02-02; ESP32-cam module (i2s) with ESP32

Type "help()" for more information.

>>> ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:4344
load:0x40078000,len:13816
load:0x40080400,len:3340
entry 0x40080618
MicroPython v1.18-74-gfeeeb5ea3 on 2022-02-02; ESP32-cam module (i2s) with ESP32
Type "help()" for more information.
>>> import esp
>>> esp.flash_size()
4194304
>>> import gc
>>> gc.mem_alloc()
8384
>>> gc.mem_free()
1174368
>>> gc.mem_free()
remibert commented 1 year ago

Hello, could you try this firmware attached (please check erase flash before). I think it solve problem. 

Le 4 mars 2023 à 01:27, Tristan Yu @.***> a écrit :

esptool.exe --chip esp32 flash_id esptool.py v4.5 Found 3 serial ports Serial port COM6 Connecting.... Chip is ESP32-D0WD-V3 (revision v3.0) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz MAC: c0:49:ef:f0:f3:e8 Uploading stub... Running stub... Stub running... Manufacturer: c8 Device: 4016 Detected flash size: 4MB Hard resetting via RTS pin... Memory : allocated=51.28K free=1.90M total=1.95M used=2.56% Looks the data is mismatch. esptools shows the memory is 4MB but looks the firmware show it is 2M(1.95).

what's the problem with this chip?

Thanks for your time on helping this. Very appericate.

Tristan

— Reply to this email directly, view it on GitHub https://github.com/remibert/pycameresp/issues/6#issuecomment-1454297310, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP3HE2FDMXT4THO3QB2JEWDW2KEAXANCNFSM6AAAAAAVNLQ2EA. You are receiving this because you commented.

magixyu commented 1 year ago

@remibert I cannot download the attachment. Can you pls send me via email: tristan.yu@outlook.com?

Thank you.

remibert commented 1 year ago

Hello,

Sorry for the delay, I was not at home this afternoon, I deliver a patch version :

"https://github.com/remibert/pycameresp/releases/download/V15/ESP32CAM-firmware_V15.1.bin"

Le 4 mars 2023 à 12:48, Tristan Yu @.***> a écrit :

@remibert https://github.com/remibert I cannot download the attachment. Can you pls send me via email: @. @.>?

Thank you.

— Reply to this email directly, view it on GitHub https://github.com/remibert/pycameresp/issues/6#issuecomment-1454712108, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP3HE2HWGTAFX57BMX5D4IDW2MT2NANCNFSM6AAAAAAVNLQ2EA. You are receiving this because you were mentioned.

magixyu commented 1 year ago

Hi the new one works. One file bootstrap.bundle.min.js is missing in the www directory.

Thank you very much for your prompt support!

Tristan

remibert commented 1 year ago

This file is automatically extracted from the rom during the first boot after an erase flash. This is the last file extracted, and it take time to uncompress. If you reset a little quickly, it did not have time to copy itself.

Then the access point starts, and you can connect using the password displayed in the console. You can then configure everything from the web interface.

After you can extend the operation by writing your own script (you must use micropython asynchronous tasks), or not using the set of modules embedded in the firmware, although that's a shame, because it makes life easier (wifi manager, telnet, the shell and the embedded editor, web server, time synchro,... are a real plus).

Le 5 mars 2023 à 06:47, Tristan Yu @.***> a écrit :

Hi the new one works. One file bootstrap.bundle.min.js is missing in the www directory.

Thank you very much for your prompt support!

Tristan

— Reply to this email directly, view it on GitHub https://github.com/remibert/pycameresp/issues/6#issuecomment-1454997316, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP3HE2B35JG7VF2ZORPCLEDW2QSGJANCNFSM6AAAAAAVNLQ2EA. You are receiving this because you were mentioned.

magixyu commented 1 year ago

I did refresh the firmware again and it works as you said. Thanks again for your help.

Tristan

magixyu commented 1 year ago

Would you please share me what's the problem?

remibert commented 1 year ago

Hello,

The problem was on a memory size initialization for micropython, only on an esp32cam firmware.

All my esp32cams have 4mb of spram, yours has only 2mb of spram (the value returned by esptool is the flash size not spram size).

I pushed the correction.

Le 5 mars 2023 à 16:24, Tristan Yu @.***> a écrit :

Would you please share me what's the problem?

— Reply to this email directly, view it on GitHub https://github.com/remibert/pycameresp/issues/6#issuecomment-1455121826, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP3HE2DWWJAUPOSB4GU2JP3W2SV3LANCNFSM6AAAAAAVNLQ2EA. You are receiving this because you were mentioned.

magixyu commented 1 year ago

Ok, How to check the spram in the chip without booting log? I am going to close the ticket.

remibert commented 1 year ago

Hello,With the function esp_spiram_get_chip_size(). CordialementRémiLe 6 mars 2023 à 01:49, Tristan Yu @.***> a écrit : Ok, How to check the spram in the chip without booting log? I am going to close the ticket.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

magixyu commented 1 year ago

Thank you, remibert!