This program In Unit 3 was working very unstable, made mixed combind foto’s, crashing the program when I press the button, some times starts good but then crashes.. I found in this forum the solution: change config.frame_size to _VGA and config.jpeg_quality to 20. I did this and now everything is working stable correct. but don’understand this solution.?
I don’t recall exactly but I believe it was to do with a variable type. I think it was set to either an unsigned 8 or 16 bit integer. So you could do what you did and set the frame size and JPEG quality to a number that would fit OR you could change the variable type to an unsigned 32 bit integer.
Basically what happens is the integer is too large to fit in the space allocated to it and overflows into other areas of memory. When that happens your program will be very unstable as you saw.
Hi.
Steve, I think you are referring to other projects like the ESP32-CAM Telegram project.
In that particular project that gj.linthorst is referring, there isn’t any unsigned 8 or 16 variables. Here’s the code: https://github.com/RuiSantosdotme/ESP32-CAM-eBook/blob/master/Code/Module_2/Take_Photo_Pushbutton/Take_Photo_Pushbutton.ino
Do you have any suggestions on how to solve the issue (without having to change the settings)?
Regards,
Sara
Sara – Sometimes my memory fails me.
I don’t have the particular book that gj.linthorst is referring to so couldn’t see the sketch. Thanks for pointing that out.
My hypothesis is correct; Just not for this particular case 😉
I have a very similar sketch that works perfectly on my two ESP32-CAM boards (Arducam IOTAI and AI-Thinker) even at the highest quality settings so I think the issue may be with the board type? Or possibly with the version(s) of the library(s)?
Hi again Steve.
Yes, it works fine for me too. But this is not the first time one of our readers comes with this problem.
Can it be a power issue?
How are you powering your board, gj.linthorst?
Regards,
Sara
Hi Sara,
I use the same FTDI programmer as in your esp32-cam procedure. The pushbutton is connected .3.3V and the esp-cam is connected to 5V. The FTDI programmer is also set to 5V and I also checked if it is 5V. I tried it on 2 noteboeks. Al programs up to page 189 in the esp32-cam cource are working correct without problems. It is strange that al the programs use framesizse_UXGA and jconfig.jpg_quality = 10 and in this program I have to change the values to let it work. I also changed the pusbutton for a real pusbutton (antibounce minimum) but without succes.
jan linthorst
Hi.
Yes, it is weird.
In your case, it seems that the power supply is not the problem.
However, I really don’t know how to solve that issue.Â
The only workaround I’ve found is to reduce the framesize and quality.
I’m sorry that I can’t help much. Meanwhile, if I found out something, I’ll share.
Regards,
Sara