Hi All. I have been using Arduino since long. I am right now working on ESP32-CAM to capture image and store in the memory card. The steps I have taken are :
I am using an FTDI USB to TTL Converter to let communicate PC with ESP32-CAM through Arduino IDE, the connections are as per below : USB to TTLESP32-CAM
Vcc Vcc
Gnd Gnd
Tx Rx
Rx Tx
Note : I have connected the IO0 pin of ESP32-CAM to Gnd to let it get flashed.
I have opened the File->Examples->ESP32->Camera->CameraWebServer code and set the Board to ESP32 Wrover Module with Partition Scheme Huge App (3 MB No OTA/1 MB SPIFFS) (Every other Partition scheme setting was throwing compilation errors) with setting camera in the code as CAMERA_MODEL_WROVER_KIT
When I compile the code with my ssid and password, the code gets compiled successfully, but when I upload it, following happens :
Using library WiFi at version 1.0 in folder: C:\Users\Shaunak\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFi
"C:\\Users\\Shaunak\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\xtensa-esp32-elf-gcc\\1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-size" -A "C:\\Users\\Shaunak\\AppData\\Local\\Temp\\arduino_build_833798/CameraWebServer.ino.elf"
Sketch uses 2594790 bytes (82%) of program storage space. Maximum is 3145728 bytes.
Global variables use 56256 bytes (17%) of dynamic memory, leaving 271424 bytes for local variables. Maximum is 327680 bytes.
esptool.py v3.0-dev
Serial port COM4
Connecting........_____....._____....._____....._____....._____....._____....._____
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
When I open the press the "Reset" Pin, I get the following data :
The first two of the last three lines of this output show the memory that the memory card that I have plugged has, and the PSRAM Failure in initializing.
4. The same errors retain when I set the board selection to AI Thinker ESP-32 CAM and camera as CAMERA_MODEL_AI_THINKER
The ESP32 CAM (WROOM) already has the 4MB of PSRAM RAM it needs to run. I'm sure you do not need to plug in a memory card if you are using the proper ESP32CAM.
I did not see the normal message sequence of upload a program to the ESP32 CAM.
After the jumper is in place, then press the button, the ESP32CAM will give a message that it is ready for upload. Then start the upload.
That tells me your program tried to read a memory address that is not there.
Install the ESP Exception decoder and use it, look it up on the internet.
Post a pick of your setup. Especially how you've plugged in a memory card.
I did not see the normal message sequence of upload a program to the ESP32 CAM.
After the jumper is in place, then press the button, the ESP32CAM will give a message that it is ready for upload. Then start the upload.
I do not get after pressing the reset button before uploading. There is only one button (Reset Button) on my ESP32 CAM.
Install the ESP Exception decoder and use it, look it up on the internet.
Can you please provide the link as I am completely new to it? I do not want to get misdirected.
The booting sequence goes like this (assuming VCC, GND, RX and TX are all connected):
Connect IO0 to GND while unplugged from computer
Plug programmer in to computer
Press the RST button on the ESP (you should get a "ready for upload" print on the serial monitor)
Upload program
If the waiting for upload message does not appear then no work. In other words the ESP32CAM must indicate it is ready for upload before selecting to upload the program in the IDE.
I see that the flash LED is on in your photo. The default is off.
Could you post an image of the pin side of the connection points?
On another note, I have tried several FTDI modules to find they do not all work the same. I went through several FTDI's modules till I got one to work.
Remove the SD card
Connect the Vcc from the FTDI to the 5 V pin on the ESP CAM (not the Vcc pin)
Try a simple blink sketch
//Led is on the reset button side of the board
void setup() {
pinMode(33, OUTPUT);
}
void loop() {
digitalWrite(33, LOW);//on
delay (1000);
digitalWrite(33, HIGH);//off
delay (1000);
}
The ESP seems defective. I will try to arrange a new one. Also, I am planning to buy CP2102 instead of FTDI. I will update you when I will get and test with them.
Connections USB to TTLESP32-CAM
Vcc Vcc
Gnd Gnd
Tx Rx
Rx Tx
Green wire is for Vcc (5V)
Black wire is for Ground
Yellow and Blue wires are for communication
White wire connects IO0 to Ground
Note : I have connected the IO0 pin of ESP32-CAM to Gnd to let it get flashed.
Then I took the following steps :
Opened the serial monitor and pressed the RESET button
The output is as below :
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
waiting for download
2. Then I minimize the serial monitor and press the **Upload** button. The Arduino informs **Done Uploading**.
Here is the output of Error Console (I am sharing what is important to me as I can not share entire due to forum character limit) :
-> candidates: [WiFi@2.0.0 WiFi@1.0]
"C:\Users\Shaunak\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-g++" -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX "-IC:\Users\Shaunak\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/fb_gfx" -std=gnu++11 -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -w -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers -Wno-sign-compare -fno-rtti -c -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10816 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD="ESP32_DEV"" "-DARDUINO_VARIANT="esp32"" -DESP32 -DCORE_DEBUG_LEVEL=0 -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue "-IC:\Users\Shaunak\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/fb_gfx" -std=gnu++11 -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -w -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers -Wno-sign-compare -fno-rtti -c -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10816 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD="ESP32_DEV"" "-DARDUINO_VARIANT="esp32"" -DESP32 -DCORE_DEBUG_LEVEL=0 -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue "-"C:\Users\Shaunak\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-g++" -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX "-IC:\Users\Shaunak\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/config" "-"C:\Users\Shaunak\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-g++" -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX "-IC:\Users\Shaunak\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/sdk/include/fb_gfx" -std=gnu++11 -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -w -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers -Wno-sign-compare -fno-rtti -c -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10816 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD="ESP32_DEV"" "-DARDUINO_VARIANT="esp32"" -DESP32 -DCORE_DEBUG_LEVEL=0 -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue "-IC:\Users\Shaunak\AppData\Local\Arduino15\packages\esp32\hardware\esp"C:\Users\Shaunak\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-g++" -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX "-32\1.0.6\libraries\WiFi\src\WiFiSTA.cpp" -o nul
"C:\Users\Shaunak\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-g++" -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX "-32\1.0.6/tools/sdk/include/fb_gfx" -std=gnu++11 -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -w -Wno-error=maybe-uninitialized -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-missing-field-initializers -Wno-sign-compare -fno-rtti -c -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10816 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 "-DARDUINO_BOARD="ESP32_DEV"" "-DARDUINO_VARIANT="esp32"" -DESP32 -DCORE_DEBUG_LEVEL=0 -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue "-"C:\Users\Shaunak\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-g++" -DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX "-Generating function prototypes...
DESP_PLATFORM "-DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h"" -DHAVE_CONFIG_H -DGCC_NOT_5_2_0=0 -DWITH_POSIX "-"C:\Users\Shaunak\AppData\Local\Temp\arduino_build_315154/CameraWebServer.ino.elf"
esptool.py v3.0-dev
"C:\Users\Shaunak\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6/tools/gen_esp32part.exe" -q "C:\Users\Shaunak\AppData\Local\Temp\arduino_build_315154/partitions.csv" "C:\Users\Shaunak\AppData\Local\Temp\arduino_build_315154/CameraWebServer.ino.partitions.bin"
Multiple libraries were found for "WiFi.h"
Used: C:\Users\Shaunak\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFi
Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
Using library WiFi at version 1.0 in folder: C:\Users\Shaunak\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFi
"C:\Users\Shaunak\AppData\Local\Arduino15\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0/bin/xtensa-esp32-elf-size" -A "C:\Users\Shaunak\AppData\Local\Temp\arduino_build_315154/CameraWebServer.ino.elf"
Sketch uses 2594790 bytes (82%) of program storage space. Maximum is 3145728 bytes.
Global variables use 56256 bytes (17%) of dynamic memory, leaving 271424 bytes for local variables. Maximum is 327680 bytes.
esptool.py v3.0-dev
Serial port COM8
Connecting....
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 3c:61:05:17:8f:e0
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 4096.0 kbit/s)...
Hash of data verified.
Compressed 18656 bytes to 12053...
Writing at 0x00001000... (100 %)
Wrote 18656 bytes (12053 compressed) at 0x00001000 in 0.3 seconds (effective 502.5 kbit/s)...
Hash of data verified.
Compressed 2594912 bytes to 2073527...
Writing at 0x00010000... (0 %)
Writing at 0x00014000... (1 %)
Writing at 0x00018000... (2 %)
Writing at 0x0001c000... (3 %)
Writing at 0x00020000... (3 %)
Writing at 0x00024000... (4 %)
Writing at 0x00028000... (5 %)
Writing at 0x0002c000... (6 %)
Writing at 0x00030000... (7 %)
Writing at 0x00034000... (7 %)
Writing at 0x00038000... (8 %)
Writing at 0x0003c000... (9 %)
Writing at 0x00040000... (10 %)
Writing at 0x00044000... (11 %)
Writing at 0x00048000... (11 %)
Writing at 0x0004c000... (12 %)
Writing at 0x00050000... (13 %)
Writing at 0x00054000... (14 %)
Writing at 0x00058000... (14 %)
Writing at 0x0005c000... (15 %)
Writing at 0x00060000... (16 %)
Writing at 0x00064000... (17 %)
Writing at 0x00068000... (18 %)
Writing at 0x0006c000... (18 %)
Writing at 0x00070000... (19 %)
Writing at 0x00074000... (20 %)
Writing at 0x00078000... (21 %)
Writing at 0x0007c000... (22 %)
Writing at 0x00080000... (22 %)
Writing at 0x00084000... (23 %)
Writing at 0x00088000... (24 %)
Writing at 0x0008c000... (25 %)
Writing at 0x00090000... (25 %)
Writing at 0x00094000... (26 %)
Writing at 0x00098000... (27 %)
Writing at 0x0009c000... (28 %)
Writing at 0x000a0000... (29 %)
Writing at 0x000a4000... (29 %)
Writing at 0x000a8000... (30 %)
Writing at 0x000ac000... (31 %)
Writing at 0x000b0000... (32 %)
Writing at 0x000b4000... (33 %)
Writing at 0x000b8000... (33 %)
Writing at 0x000bc000... (34 %)
Writing at 0x000c0000... (35 %)
Writing at 0x000c4000... (36 %)
Writing at 0x000c8000... (37 %)
Writing at 0x000cc000... (37 %)
Writing at 0x000d0000... (38 %)
Writing at 0x000d4000... (39 %)
Writing at 0x000d8000... (40 %)
Writing at 0x000dc000... (40 %)
Writing at 0x000e0000... (41 %)
Writing at 0x000e4000... (42 %)
Writing at 0x000e8000... (43 %)
Writing at 0x000ec000... (44 %)
Writing at 0x000f0000... (44 %)
Writing at 0x000f4000... (45 %)
Writing at 0x000f8000... (46 %)
Writing at 0x000fc000... (47 %)
Writing at 0x00100000... (48 %)
Writing at 0x00104000... (48 %)
Writing at 0x00108000... (49 %)
Writing at 0x0010c000... (50 %)
Writing at 0x00110000... (51 %)
Writing at 0x00114000... (51 %)
Writing at 0x00118000... (52 %)
Writing at 0x0011c000... (53 %)
Writing at 0x00120000... (54 %)
Writing at 0x00124000... (55 %)
Writing at 0x00128000... (55 %)
Writing at 0x0012c000... (56 %)
Writing at 0x00130000... (57 %)
Writing at 0x00134000... (58 %)
Writing at 0x00138000... (59 %)
Writing at 0x0013c000... (59 %)
Writing at 0x00140000... (60 %)
Writing at 0x00144000... (61 %)
Writing at 0x00148000... (62 %)
Writing at 0x0014c000... (62 %)
Writing at 0x00150000... (63 %)
Writing at 0x00154000... (64 %)
Writing at 0x00158000... (65 %)
Writing at 0x0015c000... (66 %)
Writing at 0x00160000... (66 %)
Writing at 0x00164000... (67 %)
Writing at 0x00168000... (68 %)
Writing at 0x0016c000... (69 %)
Writing at 0x00170000... (70 %)
Writing at 0x00174000... (70 %)
Writing at 0x00178000... (71 %)
Writing at 0x0017c000... (72 %)
Writing at 0x00180000... (73 %)
Writing at 0x00184000... (74 %)
Writing at 0x00188000... (74 %)
Writing at 0x0018c000... (75 %)
Writing at 0x00190000... (76 %)
Writing at 0x00194000... (77 %)
Writing at 0x00198000... (77 %)
Writing at 0x0019c000... (78 %)
Writing at 0x001a0000... (79 %)
Writing at 0x001a4000... (80 %)
Writing at 0x001a8000... (81 %)
Writing at 0x001ac000... (81 %)
Writing at 0x001b0000... (82 %)
Writing at 0x001b4000... (83 %)
Writing at 0x001b8000... (84 %)
Writing at 0x001bc000... (85 %)
Writing at 0x001c0000... (85 %)
Writing at 0x001c4000... (86 %)
Writing at 0x001c8000... (87 %)
Writing at 0x001cc000... (88 %)
Writing at 0x001d0000... (88 %)
Writing at 0x001d4000... (89 %)
Writing at 0x001d8000... (90 %)
Writing at 0x001dc000... (91 %)
Writing at 0x001e0000... (92 %)
Writing at 0x001e4000... (92 %)
Writing at 0x001e8000... (93 %)
Writing at 0x001ec000... (94 %)
Writing at 0x001f0000... (95 %)
Writing at 0x001f4000... (96 %)
Writing at 0x001f8000... (96 %)
Writing at 0x001fc000... (97 %)
Writing at 0x00200000... (98 %)
Writing at 0x00204000... (99 %)
Writing at 0x00208000... (100 %)
Wrote 2594912 bytes (2073527 compressed) at 0x00010000 in 50.1 seconds (effective 414.6 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 119...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (119 compressed) at 0x00008000 in 0.0 seconds (effective 1638.4 kbit/s)...
Hash of data verified.
I resolved the issue that was challenging my patience.
Here is what I did :
I removed the connection between IO0 pin and Gnd
I opened the serial monitor of Arduino IDE.
I pressed the on-board RESET button that gave the following output :
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10944
load:0x40080400,len:6388
entry 0x400806b4
.....
WiFi connected
Starting web server on port: '80'
Starting stream server on port: '81'
Camera Ready! Use 'http://192.168.43.40' to connect
I entered the URL 'http://192.168.43.40' and saw the default webpage of ESP32 CAM. I kept settings as they were and clicked the "Get Still" button. Here is the screenshot :