ESP32 Watchdog หาวิธีแก้ไขค่ะ

Yunngongnaidonggluay (Yunngongnaidonggluay) February 9, 2021, 5:10pm #1

คือว่าหนูรันโค้ดแล้วมันขึ้นแบบนี้ค่ะ

E (10560) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (10560) task_wdt:  - IDLE0 (CPU 0)
E (10560) task_wdt: Tasks currently running:
E (10560) task_wdt: CPU 0: wifi
E (10560) task_wdt: CPU 1: IDLE1
E (10560) task_wdt: Aborting.
abort() was called at PC 0x400d43e7 on core 0

Backtrace: 0x4008c434:0x3ffbe170 0x4008c665:0x3ffbe190 0x400d43e7:0x3ffbe1b0 0x40084771:0x3ffbe1d0 0x400dbc5e:0x3ffb52f0 0x400dbcad:0x3ffb5310 0x400dc115:0x3ffb5330 0x400d9745:0x3ffb53d0 0x400d99ee:0x3ffb5450 0x400da2ea:0x3ffb54a0 0x400dae1a:0x3ffb54c0 0x400db1f4:0x3ffb54e0 0x400d4feb:0x3ffb55a0 0x400d526a:0x3ffb55d0 0x400ebf8c:0x3ffb5600 0x400ec07c:0x3ffb5630 0x400ec386:0x3ffb5660 0x400e875e:0x3ffb5690 0x4008f583:0x3ffb56b0 0x40088b7d:0x3ffb56f0

แต่โค้ดหนูคือโค้ดเชื่อมไวไฟธรรมดาเลยค่ะ หนูไม่ทราบว่ามันยังเก็บค่าโค้ดเดิมไว้หรือว่ายังไงคะ งงมากเลยค่ะ ปล ถ้าสมมุติมันทำงานที่ไฟล์อื่นเราจะรู้ได้ไงว่าไฟล์ไหน แล้วแก้ไขยังไงคะ ขอบคุณค่ะ

อันนี้โค้ดนะคะ

#include <WiFi.h> 

const char* ssid = "";           
const char* password = ""; 

void setup()
{
  Serial.begin(115200);
  Serial.println();

  WiFi.begin(ssid, password);

  Serial.print("Connecting");
  while (WiFi.status() != WL_CONNECTED) {
   // vTaskDelay(1000);
    Serial.print(".");
  }
  Serial.println();

  Serial.print("Connected, IP address: ");
  Serial.println(WiFi.localIP());
}

void loop() {

}

Remy_Martin (Permpol Thanapunnamas) February 9, 2021, 5:11pm #2

#include <WiFi.h> 

const char* ssid = "";           
const char* password = ""; 

void setup()
{
  Serial.begin(115200);
  Serial.println();

  WiFi.begin(ssid, password);

  Serial.print("Connecting");
  while (WiFi.status() != WL_CONNECTED) {
   // vTaskDelay(1000);
    Serial.print(".");
  }
  Serial.println();

  Serial.print("Connected, IP address: ");
  Serial.println(WiFi.localIP());
}

void loop() {
delay(200);
}

ลองทดสอบดูครับ

Yunngongnaidonggluay (Yunngongnaidonggluay) February 10, 2021, 1:04am #3

ไม่ได้ค่ะพี่ ขึ้นเหมือนเดิมเลยค่ะ มันเป็นไปได้ไหมคะที่แบบมันมีโปรแกรมที่รันค้างไว้แล้ว task มันค้าง เราตรวจสอบได้ไหมคะ เครียดมากค่ะต้องทำโปรเจคส่ง ฮือ

Remy_Martin (Permpol Thanapunnamas) February 10, 2021, 1:24am #4

ก็มีแต่ while นี้แหละครับที่ทำให้ค้างลองตัดชุดนี้ออกดู

image

Yunngongnaidonggluay (Yunngongnaidonggluay) February 10, 2021, 2:01pm #6

#include <WiFi.h> 

const char* ssid = "";           
const char* password = ""; 


void setup()
{
  Serial.begin(115200);
  Serial.println();
  WiFi.begin(ssid, password);
  Serial.print("Connecting");
  Serial.println();
  Serial.print("Connected, IP address: ");
  Serial.println(WiFi.localIP());
}


void loop() {
delay(1000);
}

แก้เป็นแบบนี้แล้วแต่ยังไม่ได้เลยค่ะพี่

Remy_Martin (Permpol Thanapunnamas) February 10, 2021, 2:39am #7

#include <WiFi.h>

const char* ssid = “”;
const char* password = “”;

void setup()
{
Serial.begin(115200);
Serial.println();
WiFi.begin(ssid, password);
delay(200);
Serial.print(“Connecting”);
Serial.println();
Serial.print("Connected, IP address: ");
Serial.println(WiFi.localIP());
}

void loop() {
}

Yunngongnaidonggluay (Yunngongnaidonggluay) February 10, 2021, 2:45am #8

ยังรีบูทเหมือนเดิมเลยค่ะ T^T

PUYIOT February 10, 2021, 7:39am #9

Flash ใหม่ครับ

Yunngongnaidonggluay (Yunngongnaidonggluay) February 10, 2021, 8:20am #10

ขอบคุณมากนะคะ ตอนนี้แก้ไขได้แล้วค่ะ ทีนี้อยากทราบวิธีเก็บข้อมูลทุกๆวิเข้า SD card อะค่ะ ไม่ใช้ EEPROM แล้วค่ะ แนะนำหน่อยได้ไหมคะ

PUYIOT February 10, 2021, 8:34am #11

1 Like

Yunngongnaidonggluay (Yunngongnaidonggluay) February 10, 2021, 9:00am #12

หนูใช้ esp32 ต้องแก้ทั้งหมดเลยไหมคะ