Getting started with ESP32 cam



Got this ESP32 cam with USB adaptor board.
Can upload sketches, but can't get any serial output from it in the serial monitor.

Gut feeling is that it's something to do with these buttons on the adaptor board?

I uploaded a blink sketch to the ESP32 (I can get the LED to blink but not the flash) and it runs when it's powered from it's pins, but not when it's in the adaptor board.

Tried to get pass-through serial working via an Arduino Nano that I have (using SoftwareSerial) like this

#include <SoftwareSerial.h>

SoftwareSerial esp = SoftwareSerial(10 /* D3 brown TX */, 11 /* D3 orange TX */);

void setup() {
  Serial.begin(9600);
  esp.begin(9600);
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.println("esp32_cam_arduino_serial started");
}

long n = 0;

void loop() {
  while (esp.available()) {
    Serial.write(esp.read());
  }

  while (Serial.available()) {
    esp.write(Serial.read());
  }

  n++;
  if( n == 2000000) {
    Serial.println("esp32_cam_arduino_serial");
    n = 0;
  }
}

but it doesn't work and I can't work out why.

What are these buttons on the adaptor board for?

There's a button on the ESP32-CAM too -- what's that?

Here's the blink sketch.

/*
ESP32S3 Dev: A fatal error occurred: This chip is ESP32 not ESP32-S3. Wrong --chip argument?
ESP32S2 Dev: A fatal error occurred: This chip is ESP32 not ESP32-S2. Wrong --chip argument?
ESP32 Dev: Uploads but no serial.
*/

int pin = 33;

void setup() {
  Serial.begin(9600);
  Serial.println("***"); // Isn't received
  pinMode(pin, OUTPUT);
  pinMode(4, OUTPUT); // Causes a brief flash...
  digitalWrite(4, HIGH);
  delay(250); // ...but not as long as this.
  digitalWrite(4, LOW);

  // This does nothing.
  for(int i = 0; i < 12; i++) {
    // This causes blinking.
    digitalWrite(pin, HIGH);
    delay(250);
    digitalWrite(pin, LOW);
    delay(250);
  }
}

int n = 0;
void loop() {
  // No blinking and no serial output.
  for(int i=0; i < n; i++){
    digitalWrite(pin, HIGH);
    Serial.print("*");
    delay(250);
    digitalWrite(pin, LOW);
    delay(250);
  }
  Serial.println();
  if( n == 12) { 
    n = 0;
    }
  n++;
  delay(2000);
}

Buttons on ESPCAM-MB are for uploading firmware. If your IDE is able to upload your sketch and it runs - then you don't need to press any buttons.

Pressing and holding "Boot" and pressing "Reset" will switch ESP32Cam into flashing mode

Try to powerup your ESPCam while attached to ESPCAM-MB via external power supply (~500mA should be enough)

Setting debug level to "verbose" (Tools->Core Debug Level) also helps

Is your Arduino Serial Monitor set to 9600?
In your "passthru" sketch - did you connect TX to RX and RX to TX (ESP <-> Another Arduino)? Try to swap RX and TX (pins 1 and 3 on ESPCam)

Noticed that

  • The sketch starts running (both lights flash as instructed) when I quit Arduino IDE.
  • Similary using the windows command type COM7 to listen for serial causes the ESP32 to stop running.

If it's running and I start Arduino IDE then it continues to run until I open the Serial Monitor and when I do it stops and the flash LED comes on dim.

With Arduino IDE closed the flash LED comes on dim in the same way if I hold the reset button on the USB adaptor.

I the adapter board an FTDI interface for programming? Does it operate on 3v3? Does the adapter short ESP32CAM pin 0 and GND for programming?

I'm not sure exactly what it is.
It's described as Development Board CH340 CH340G 5V

This happens here also but with TeraTerm.

This is linked to RTS and other signals which turn ESP32Cam into brick. However, with my Serial Monitor it works. Try other terminals. It is in config files of Arduino IDE - I mean what to do with RTS/CTS. But I don't remember which config file.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.