Guru Meditation Error: Core 1 panic'ed (Coprocessor exception) nodemcu ESP32

Guru Meditation Error: Core 1 panic'ed (Coprocessor exception)
Core 1 register dump:
PC : 0x400813b0 PS : 0x00050031 A0 : 0x40087044 A1 : 0x3ffbfde0
A2 : 0x3ffbdcc0 A3 : 0x00000001 A4 : 0x00000001 A5 : 0x00000000
A6 : 0x64842da6 A7 : 0x64842da6 A8 : 0x0000007b A9 : 0x3ff6e000
A10 : 0x3ffb84b0 A11 : 0x00000180 A12 : 0x00000000 A13 : 0x3ffb8058
A14 : 0x00000001 A15 : 0x00000000 SAR : 0x0000001d EXCCAUSE: 0x00000004
EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff
Core 1 was running in ISR context:
EPC1 : 0x400813b0 EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x40087778

ELF file SHA256: Guru Meditation Error: Core 1 panic'ed (Coprocessor exception)
Core 1 register dump:
PC : 0x40086930 PS : 0x00060035

How can i fix this error?? i'm use Nodemcu esp32 devkit v1 board and use freertos and also Hardware serial for serial communicate

He'res my code

#include <Arduino.h>

#include <WiFi.h>          

#include <DNSServer.h>

#include <WebServer.h>

#include <WiFiManager.h>  

#include <FirebaseESP32.h>

#include <ArduinoJson.h>

#include "time.h"

#include <MFRC522.h> //library responsible for communicating with the module RFID-RC522

#include <SPI.h> //library responsible for communicating of SPI bus

#define SS_PIN    21

#define RST_PIN   22

#define SIZE_BUFFER     18

#define MAX_SIZE_BLOCK  16

MFRC522::MIFARE_Key key;

//authentication return status code

MFRC522::StatusCode status;

// Defined pins to module RC522

MFRC522 rfid(SS_PIN, RST_PIN);

#define FIREBASE_HOST "*********************/"

#define FIREBASE_AUTH "*********************"

int humTst = 0;

int tempTst = 0;

byte nuidPICC[4];

HardwareSerial Slave(2);

FirebaseData firebaseData;

String path PROGMEM = "ALLSTATE/";

String jadwal PROGMEM = "Jadwal/";

String ruangan = "D1.2/Suhu";

const char* ntpServer = "asia.pool.ntp.org";

const long  gmtOffset_sec = 25200;

const char* strTime[4];

float getTime[4];

const int  daylightOffset_sec = 0;

void printLocalTime()

{

  struct tm timeinfo;

  if(!getLocalTime(&timeinfo)){

    Serial.println("Failed to obtain time");

    return;

  }

  Serial.println(&timeinfo, "%A, %B %d %Y %H:%M:%S");

}

float getHour(){

  struct tm timeinfo;

  if(!getLocalTime(&timeinfo)){

    Serial.println("Failed to obtain time");

  }

  char HourStr [6];

  strftime(HourStr,6, "%H.%M", &timeinfo);

  String Hour = String(HourStr);

  return Hour.toFloat();

}

String getDay(){

  struct tm timeinfo;

  if(!getLocalTime(&timeinfo)){

    Serial.println("Failed to obtain time");

  }

  char timeWeekDay[10];

  strftime(timeWeekDay,10, "%A", &timeinfo);

  return timeWeekDay;

}

String day = "";

void printHex(byte *buffer, byte bufferSize) {

  for (byte i = 0; i < bufferSize; i++) {

    Serial.print(buffer[i] < 0x10 ? " 0" : " ");

    Serial.print(buffer[i], HEX);

  }

}

void checkAbsen(void *param);

void sendFB(void *param);

void setup() {

  Serial.begin(115200);

  Slave.begin(115200);

  SPI.begin(); // Init SPI bus

  day = "Jadwal/" + getDay();

  WiFiManager wifiManager;

  wifiManager.autoConnect("MARS", "D1.2");

  rfid.PCD_Init();

    for (byte i = 0; i < 6; i++) {

    key.keyByte[i] = 0xFF;

  }

  Serial.println(F("This code scan the MIFARE Classsic NUID."));

  Serial.print(F("Using the following key:"));

  printHex(key.keyByte, MFRC522::MF_KEY_SIZE);

  Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);

  Firebase.reconnectWiFi(true);

  Serial.println(F("Succes Firebase"));

  configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);

  printLocalTime();

  xTaskCreate(

    checkAbsen,

    "absensi",

    5000,

    NULL,

    1,

    NULL

  );

  xTaskCreate(

    sendFB,

    "Firebase",

    5000,

    NULL,

    1,

    NULL

  );

}

void loop() {}    

void sendFB(void *param){

  for(;;){

  StaticJsonDocument<256> root;

  if(Slave.available () > 0){

   deserializeJson(root, Slave);

   int temp = root["Suhu"];

  //  int hum = root["Hum"];

   if(tempTst != temp){

    if(Firebase.setInt(firebaseData, path + ruangan,temp)){

      Serial.println(F("Success"));

    }

    tempTst = temp;

   }

  }

 }

}

void checkAbsen(void * param){

  for(;;){

    if (rfid.PICC_IsNewCardPresent() && rfid.PICC_ReadCardSerial()){

      String Cardid = "";

      for(byte i=0; i < rfid.uid.size ; i++){

        Cardid.concat(String(rfid.uid.uidByte[i] < 0x10 ? "0" : " "));

        Cardid.concat(String(rfid.uid.uidByte[i], HEX));

      }

      Serial.println(Cardid);

      if(getHour() >= 07.30 && getHour() < 09.30){

        if(Firebase.setString(firebaseData,path + Cardid + "/Status","Mapel 1")){

          Serial.println(F("Succes Set Status"));

        }else{

          firebaseData.errorReason().c_str();

        }

      }else if(getHour() >= 09.30 && getHour() < 10.00){

        if(Firebase.setString(firebaseData,path + Cardid + "/Status","Istirahat")){

          Serial.println(F("Succes Set Status"));

        }else{

          firebaseData.errorReason().c_str();

        }

      }else if(getHour() >= 10.00 && getHour() < 12.00){

        if(Firebase.setString(firebaseData,path + Cardid + "/Status","Mapel 2")){

          Serial.println(F("Succes Set Status"));

        }else{

          firebaseData.errorReason().c_str();

        }

      }else if(getHour() > 12.00){

        if(Firebase.setString(firebaseData,path + Cardid + "/Status","Pulang")){

          Serial.println(F("Succes Set Status"));

        }else{

          firebaseData.errorReason().c_str();

        }

      }

      Serial.println(getHour());

    }

    vTaskDelay(1000/ portTICK_PERIOD_MS);

  }

}

@zereeef, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advise on) your project :wink: See About the Installation & Troubleshooting category.

Please edit your post, select all code and click the </> button to apply so-called code tags and next save your post. It makes it easier to read, easier to copy and prevents the forum software from incorrect interpretation of the code.

When you put the debug dump into the ESP Exception decoder, you can look it up on the internet on how to install it into the IDE, what message does the decoder give?

Have you tuned your tasks for memory use?

void MQTTkeepalive( void *pvParameters )
{
  sema_MQTT_KeepAlive   = xSemaphoreCreateBinary();
  xSemaphoreGive( sema_MQTT_KeepAlive ); // found keep alive can mess with a publish, stop keep alive during publish
  // setting must be set before a mqtt connection is made
  MQTTclient.setKeepAlive( 90 ); // setting keep alive to 90 seconds makes for a very reliable connection, must be set before the 1st connection is made.
  for (;;)
  {
    //check for a is-connected and if the WiFi 'thinks' its connected, found checking on both is more realible than just a single check
    if ( (wifiClient.connected()) && (WiFi.status() == WL_CONNECTED) )
    {
      xSemaphoreTake( sema_MQTT_KeepAlive, portMAX_DELAY ); // whiles MQTTlient.loop() is running no other mqtt operations should be in process
      MQTTclient.loop();
      xSemaphoreGive( sema_MQTT_KeepAlive );
    }
    else {
      log_i( "MQTT keep alive found MQTT status %s WiFi status %s", String(wifiClient.connected()), String(WiFi.status()) );
      if ( !(wifiClient.connected()) || !(WiFi.status() == WL_CONNECTED) )
      {
        connectToWiFi();
      }
      connectToMQTT();
    }
    vTaskDelay( 250 ); //task runs approx every 250 mS
    //log_i( " high watermark %d",  uxTaskGetStackHighWaterMark( NULL ) );
  }
  vTaskDelete ( NULL );
}
////

Using log_i( " high watermark %d", uxTaskGetStackHighWaterMark( NULL ) ); you can get a readout of the stack space being used, I set my stack size 2000 more bytes then the highest stack sized printed.

It is VERY important to use vTaskDelete ( NULL ); in your taskings. In case a task jumps its stack freeRTOS may be able to stop it.