FireBeetle 2 Board ESP32-S3 - Camera AXP313 - advanced tutorial example not compilable
advanced example 8 using camera lib axp313 not compilable
output:
Sketch uses 2924985 bytes (223%) of program storage space. Maximum is 1310720 bytes.
Global variables use 74532 bytes (22%) of dynamic memory, leaving 253148 bytes for local variables. Maximum is 327680 bytes.
Sketch too big; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing it.
text section exceeds available space in board
Compilation error: text section exceeds available space in board
any ideas ?
My Code , already using F Makro
#include "esp_camera.h"
#include <WiFi.h>
//
// WARNING!!! PSRAM IC required for UXGA resolution and high JPEG quality
// Ensure ESP32 Wrover Module or other board with PSRAM is selected
// Partial images will be transmitted if image exceeds buffer size
//
// You must select partition scheme from the board menu that has at least 3MB APP space.
// Face Recognition is DISABLED for ESP32 and ESP32-S2, because it takes up from 15
// seconds to process single frame. Face Detection is ENABLED if PSRAM is enabled as well
// ===================
// Select camera model
// ===================
#define PWDN_GPIO_NUM -1
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM 45
#define SIOD_GPIO_NUM 1
#define SIOC_GPIO_NUM 2
#define Y9_GPIO_NUM 48
#define Y8_GPIO_NUM 46
#define Y7_GPIO_NUM 8
#define Y6_GPIO_NUM 7
#define Y5_GPIO_NUM 4
#define Y4_GPIO_NUM 41
#define Y3_GPIO_NUM 40
#define Y2_GPIO_NUM 39
#define VSYNC_GPIO_NUM 6
#define HREF_GPIO_NUM 42
#define PCLK_GPIO_NUM 5
#include "DFRobot_AXP313A.h"
DFRobot_AXP313A axp;
// ===========================
// Enter your WiFi credentials
// ===========================
const char* ssid = "xxx";
const char* password = "yyy";
void startCameraServer();
void setup() {
Serial.begin(115200);
Serial.setDebugOutput(true);
Serial.println();
while(axp.begin() != 0){
Serial.println(F("init error"));
delay(1000);
}
axp.enableCameraPower(axp.eOV2640);//设置摄像头供电
camera_config_t config;
config.ledc_channel = LEDC_CHANNEL_0;
config.ledc_timer = LEDC_TIMER_0;
config.pin_d0 = Y2_GPIO_NUM;
config.pin_d1 = Y3_GPIO_NUM;
config.pin_d2 = Y4_GPIO_NUM;
config.pin_d3 = Y5_GPIO_NUM;
config.pin_d4 = Y6_GPIO_NUM;
config.pin_d5 = Y7_GPIO_NUM;
config.pin_d6 = Y8_GPIO_NUM;
config.pin_d7 = Y9_GPIO_NUM;
config.pin_xclk = XCLK_GPIO_NUM;
config.pin_pclk = PCLK_GPIO_NUM;
config.pin_vsync = VSYNC_GPIO_NUM;
config.pin_href = HREF_GPIO_NUM;
config.pin_sscb_sda = SIOD_GPIO_NUM;
config.pin_sscb_scl = SIOC_GPIO_NUM;
config.pin_pwdn = PWDN_GPIO_NUM;
config.pin_reset = RESET_GPIO_NUM;
config.xclk_freq_hz = 20000000;
config.frame_size = FRAMESIZE_UXGA;
config.pixel_format = PIXFORMAT_JPEG; // for streaming
//config.pixel_format = PIXFORMAT_RGB565; // for face detection/recognition
config.grab_mode = CAMERA_GRAB_WHEN_EMPTY;
config.fb_location = CAMERA_FB_IN_PSRAM;
config.jpeg_quality = 12;
config.fb_count = 1;
// if PSRAM IC present, init with UXGA resolution and higher JPEG quality
// for larger pre-allocated frame buffer.
if(config.pixel_format == PIXFORMAT_JPEG){
if(psramFound()){
config.jpeg_quality = 10;
config.fb_count = 2;
config.grab_mode = CAMERA_GRAB_LATEST;
} else {
// Limit the frame size when PSRAM is not available
config.frame_size = FRAMESIZE_SVGA;
config.fb_location = CAMERA_FB_IN_DRAM;
}
} else {
// Best option for face detection/recognition
config.frame_size = FRAMESIZE_240X240;
#if CONFIG_IDF_TARGET_ESP32S3
config.fb_count = 2;
#endif
}
#if defined(CAMERA_MODEL_ESP_EYE)
pinMode(13, INPUT_PULLUP);
pinMode(14, INPUT_PULLUP);
#endif
// camera init
esp_err_t err = esp_camera_init(&config);
if (err != ESP_OK) {
Serial.printf("Camera init failed with error 0x%x", err);
return;
}
sensor_t * s = esp_camera_sensor_get();
// initial sensors are flipped vertically and colors are a bit saturated
if (s->id.PID == OV3660_PID) {
s->set_vflip(s, 1); // flip it back
s->set_brightness(s, 1); // up the brightness just a bit
s->set_saturation(s, -2); // lower the saturation
}
// drop down frame size for higher initial frame rate
if(config.pixel_format == PIXFORMAT_JPEG){
s->set_framesize(s, FRAMESIZE_QVGA);
}
#if defined(CAMERA_MODEL_M5STACK_WIDE) || defined(CAMERA_MODEL_M5STACK_ESP32CAM)
s->set_vflip(s, 1);
s->set_hmirror(s, 1);
#endif
#if defined(CAMERA_MODEL_ESP32S3_EYE)
s->set_vflip(s, 1);
#endif
WiFi.begin(ssid, password);
WiFi.setSleep(false);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println(F("WiFi connected"));
startCameraServer();
Serial.print(F("Camera Ready! Use 'http://"));
Serial.print(WiFi.localIP());
Serial.println(F("' to connect"));
}
void loop() {
// Do nothing. Everything is done in another task by the web server
delay(10000);
}
When uploading fails, try:
(1. Press and hold on to boot
(2. Press reset
(3. Release boot and reset at the same time
(4. Upload
jennaHi Jenna, thx for your reply :) made some progress
question:
→ why do you use ESP32 S3 DEV Module instead of “firebeetle 2 ESP S3” in the advanced example
→ that's what confuses me
was able to upload with your settings, but that results after hard reset in output
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0xb (SPI_FAST_FLASH_BOOT)
Saved PC:0x4210c9c6
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x44c
load:0x403c9700,len:0xbe4
load:0x403cc700,len:0x2a38
entry 0x403c98d4
E (516) esp_core_dump_flash: No core dump partition found!
E (516) esp_core_dump_flash: No core dump partition found!
init error
init error
init error
i finally made it work using these setting
i encountered some problems
→ was not able to upload every time
Sketch uses 2925825 bytes (87%) of program storage space. Maximum is 3342336 bytes.Global variables use 74532 bytes (22%) of dynamic memory, leaving 253148 bytes for local variables. Maximum is 327680 bytes.esptool.py v4.5.1Serial port COM11Connecting....
A serial exception error occurred: Write timeoutNote: This error originates from pySerial. It is likely not a problem with esptool, but with the hardware connection or drivers.For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.htmlFailed uploading: uploading error: exit status 1
some times i was able to upload after boot with reset, power off on ,but no clue what really helped
i think that is a arduino ide (v2.1.0) problem, the port not beeing able to be used consistently.
Dirk.Brunner
Fire beetle ESP32-S3 has pin mapping for ArduinoIDE, which leads to init error when using ESP32-S3 directly. When I choose Fire beetle ESP32-S3 and set other parameters, I can acquire the image successfully.
serial monitor:
After the PC and ESP32 are connected to the same wifi, you can access the camera screen through the URL.
Concerning Upload problem Arduino IDE with firebeetle 2 ESP32 S3: looks like Power off/on is needed before upload
A serial exception error occurred: Write timeout
Upload is working when
1 disconnect USB
2 press boot button
3 connect USB
4 release boot button
5 connect Port in arduino ide (port connection is lost in the meantime)
6 upload
success looks like: