You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i'm struggling with a little projetct. I use Firebase ESP client to open some streams with callbacks and to send DHT22 Sensor Data to a specific topic every minute.
i use the adafruit library <DHT.h> and found some blocking code in there, it also seems that DHT22 is quite slow. Additionaly i log outputs on a SD card for information and debugging. The combination of using firebase and the blocking code of DHT22 seem to sporadically trigger a Interrupt wdt timeout
logging function (does not seem to have an effect on wdt timeout)
voidlog(constchar* format, ...) {
if(!SERIAL_DEBUG)
return;
va_list args;
va_start(args, format);
int formatted_length = vsnprintf(nullptr, 0, format, args);
if (formatted_length < 0) {
Serial.println("Formatting error");
va_end(args);
return;
}
va_end(args);
char* formatted_message = (char*)malloc(formatted_length + 1); // +1 für das Nullzeichenif (formatted_message) {
vsnprintf(formatted_message, formatted_length + 1, format, args);
time_t now;
structtm timeinfo;
time(&now);
localtime_r(&now, &timeinfo);
char timestamp[11]; // [hh:mm:ss] mit Nullterminierungsnprintf(timestamp, sizeof(timestamp), "[%02d:%02d:%02d]", timeinfo.tm_hour, timeinfo.tm_min, timeinfo.tm_sec);
Serial.print(timestamp);
Serial.print("");
Serial.println(formatted_message);
if(SD_DEBUG && SD_STATUS){
logfile = SD.open("/log.txt", FILE_APPEND);
if(logfile){
logfile.print(timestamp);
logfile.print("");
logfile.println(formatted_message);
logfile.close();
SD_FAILURE_COUNT = 0;
}
else{
SD_FAILURE_COUNT++;
Serial.printf("SD Failure no: %i\n", SD_FAILURE_COUNT);
if(SD_FAILURE_COUNT > 2){
Serial.println("LOGFILE CANNOT BE OPENED DEACTIVATE SD");
//SD.end(); <-- Führt zu crash wenn SD nicht mehr da ist //File konnte drei mal nicht geöffnet werden...
SD_STATUS = false;
}
}
}
free(formatted_message);
} else {
Serial.println("Memory allocation error");
free(formatted_message);
}
}
i debugged the Backtrace and PC with following information:
PC:
0x400fb465: DHT::expectPulse(bool) at E:\.../.pio/libdeps/esp32doit-devkit-v1/DHT sensor library/DHT.cpp:382
Backtrace:
0x400ff8c9: loopTask(void*) at C:/Users/.../.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp:50
0x400d3bf5: loop() at E:\.../src/main copy.cpp:456
0x400fb5dd: DHT::readTemperature(bool, bool) at E:\.../.pio/libdeps/esp32doit-devkit-v1/DHT sensor library/DHT.cpp:88
0x400fb54d: DHT::read(bool) at E:\.../.pio/libdeps/esp32doit-devkit-v1/DHT sensor library/DHT.cpp:306
0x400fb462: DHT::expectPulse(bool) at E:\.../.pio/libdeps/esp32doit-devkit-v1/DHT sensor library/DHT.cpp:382
Error: Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1).
so what would be the best solution for this issue? Of course i could just use a faster and more reliable sensor, but i would like to use the hardware i have for now..
Maybe just raise the time for timeout, how could i do this?
Feed the watchdog before and after trying to get DHT22 data?
And another big problem is this Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1). does not trigger a reset of the ESP which means it gets completley stuck, how to solve this? I think that one came with the update from framwork 2.0.11 to 2.0.14 but I'm not 100% sure..
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
hi all,
i'm struggling with a little projetct. I use Firebase ESP client to open some streams with callbacks and to send DHT22 Sensor Data to a specific topic every minute.
Sensor Data is refreshing every 5s:
i use the adafruit library
<DHT.h>
and found some blocking code in there, it also seems that DHT22 is quite slow. Additionaly i log outputs on a SD card for information and debugging. The combination of using firebase and the blocking code of DHT22 seem to sporadically trigger a Interrupt wdt timeoutlogging function (does not seem to have an effect on wdt timeout)
i debugged the Backtrace and PC with following information:
versions:
Error:
Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1).
so what would be the best solution for this issue? Of course i could just use a faster and more reliable sensor, but i would like to use the hardware i have for now..
Maybe just raise the time for timeout, how could i do this?
Feed the watchdog before and after trying to get DHT22 data?
And another big problem is this
Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1).
does not trigger a reset of the ESP which means it gets completley stuck, how to solve this? I think that one came with the update from framwork 2.0.11 to 2.0.14 but I'm not 100% sure..br
Beta Was this translation helpful? Give feedback.
All reactions