shariltumin / esp32-cam-micropython-2022

MicroPython esp32-cam firmware with camera support compiled with esp-idf-4.4.0. Python script files for live streaming
MIT License
201 stars 36 forks source link

Parameters in camera.init #16

Open e16384 opened 1 year ago

e16384 commented 1 year ago

Dear Mr. Sharil, I've installed your firm v1.18-610-gcf7d962cf-kaki5 (on ESP32Cam), when I try to do this:

import camera
camera.init(0, xclk_freq=20000000) 

I have the error: TypeError: function doesn’t take keyword arguments

Then, how can I change the clock frequency?

Another question, when camera.init() fails, I have tried to do camera.deinit() several times waiting for a second between one attempt and another, but init() still fails. The only solution I've found is to do a reset. Is there any other solution?

Best regards.

Antoniomacaroni commented 1 year ago

Dear e16384 and Sharil,

I have the same problems with camera.init. The camera works without problems with the Arduino IDE, but with micropython I get random crashes. Sometimes immediately and sometimes only after 100 times.

Kindly regards,

Antonio

shariltumin commented 1 year ago

Please have a look at firmwares-20230521

The new firmware supports

>>> import camera
>>> camera.
aecvalue        aelevels        agcgain         brightness
capture         conf            contrast        deinit
flip            framesize       init            mirror
pixformat       quality         saturation      speffect
whitebalance

What you want is camera.conf method.

e16384 commented 1 year ago

Thank you very much!

thecatinbed commented 1 year ago

I do enter "camera." after "import camera", but the system prompts syntax error. The firmware version is the latest, I can't figure out it. Best regrads.

shariltumin commented 1 year ago

The firmware does not include help(). As a result, you will not be able to list all methods from the camera module. In the REPL example shown in the README, "camera." means "camera.\<TAB>". This is the autocomplete feature of the MicroPython REPL. When a tab character is placed after a module name and a period, all possible attributes following the module are listed. The \<TAB> key is usually located in the upper left corner, just below the digit keys, and has an arrow with a bar symbol.