Hi i have multiple fixes to get the esp32-cam working!

Hi,

I got multiple fixes to get the ESP32-CAM board working. First one is in the edge-impulse-daemon. This daemon opens a serialport but pulls btrs low and that puts the ESP32-CAM with programmer mode into bootmode. Thus connection an AT commands fail.

This can be fixed by editing:

C:\Users<YOUR WINDOWS USERNAME>\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\serial-connector.js

Line 44, original:
this._serial = new serialPort(this._path, { baudRate: this._baudrate });

change to:
this._serial = new serialPort(this._path, { baudRate: this._baudrate, hupcl: false });

This prevents the deamon from resetting the device.

Also two fixes for the esp firmware, if your camera fails to initialize go to the components folder in your project:

components/esp32-camera/target/xclk.c

add on line 24/25:
timer_conf.clk_cfg = LEDC_AUTO_CLK;

and on line 57/58:
ch_conf.sleep_mode = LEDC_SLEEP_MODE_NO_ALIVE_NO_PD;

After this the ESP32-cam module should work

1 Like

Thanks @rr1993 first of all welcome to the Edge Impulse community!

Let me share this with the embedded team :slight_smile:

We will keep you posted!

Thank you, if you need more info just let me know :).

Hi, @rr1993 !

  1. Modifying CLI code is not necessary for changing baud rate, there is an argument for that Serial daemon - Edge Impulse Documentation
  2. This sounds like something very specific to either hardware version of ESP-CAM (there are different boards that are named ESP-CAM on the market) or different ESP IDF version. If you have time, can you send the pictures of the board and also lt us know which ESP IDF version are you using. That will help other people that might find this thread later.
    Ty!

Hi @AIWintermuteAI

  1. I’m not changing the baudrate and I was aware of the cli flag to change the baudrate. I’m adding hupcl: false to prevent pulling control lines low or high. Because if you do it puts the esp32-cam in boot mode (where it wait to be programmed). So the serial communication fails between the daemon and the device. Not all devices would have this issue it’s only for circuits that don’t require you to press the boot button for flashing. Maybe you can add a --no-control-signals flag to the daemon?

  2. It might be specific for a newer version of esp-idf I used 5.4.2 (out of my head). And I got errors that are fixed now. So it’s not specific to the board but to the esp-idf version that is used. You might not want to update this in the code but people might find this fix here for esp32-cam.

  1. Oh, right. Did not properly read your first message, sorry. I remember one of our team members used ESP-CAM before and it was not necessary. I guess it is hardware dependent.
  2. Thanks for clarification. If you post a picture of exact hardware, it might be even more useful for other people, but obviously up to you :slight_smile: