Notifications
Clear all

Running CameraWebServer on Elegoo esp32 with camera fails, returns error

Page 1 / 3

Leonardo1123
(@leonardo1123)
Trusted Member
Joined: 1 year ago
Posts: 56
Topic starter  

Hey there!

I purchased this kit (link contains download to code), and I'm trying to recode it from scratch, so I can better learn exactly how it's all working, and customize the software more extensively. 

I figured I'd start by trying to run CameraWebServer from the esp32 examples to simply establish a connection with the main communication board, and work out from there. 

However, I was unable to run CameraWebServer, and I'm not quite sure why...

I selected the board and defined it in the code according to what I found in the source code (linked above), so I'm confident that I have the board:

#define CAMERA_MODEL_M5STACK_WIDE // Has PSRAM

I'm not sure what else I might need to configure or understand to get this example working. Here's the error I'm getting:

rst:0x1 (POWERON_RESET),boot:0x36 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv0x00
mode:DIO, clock div:1
load1324
ho 0 tail 12 room 4
load13508
load3604
entry 0x400805f0

E (148) cam_hal: cam_dma_config(280): frame buffer malloc failed
E (148) cam_hal: cam_config(364): cam_dma_config failed
E (149) camera: Camera config failed with error 0xffffffff
Camera init failed with error 0xffffffff

Tl;dr: I've got some Elegoo version of an esp32 with a cam, and I'm trying to run a basic web server example, but I'm getting errors I don't understand. 

 

Fortune Favors the Bold


Quote
Topic Tags
Leonardo1123
(@leonardo1123)
Trusted Member
Joined: 1 year ago
Posts: 56
Topic starter  

Update: I'm now trying to run a simpler sketch, Simple Time, and that worked. So that leads me to believe it is a problem with interacting with the camera component of the esp32. 

I know the camera works because I have used it before. However, after beginning to create my own code, I can no longer easily revert to the factory settings to reconfirm the camera is functioning. 

Fortune Favors the Bold


ReplyQuote
Ron
 Ron
(@zander)
Noble Member
Joined: 2 years ago
Posts: 2262
 

@leonardo1123 My first impression and educated guess is the board you are using has NO ram that can be used by the malloc(), that is the first error. I use ESP32-CAM boards for my cameras, works first time every time but as you probably know a bit of a pain to use due to the 2-sided design. Amazon recently came to the rescue with the following board.

"https://www.amazon.ca/gp/product/B09M83D2NX/ref=ppx_yo_dt_b_asin_title_o06_s00?ie=UTF8&psc=1"

Change the amazon.ca to whatever your country amazon domain name is.

 

It is considered poor judgement to traverse a chasm in 2 leaps.


ReplyQuote
Will
 Will
(@will)
Noble Member
Joined: 12 months ago
Posts: 1780
 

@leonardo1123 

Just a wild assed guess, but try providing a better power supply. It may just be browning out when it tries to allocate the frame buffer.

I was kidnapped by mimes.
They did unspeakable things to me.


ReplyQuote
Leonardo1123
(@leonardo1123)
Trusted Member
Joined: 1 year ago
Posts: 56
Topic starter  

@zander Gotcha, thanks! I'm planning on picking up one or two of those very soon. In the meantime, is there a different board I can select from the list, or any options I can tweak to make what I have do what I want it to?

Fortune Favors the Bold


ReplyQuote
Ron
 Ron
(@zander)
Noble Member
Joined: 2 years ago
Posts: 2262
 

@leonardo1123 Yes, camera component as in 'frame_buffer' and malloc is the standard C function to alloc a piece of memory. If there is NO or not enough ram, the malloc will fail and the camera has no place to store the image.

It is considered poor judgement to traverse a chasm in 2 leaps.


ReplyQuote
Leonardo1123
(@leonardo1123)
Trusted Member
Joined: 1 year ago
Posts: 56
Topic starter  

@will Gotcha! Yeah, right now I'm just powering it from my laptop. Unfortunately, I don't have a great way of supplying better power without unplugging it from my laptop, and then I'll lose the serial information like the IP of the webpage. 

Maybe I'll try Bluetooth serial...

Fortune Favors the Bold


ReplyQuote
Leonardo1123
(@leonardo1123)
Trusted Member
Joined: 1 year ago
Posts: 56
Topic starter  

Update: My exact esp32 is ESP32-D0WDQ6 Rev 1

 

Fortune Favors the Bold


ReplyQuote
Ron
 Ron
(@zander)
Noble Member
Joined: 2 years ago
Posts: 2262
 

@leonardo1123 I have only used the AI-Thinker brand of ESP32-CAM boards.

It is considered poor judgement to traverse a chasm in 2 leaps.


ReplyQuote
Ron
 Ron
(@zander)
Noble Member
Joined: 2 years ago
Posts: 2262
 

@leonardo1123 Sorry, never heard of it.

It is considered poor judgement to traverse a chasm in 2 leaps.


ReplyQuote
Ron
 Ron
(@zander)
Noble Member
Joined: 2 years ago
Posts: 2262
 

@leonardo1123 Write down the IP, it is extremely unlikely to change. Also run an ipscanner if in doubt. I test with a 9V battery and one of those breadboard power supplies like this

"https://www.amazon.ca/gp/product/B07L84QZTY/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1"

change the domain to whatever your country is.

 

It is considered poor judgement to traverse a chasm in 2 leaps.


ReplyQuote
Leonardo1123
(@leonardo1123)
Trusted Member
Joined: 1 year ago
Posts: 56
Topic starter  

@zander Okay, so I've gotten SimpleTime and SimpleServer to work. With any luck, I can start poking around with the communication between the arduino and the esp32, and then come back to the camera part of the esp when my new esps arrive (that you suggested!).

Sooooo.... gonna leave this unsolved in case I randomly figure this out, but I'm going to stop actively pursuing the solution. Thanks for your help!

Fortune Favors the Bold


ReplyQuote
Ron
 Ron
(@zander)
Noble Member
Joined: 2 years ago
Posts: 2262
 

@leonardo1123 I don't see that model in my defines. My actual code snap is attached. Also notr I have added WiFiMgr so I no longer need the IP. If you want that , there is another small code snippet needed, let me know or see Bills video. Regarding power, do you have a RaspberryPi wall wart, any good quality USB charger? Once the sketch is uploaded, just swap power and hit the reset button.

Screen Shot 2022 05 03 at 15.57.51

It is considered poor judgement to traverse a chasm in 2 leaps.


ReplyQuote
Leonardo1123
(@leonardo1123)
Trusted Member
Joined: 1 year ago
Posts: 56
Topic starter  

(@zander)

 

Okay, so, I have attempted each of the possible definitions, and none of them get this esp32 variant to start a webserver.

image

 They return two errors as specified in the comments, and listed in their entirety below:

malloc fail:

E (147) cam_hal: cam_dma_config(280): frame buffer malloc failed
E (147) cam_hal: cam_config(364): cam_dma_config failed
E (148) camera: Camera config failed with error 0xffffffff
Camera init failed with error 0xffffffff
no cam:

E (51) camera: Camera probe failed with error 0x105(ESP_ERR_NOT_FOUND)
Camera init failed with error 0x105
 

Fortune Favors the Bold


ReplyQuote
Ron
 Ron
(@zander)
Noble Member
Joined: 2 years ago
Posts: 2262
 

@leonardo1123 At this point I would assume the hardware is either incompatible or broken.

It is considered poor judgement to traverse a chasm in 2 leaps.


ReplyQuote
Page 1 / 3