lemariva / uPyCam

Take a photo with an ESP32-CAM running MicroPython
https://lemariva.com/blog/2019/09/micropython-how-about-taking-photo-esp32
Apache License 2.0
140 stars 42 forks source link

webcam.py not working #7

Closed aleggon closed 4 years ago

aleggon commented 4 years ago

camera.init() requires at least one positional argument, which you do not provide when testing at first. But that does not solve the problem: the ESP32-CAM board reboots and throws errors:

camera.init(0, format=camera.JPEG)

ESP_ERROR_CHECK failed: esp_err_t 0x105 (ESP_ERR_NOT_FOUND) at 0x4009a534 file: "/home/lemariva/esp/esp-idf/components/esp32-camera/driver/camera.c" line 452 func: i2s_init expression: esp_intr_alloc(ETS_I2S0_INTR_SOURCE, ESP_INTR_FLAG_INTRDISABLED | ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_IRAM, &i2s_isr, NULL, &s_state->i2s_intr_handle)

ELF file SHA256: 0000000000000000

Backtrace: 0x40099e6c:0x3ffd7250 0x4009a537:0x3ffd7270 0x4016b1b5:0x3ffd7290 0x4016b8f5:0x3ffd7340 0x400fc479:0x3ffd7370 0x400e442e:0x3ffd73e0 0x400e0185:0x3ffd7410 0x400e02be:0x3ffd7430 0x400ee607:0x3ffd7450 0x400e44fc:0x3ffd74f0 0x400e0185:0x3ffd7560 0x400e01ae:0x3ffd7580 0x40104210:0x3ffd75a0 0x40104305:0x3ffd7630 0x400f7ba1:0x3ffd7660 0x40091859:0x3ffd76a0

Rebooting... ets Jun 8 2016 00:22:57

lemariva commented 4 years ago

I've just updated the application. Last week, I updated the driver, and forgot to update the uPyCam (master branch). The timelapse branch was working. Please download and flash the firmware again. I added a streaming mode too.

lemariva commented 4 years ago

any news?

aleggon commented 4 years ago

Hi, it works with the old webcam.py, but it fails or reboots the board most of the time I try to init() the camera. It does not work with the new webcam.py.

lemariva commented 4 years ago

Did you flash the new firmware? I've just tested both modules (esp32-cam and m5camera) again and they worked with the new camera application (last commit). You need to change in the config file the setting for your camera ('camera': 'ESP32-CAM'). If you try to initiate the camera twice, the ESP32 reboots. But as I mentioned, the firmware and application are working.

aleggon commented 4 years ago

You are right. It works. I had not set the config file (it was not clear in your article how to do that). But the the board reboots too often with the new firmware. It is not as reliable now as it use to be.

I get this all the time:

INFO:picoweb:646956872.940 <HTTPRequest object at 3f9d1030> <Stream object at 3f9d0e60> "GET /?stream=true" MJPEG: Output frame 27 ERROR:picoweb:646956872.940 <HTTPRequest object at 3f9d1030> <Stream object at 3f9d0e60> OSError('Camera Init Failed',) Traceback (most recent call last): File "/lib/picoweb/init.py", line 206, in _handle File "webcam.py", line 29, in index OSError: Camera Init Failed INFO:picoweb:646956872.940 <HTTPRequest object at 3f9d2ac0> <Stream object at 3f9d28a0> "GET /?stream=true" MJPEG: Output frame 28 ESP_ERROR_CHECK failed: esp_err_t 0x105 (ESP_ERR_NOT_FOUND) at 0x4009a534 file: "/home/lemariva/esp/esp-idf/components/esp32-camera/driver/camera.c" line 452 func: i2s_init expression: esp_intr_alloc(ETS_I2S0_INTR_SOURCE, ESP_INTR_FLAG_INTRDISABLED | ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_IRAM, &i2s_isr, NULL, &s_state->i2s_intr_handle)

ELF file SHA256: 0000000000000000

Backtrace: 0x40099e6c:0x3ffd6a30 0x4009a537:0x3ffd6a50 0x4016b1b5:0x3ffd6a70 0x4016b8f5:0x3ffd6b20 0x400fc479:0x3ffd6b50 0x400e442e:0x3ffd6bc0 0x400e0185:0x3ffd6bf0 0x400e02be:0x3ffd6c10 0x400ee607:0x3ffd6c30 0x400e47eb:0x3ffd6cd0 0x400e03e9:0x3ffd6cf0 0x400ee868:0x3ffd6d30 0x400e47eb:0x3ffd6dd0 0x400e4859:0x3ffd6df0 0x400e48c8:0x3ffd6e20 0x400e439d:0x3ffd6e40 0x400e0185:0x3ffd6e60 0x400e02be:0x3ffd6e80 0x400ee607:0x3ffd6ea0 0x400e44fc:0x3ffd6f40 0x400e0185:0x3ffd6f70 0x400ee58e:0x3ffd6f90 0x400e44fc:0x3ffd7030 0x400e0185:0x3ffd7080 0x400e02be:0x3ffd70a0 0x400ee607:0x3ffd70c0 0x400e44fc:0x3ffd7160 0x400e0185:0x3ffd71d0 0x400e02be:0x3ffd71f0 0x400ee607:0x3ffd7210 0x400e44fc:0x3ffd72b0 0x400e0185:0x3ffd72e0 0x400e02be:0x3ffd7300 0x400ee607:0x3ffd7320 0x400e44fc:0x3ffd73c0 0x400e0185:0x3ffd7430 0x400e02be:0x3ffd7450 0x400ee607:0x3ffd7470 0x400e44fc:0x3ffd7510 0x400e0185:0x3ffd7560 0x400e01ae:0x3ffd7580 0x40104210:0x3ffd75a0 0x40104305:0x3ffd7630 0x400f7ba1:0x3ffd7660 0x40091859:0x3ffd76a0

Rebooting... ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee

lemariva commented 4 years ago

I think you're having a hardware problem.

I used the camera without any problem and made an 8-hour test today. And as I see, you are having problems after about 28 seconds.

Keep me updated!