adafruit / Adafruit_CircuitPython_OV2640

CircuitPython driver for OV2640 cameras
MIT License
10 stars 3 forks source link

ImportError: no module named 'imagecapture' on ESP32-CAM #22

Closed algorni closed 1 year ago

algorni commented 1 year ago

Hi, tried to run the sample code on a ESP32-CAM with the https://circuitpython.org/board/espressif_esp32_eye/ CircuitPython 8 beta4 firmware.

Just importing the library, i'm getting the error message:

ImportError: no module named 'imagecapture'

jepler commented 1 year ago

Hi! Thanks for your report. 7.3.x and 8.0 are different when it comes to camera support on Espressif microcontrollers.

In 8.x with espressif microcontrollers, the module to use for all supported camera modules is (esp32_camera)[https://docs.circuitpython.org/en/latest/shared-bindings/esp32_camera/index.html], which is used directly instead of via a helper library like Adafruit_CircuitPython_OV2640. We have not yet published a guide on using this module, though there are several examples available as source code only: https://github.com/adafruit/Adafruit_Learning_System_Guides/tree/main/CircuitPython_ESP32_Camera

The esp32_camera module is in turn based on Espressif's "component" for cameras: https://github.com/espressif/esp32-camera -- we rely on it to do all the hard work of setting up the hardware peripherals correctly, managing DMA and memory allocation, etc.

It's also important to note that Adafruit's interest was to support cameras on ESP32S2 and ESP32S3 boards for a possible future product. ESP32 boards are supposed to work according to the documentation of the esp32-camera component we use in CircuitPython, but are less tested. In the PR I reported that I had trouble taking a second picture on the ESP32-EYE board. I vaguely remember, but can't confirm, that I also had wifi trouble on this board. As this is not a product that Adafruit plans to sell or a combination we're considering making a future product out of, it was not a priority.

Another contributor had trouble getting the camera module ESP32-CAM module to work with the camera library, which is why we have not added a build for this board: https://github.com/adafruit/circuitpython/pull/6827

I hope you're able to get something working, and if you do we'd love additional information or even pull requests so we can help others as well. But as a practical matter you might consider that using a different programming environment like Arduino or ESP-IDF may be more pragmatic, if it's in your skillset.