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
174 stars 33 forks source link

TypeError: function missing 1 required positional arguments #45

Open dman271828 opened 5 months ago

dman271828 commented 5 months ago

After running the execfile('webcam.py') I received this error message:

execfile('webcam.py') Traceback (most recent call last): File "", line 1, in File "webcam.py", line 126, in TypeError: function missing 1 required positional arguments

I found solution to this bug in the webcam.py camera initialize step. The camera.init() was missing the 3 require parameters. I replaced the camera.init() with the follow:

cam = camera.init()

cam = camera.init(0, format=camera.JPEG, fb_location=camera.PSRAM)
shariltumin commented 5 months ago

I'm sure you're using a firmware that's not from my repository. The camera.init() method does not take a parameter. I'm sure you're using a firmware provided by other developers from another repository.

The firmwares I have provided have a "kaki5" tag attached to them, for example:

>>>
MPY: soft reboot
MicroPython v1.20.0-206-g33b403dfb-kaki5 on 2024-01-19; ESP32 AIT OV2640 (KAKI5) with ESP32

If the script "webcam.py" is a copy from my repository and used on MicroPython firmware from another repository, you will get some errors like the one you mentioned.

Please note that MicroPython firmware supporting the camera module is not the official version of MicroPython, developers may choose different implementations.

I am glad that you have found a solution to your problem.