lemariva / micropython-camera-driver

add camera support to MicroPython
https://lemariva.com
Apache License 2.0
438 stars 92 forks source link

OSError: Camera Init Failed #76

Open wildernessfamily opened 1 year ago

wildernessfamily commented 1 year ago

There have been many comments and posts relating to OSError: Camera Init Failed error when trying to initialize the camera. I have reviewed every post, which the most recent was over a half a year a go, and all have gone unanswered. Steps that I have taken on my MacBookPro:

  1. I have a 3 brand new AIThinker ESP32-CAM microcontrollers.
  2. Downloaded micropython_camera_feeeb5ea3_esp32_idf4_4.bin (commit it 905c798 on February 2, 2022)
  3. Created a python virtual environment in a new folder (Python version 3.10.7).
    mkdir -p sandboxESP32CAM
    cd sandboxESP32CAM
    python -m venv .venv
    source .venv/bin/activate
  4. Installed ESPTools pip install esptool
  5. Performed the erase flash python -m esptool --chip esp32 --port /dev/cu.usb1440 erase_flash
  6. Installed the firmware above. python esptool --chip esp32 --port /dev/cu.usb1440 write_flash -z 0x1000 micropython_camera_feeeb5ea3_esp32_idf4_4.bin Everything was a success.
  7. Opened VSCode code .
  8. Installed PyMakr extension
  9. Restarted VSCode
  10. Created a PyMakr project
  11. Copied over the code. I tried all three projects, webcam, webserver (both picoweb & MicroWebServer), and timelapse. They all failed with the same error: OSError: Camera Init Failed I tried with all three ESP32-CAM controllers. I'm at a loss on what else I can try.
magixyu commented 1 year ago

I have the same issue. Could you please help to take a look?

>>> %Run -c $EDITOR_CONTENT
Traceback (most recent call last):
  File "<stdin>", line 11, in <module>
  File "webserver.py", line 48, in run
OSError: Camera Init Failed
PsuFan commented 1 year ago

Make sure you execute your code after a hard reset and check to make sure the camera ribbon cable is fully inserted. I get this error only after a soft reset and am still looking for a solution. Works fine for me on first power up.

shillehbean commented 9 months ago

I am also having this issue, so we have to hard reset every time we want to use the camera? Then that removes the use of practical use case unless I am missing something

PsuFan commented 9 months ago

I was able to deinit before init to solve the issue on soft reset.