shariltumin / esp32-cam-micropython

Micropython esp32-cam
85 stars 28 forks source link

about camera init error #14

Open shenzhenjinma opened 2 years ago

shenzhenjinma commented 2 years ago

Hi,i unable to use camera feature,how do i use this feature?can tell me ?thanks

camera.init() I (437234) sccb: pin_sda 26 pin_scl 27

E (437234) i2c: i2c driver install error I (437234) gpio: GPIO[32]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 E (437304) camera: Detected camera not supported. E (437304) camera: Camera probe failed with error 0x20004 E (437304) camera: Camera Init Failed False

I want to know how to fix it. I used the esp32-cam by Taobao which is usually used. Could you please put a firmware of this kind? I think most users in China would use this one.

Originally posted by @ywz978020607 in https://github.com/shariltumin/esp32-cam-micropython/issues/5#issuecomment-611966088

sylvesternumski commented 2 years ago

This code depends on esp32-camera component from esp-idf. There have been many updates recently but if you replace the line: gpio_install_isr_service(ESP_INTR_FLAG_LEVEL1 | ESP_INTR_FLAG_IRAM);

in esp32-camera/target/esp32/ll_cam.c with: esp_err_t err = gpio_install_isr_service(ESP_INTR_FLAG_LEVEL1 | ESP_INTR_FLAG_IRAM); if (err != ESP_OK) { if (err != ESP_ERR_INVALID_STATE) { ESP_LOGE(TAG, "gpio_install_isr_service failed (%x)", err); } else { ESP_LOGW(TAG, "gpio_install_isr_service already installed"); } }

The gpio service install will still fail but will allow the driver to continue and be successful.

This was suggested here: https://github.com/shariltumin/esp32-cam-micropython/issues/5#issuecomment-639535343 But because of all the updates, that patch doesn't line up correctly, and the location of where to update with this logic is different in the more recent esp32-camera source. (update ll_cam.c as opposed to camera.c - which is no longer there). I'm surprised that this logic has not been put into the main esp32-camera component but I'm sure there's a specific reason (it might be "board" specific and should be done only with a specific configuration and I don't want to hunt around to see about enabling it - maybe I will later if I get further)