ESP-EYE snapshot Error: Invalid length for snapshot, expected 4096 or 12288 values, but got 78

Question/Issue: ESP-EYE V2.1 unable to sample any images via edge-impulse-daemon

Context/Use case:
Windows 10 / Windows Powershell
ESP-EYE V2.1

ESP-EYE can connect to edge impulse via daemon and sample audio and adc correctly. I have also been able to build and upload a simple audio classification to the ESP.

Whenever sampling from the camera of any dimension, I receive the following error:

Failed to handle snapshot Error: Invalid length for snapshot, expected 4096 or 12288 values, but got 78 at EventEmitter.<anonymous> (C:\Users\User\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\daemon.js:170:31)

Whenever selecting the start sampling button the logs reflect much the same:

[WS ] Incoming sampling request {
  path: '/api/training/data',
  label: 'Normal',
  length: 60000,
  interval: 0,
  hmacKey: '1f6c938f7ea598a30738775cfd8af7de',
  sensor: 'Camera (64x64)'
}
[SER] Stopping snapshot stream mode...
[SER] Stopped snapshot stream mode
[SER] Taking snapshot...
[SER] Reading 1% complete...
[WS ] Failed to sample data Error: Invalid length for snapshot, expected 4096 or 12288 values, but got 24
    at SerialDevice.sampleRequest (C:\Users\User\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\daemon.js:284:23)
    at async WebSocket.<anonymous> (C:\Users\User\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\shared\daemon\remote-mgmt-service.js:173:21)

The error occurs on the following lines of the daemon.js:

I have tried resetting the board and rerunning the daemon with no success.

Any help is much appreciated,
Greg

Possibly a strange issue with drivers on Windows. Can you first try using WebUSB in Google Chrome browser?

Hi,

I was originally using the Brave browser and I now have tried using the edge-impulse-daemon on Chrome and Edge but it still returns the same error.

I used Chrome and tried the “Connect using WebUSB” but this returned a timeout error:

image

I’ve reflashed the ESP-EYE using the .bat contained within the .zip and it runs the base edge-impulse-run-impulse fine but still no camera connection via the daemon or Chrome webUSB.

Hi @Upstart3824,

I’m seeing this error as well. I have posted an issue on GitHub: WebUSB "Failed to connect to device" · Issue #2 · edgeimpulse/firmware-espressif-esp32 · GitHub. It seems to show up when you first try to connect. I recommend refreshing the page and/or unplugging/replugging the device as a workaround. That seemed to cause mine to start working. You can also try the edge-impulse-daemon to see if that works instead.