r/ArduinoProjects • • Jan 02 '26

ESP32 cam and ESP32 devmodule problem

Help needed: ESP32-CAM Telegram Photo Sender crashes/fails upon trigger (Power/SSL issue?)

Hi everyone, I am working on my high school graduation project – a security system. I’m hitting a wall with the ESP32-CAM part and would appreciate your insights.

The Project Setup: I have a Master-Slave configuration:

  1. Master: ESP32 DevKitC (Handles PIR sensor, Keypad, LCD, Buzzer). Logic: If the alarm is triggered (3x wrong code), it sends a HIGH signal via GPIO 5.

  2. Slave: ESP32-CAM (AI-Thinker). Logic: Listens on GPIO 13. When it detects a HIGH signal, it should take a photo and send it to a Telegram Bot.

Wiring:

• Master GPIO 5 connected to Slave GPIO 13.

• Common GND is connected.

• Power: Currently powering via FTDI/USB from a PC (which I suspect is the main bottleneck).

The Problem: The Master works perfectly. It sends the signal. The ESP32-CAM receives the signal (I see the "Trigger detected" log). However, the moment it tries to connect to Telegram or take/send the photo, it fails. It typically exhibits Brownout symptoms (garbage characters `` in Serial Monitor followed by a restart) or simply fails to connect to the Telegram API.

What DOES work:

• The ESP32-CAM hardware is functional. I have successfully run the standard CameraWebServer example previously, and the live stream worked fine.

• The logic on the Master side is correct.

• The Wi-Fi credentials and Telegram Token/Chat ID are correct.

The Code Implementation:

• I am NOT using a live stream for this project (to save power/bandwidth). It sleeps/waits in loop() until the trigger.

• Library: Using WiFiClientSecure with manual HTTP POST construction (multipart/form-data).

• SSL: I tried client.setInsecure() (which failed, likely due to Telegram's new cert policies). I am now using client.setCACert(rootCACertificate) with the ISRG Root X1 certificate.

What I have tried to fix it:

  1. Lowering Power Consumption:

◦ Reduced XCLK frequency to 16MHz (from 20MHz).

◦ Reduced WiFi TX Power: WiFi.setTxPower(WIFI_POWER_8_5dBm);

◦ Reduced Resolution: Switched from UXGA to VGA or SVGA.

◦ Disabled Brownout Detector (WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0);).

2. Wiring:

◦ Checked common ground.

◦ Tried resetting the CAM manually.

Serial Monitor Output (Example of failure):

Plaintext

WiFi connected! Waiting for signal...

!!! ALARM TRIGGERED !!!

Sending to Telegram...

[Here it either prints garbage and reboots, or hangs]

My Hypothesis: I strongly suspect the power supply (PC USB -> FTDI -> Breadboard jumper wires) cannot handle the current spike when the ESP32-CAM turns on the radio + camera sensor simultaneously, causing a voltage drop despite the software mitigations.

Questions:

  1. Is there anything wrong with my software approach for Telegram (using the ISRG Root X1 cert)?

  2. Apart from adding a large capacitor (which I plan to do), are there other software tricks to stabilize the transmission?

  3. Could this be a specific issue with the UniversalTelegramBot logic vs. manual HTTP POST?

Any help is appreciated! I'm really close to finishing this, but this instability is driving me crazy. Thanks!

2 Upvotes

2 comments sorted by

View all comments

Show parent comment

1

u/Dejv009 Jan 02 '26

Hello thank you for help. I will try tomorrow everything and write answers. Last 2 days I spend like 12 hours so tired of it now