AI-Thinker ESP32 CAM fail to acquire samples after one or few samples


I have made all the necessary modifications to the firmware code to make it work with the ESP32 CAM board. I was able to connect the board to the daemon CLI and acquire some samples, but then it stopped working after a few samples. The error was:

[SER] Taking snapshot...
[Tx ] AT+SN
[Rx ] AT+SN
[Tx ] T=96,
[Rx ] T=96,
[Tx ] 96,n
[Rx ] 96,n
E (86477) gpio: gpi
[Rx ] o_install_isr_service(449): GPIO
[Rx ]  isr service already installed
[Rx ] 0m

[Rx ] E (86509) camera: Camera 
[Rx ] probe failed with error 0x105(ES
ERR: Camera
[Rx ]  init failed
Failed to init came
[Rx ] ra
[WS ] Failed to sample data Error: Invalid length for snapshot, expected 9216 or 27648 values, but got 13
    at SerialDevice.sampleRequest (/REDACTED/edge-impulse-cli/build/cli/daemon.js:286:23)
    at async WebSocket.<anonymous> (/REDACTED/edge-impulse-cli/build/shared/daemon/remote-mgmt-service.js:171:21)
[SER] Entering snapshot stream mode...
[Tx ] AT+SN
[Rx ] AT+SN
[Tx ] AM=64
[Rx ] AM=64
[Tx ] ,64,n
[Rx ] ,64,n
[Tx ] 
[Rx ] 
Starting snapshot stream...

[Rx ] 0;31mE (86633) gpio: gpio_instal
[Rx ] l_isr_service(449): GPIO isr ser
[Rx ] vice already installed

[Rx ] E (86665) camera: Camera 
[Rx ] probe failed with error 0x105(ES
ERR: Camera
[Rx ]  init failed
Failed to init came
[Rx ] ra

The board could not recover from this error unless I hard reset the device. Here’s the same error I encountered after re-opening the daemon CLI.

Starting snapshot stream...

[Rx ] 0;31mE (1446690) gpio: gpio_inst
[Rx ] all_isr_service(449): GPIO isr s
[Rx ] ervice already installed

[Rx ] E (1446722) camera: Camer
[Rx ] a probe failed with error 0x105(
ERR: Came
[Rx ] ra init failed
Failed to init ca
[Rx ] mera

Hello @alwin_wint3r,

It seems that it fails at instantiate the camera. Can you make sure it is properly attached to the board?



The connector was properly attached. I wasn’t sure whether it was a driver issue or a hardware issue. It seemed that the camera was unable to handle heavy tasks such as streaming the image through serial to the EI studio.

I solved the problem by taking pictures frame by frame and upload them to the ingestion API.

1 Like

@alwin_wint3r would it be possible to try to capture images from live classification and see if you get the same results?

Also I would recommend that you upgrade the CLI to the latest version if this is not the case.

In addition to the API we also have the edge-impulse-uploader that you can use to upload images to the studio.

PS: you will need to have an already trained model in the studio to use the live classification

@AIWintermuteAI do you have an idea what might be causing the above issue?

Not really. We have tested ingestion and inference on AIThinker ESP32-CAM and it was working well. I believe it was also used by multiple users.
However there are many different versions of the board in question and it is hard to know exactly which version does @alwin_wint3r have.