-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error abort () was called at PC 0x4013ed4f on core 0 in ESPAsyncWebServer #5348
Comments
I decoded the backtrace with EspExceptionDecoder and got this: 0x400911a4: invoke_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c line 155 |
[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. |
Hello everyone! I am using ESP32-CAM Ai-Thinker board. I made a sketch below, with which I try to asynchronously send a video stream in MJPEG format to an HTTP server (for this I use the built-in camera module that comes with the board). Before downloading this sketch, you need to install a set of ESP32 boards and the (ESPAsyncWebServer)[https://github.com/me-no-dev/ESPAsyncWebServer] and (AsyncTCP)[https://github.com/me-no-dev/AsyncTCP] libraries (If you have an ESP8266 board, you need the (ESPAsyncTCP)[https://github.com/me-no-dev/ESPAsyncTCP] library).
#include <WiFi.h>
#include <WiFiClient.h>
#include "esp_camera.h"
#include <Arduino.h>
#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include "soc/soc.h"
#include "soc/rtc_cntl_reg.h"
#define PWDN_GPIO_NUM 32
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM 0
#define SIOD_GPIO_NUM 26
#define SIOC_GPIO_NUM 27
#define Y9_GPIO_NUM 35
#define Y8_GPIO_NUM 34
#define Y7_GPIO_NUM 39
#define Y6_GPIO_NUM 36
#define Y5_GPIO_NUM 21
#define Y4_GPIO_NUM 19
#define Y3_GPIO_NUM 18
#define Y2_GPIO_NUM 5
#define VSYNC_GPIO_NUM 25
#define HREF_GPIO_NUM 23
#define PCLK_GPIO_NUM 22
#define SSIDName "1"
#define SSIDPass "0000000000"
camera_fb_t * fb = NULL;
AsyncWebServer server(80);
String ESP32IP;
const char header[] = "HTTP/1.1 200 OK\r\n"
"Access-Control-Allow-Origin: *\r\n"
"Content-Type: multipart/x-mixed-replace; boundary=123456789000000000000987654321\r\n";
const char boundary[] = "\r\n--123456789000000000000987654321\r\n";
const char ctntType[] = "Content-Type: image/jpeg\r\nContent-Length: ";
const int hdrLength = strlen(header);
const int bdrLength = strlen(boundary);
const int cntLength = strlen(ctntType);
char jpegBuffer[32];
int photoSize;
bool setupCamera() {
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.pixel_format = PIXFORMAT_JPEG;
if (psramFound()) {
config.frame_size = FRAMESIZE_UXGA;
config.jpeg_quality = 10;
config.fb_count = 2;
} else {
config.frame_size = FRAMESIZE_SVGA;
config.jpeg_quality = 12;
config.fb_count = 1;
}
esp_err_t err = esp_camera_init(&config);
if (err != ESP_OK) {
Serial.printf("Возникла следующая ошибка камеры: 0x%x ", err);
return false;
}
sensor_t * s = esp_camera_sensor_get();
if (s->id.PID == OV3660_PID) {
s->set_vflip(s, 1);
s->set_brightness(s, 1);
s->set_saturation(s, -2);
}
return true;
}
void setup() {
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0);
Serial.begin(115200);
if (setupCamera()) {
Serial.println("Камера успешно настроена!");
} else {
Serial.println("Не удалось настроить камеру :(");
return;
ESP.restart();
}
}
void loop() {
if (WiFi.status() != WL_CONNECTED) {
WiFi.begin(SSIDName, SSIDPass);
if (WiFi.waitForConnectResult() == WL_CONNECTED) {
Serial.println("Подключились к WiFi сети!");
IPAddress LocalIP = WiFi.localIP();
for (int i = 0; i < 4; i ++) {
ESP32IP += i ? "." + String(LocalIP[i]) : String(LocalIP[i]);
}
Serial.println("Local IP: " + String(ESP32IP));
Serial.println("Video stream IP: http://" + String(ESP32IP) + "/mjpeg");
}
}
When I run this sketch, after starting the Web server, a message appears in the COM port:
abort () was called at PC 0x4013ed3b on core 0
Backtrace: 0x400911a4: 0x3ffddc90 0x400913d5: 0x3ffddcb0 0x4013ed3b: 0x3ffddcd0 0x4013ed82: 0x3ffddcf0 0x4013e697: 0x3ffddd10 0x4013e786: 0x3ffddd30 0x4013e73d: 0x3ffddd50 0x400da73f: 0x3ffddd70 0x400da785: 0x3ffddd90 0x400d6e9c: 0x3ffdddb0 0x400d6ec0: 0x3ffdddd0 0x4014dc25: 0x3ffdddf0 0x400d1325: 0x3ffdde10 0x400d8735: 0x3ffdde40 0x400d63e1: 0x3ffdde90 0x400d64af: 0x3ffdded0 0x400d6735: 0x3ffddf10 0x400d2895: 0x3ffddf30 0x400d2915: 0x3ffddf70 0x400d2fae: 0x3ffddf90 0x4008d8ed: 0x3ffddfc0
The text was updated successfully, but these errors were encountered: