Ide 2.3.3 compiling problem

Why do I get this compiling error after updating the arduino IDE:

In file included from C:\Users\patri\OneDrive\Documents\Arduino\libraries\WiFiManager/WiFiManager.h:94,
                 from C:\Users\patri\OneDrive\Desktop\SC01 Plus\el_priser_05\el_priser_05.ino:6:
C:\Users\patri\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\libraries\WebServer\src/WebServer.h:211:32: error: 'FS' was not declared in this scope; did you mean 'fs::FS'?
  211 |   typedef std::function<String(FS &fs, const String &fName)> ETagFunction;
      |                                ^~
      |                                fs::FS
In file included from C:\Users\patri\OneDrive\Documents\Arduino\libraries\TFT_eSPI/Processors/TFT_eSPI_ESP32_S3.h:153,
                 from C:\Users\patri\OneDrive\Documents\Arduino\libraries\TFT_eSPI/TFT_eSPI.h:97,
                 from C:\Users\patri\OneDrive\Desktop\SC01 Plus\el_priser_05\el_priser_05.ino:4:
C:\Users\patri\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\libraries\FS\src/FS.h:87:7: note: 'fs::FS' declared here
   87 | class FS {
      |       ^~
C:\Users\patri\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\libraries\WebServer\src/WebServer.h:211:32: error: 'FS' was not declared in this scope; did you mean 'fs::FS'?
  211 |   typedef std::function<String(FS &fs, const String &fName)> ETagFunction;
      |                                ^~
      |                                fs::FS
C:\Users\patri\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\libraries\FS\src/FS.h:87:7: note: 'fs::FS' declared here
   87 | class FS {
      |       ^~
C:\Users\patri\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\libraries\WebServer\src/WebServer.h:211:60: error: template argument 1 is invalid
  211 |   typedef std::function<String(FS &fs, const String &fName)> ETagFunction;
      |                                                            ^
C:\Users\patri\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\libraries\WebServer\src/WebServer.h:211:16: error: '<expression error>' in namespace 'std' does not name a type
  211 |   typedef std::function<String(FS &fs, const String &fName)> ETagFunction;
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\patri\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\libraries\WebServer\src/WebServer.h:212:32: error: 'ETagFunction' has not been declared
  212 |   void enableETag(bool enable, ETagFunction fn = nullptr);
      |                                ^~~~~~~~~~~~
C:\Users\patri\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\libraries\WebServer\src/WebServer.h:229:3: error: 'ETagFunction' does not name a type; did you mean 'TaskFunction_t'?
  229 |   ETagFunction _eTagFunction = nullptr;
      |   ^~~~~~~~~~~~
      |   TaskFunction_t
C:\Users\patri\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\libraries\WebServer\src/WebServer.h:212:50: error: could not convert 'nullptr' from 'std::nullptr_t' to 'int'
  212 |   void enableETag(bool enable, ETagFunction fn = nullptr);
      |                                                  ^~~~~~~
      |                                                  |
      |                                                  std::nullptr_t

exit status 1

Compilation error: exit status 1

Post the source code ij code tags, and the verbose error log in code tags.

#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
#include <TFT_eSPI.h>  // Display library for SC-01
#include <time.h>      // time
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager

// Wi-Fi Credentials
//const char* ssid = "Snackis 2";
//const char* password = "33666999";

// API URL (byt till ditt elområde och dagens datum)
// String apiUrl = "https://www.elprisetjustnu.se/api/v1/prices/2024/09-09_SE4.json";
String apiUrl1;
String apiUrl2;
String apiUrltot;
String responseBody1;
String responseBody2;
String responseBody;
int recTim;
int nuTimme;
int gR = 0, gG = 255, gB = 0; // grön
int mgR = 60, mgG = 80, mgB = 0; // mörkgrön
int dgR = 20, dgG = 20, dgB = 0; // darkmörkgrön
int yR = 255, yG = 210, yB = 6; //gul
int myR = 90, myG = 70, myB = 0; //mörkgul
int dyR = 70, dyG = 50, dyB = 0; //darkmörkgul
int rR = 255, rG = 0, rB = 0; // röd
int mrR = 70, mrG = 15, mrB = 0; // mörkröd
int drR = 60, drG = 10, drB = 0; // darkmörkröd
int oneOrtwopl;
//int recordNo;
// TFT display object
TFT_eSPI tft = TFT_eSPI();

// Uppdateringsintervall i millisekunder (10 minuter = 600000 ms)
//const long updateInterval = 600000;
//const long updateInterval = 3600000;
const long updateInterval = 600000;
unsigned long previousMillis = 0;

// def en struktur för 24h elpriser

typedef struct
{
  int dag;
  int timme;
  float pris;
} record_type;

record_type record[50];

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

  // Initialize display
  tft.init();
  tft.setRotation(1);  // Adjust for landscape or portrait as needed
  tft.fillScreen(TFT_BLACK);
  tft.setTextColor(TFT_WHITE, TFT_BLACK);  // White text on black background
  tft.setTextSize(2);

  // Connect to Wi-Fi
  tft.println("Connecting to WiFi...");
  /*WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting...");
    tft.print(".");
  }*/

      // WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
    // it is a good practice to make sure your code sets wifi mode how you want it.

    // put your setup code here, to run once:
    Serial.begin(115200);
    
    //WiFiManager, Local intialization. Once its business is done, there is no need to keep it around
    WiFiManager wm;

    // reset settings - wipe stored credentials for testing
    // these are stored by the esp library
    // wm.resetSettings();

    // Automatically connect using saved credentials,
    // if connection fails, it starts an access point with the specified name ( "AutoConnectAP"),
    // if empty will auto generate SSID, if password is blank it will be anonymous AP (wm.autoConnect())
    // then goes into a blocking loop awaiting configuration and will return success result

    bool res;
    // res = wm.autoConnect(); // auto generated AP name from chipid
    // res = wm.autoConnect("AutoConnectAP"); // anonymous ap
  // wm.resetSettings();
  //  res = wm.autoConnect("AutoConnectAP","password"); // password protected ap
    res = wm.autoConnect("Elpriser"); // password protected ap

    if(!res) {
        Serial.println("Failed to connect");
        // ESP.restart();
    } 
    else {
        //if you get here you have connected to the WiFi    
        Serial.println("connected...yeey :)");
    }


  Serial.println("Connected!");
  tft.fillScreen(TFT_BLACK);
  tft.println("WiFi connected!");

  // Initial fetch of electricity prices
  fetchElectricityPrices();
}



void fetchElectricityPrices() {

  // tillfälliga rader för att testa structen

  /*
record[0].dag = 3;
record[0].timme = 16;
record[4] = (record_type) {6, 20};

          Serial.printf("Dag: %i, Timme: %i \n", record[0].dag, record[0].timme);
          Serial.printf("Dag: %i, Timme: %i \n", record[4].dag, record[4].timme);
 */


  if (WiFi.status() == WL_CONNECTED) {

    fetchTime:

    // Time settings for NTP synchronization
    configTime(7200, 0, "pool.ntp.org");

    // Wi-Fi connection
    // Wait for time sync
    struct tm timeinfo;
    if (!getLocalTime(&timeinfo)) {
      Serial.println(getLocalTime(&timeinfo));  // extra kollrad
      Serial.println("Failed to obtain time try again");
      goto fetchTime;
 //     return;
    }

    // Skriv ut dagens datum
    Serial.print("Dagens datum: ");
    Serial.printf("%04d-%02d-%02d\n", timeinfo.tm_year + 1900, timeinfo.tm_mon + 1, timeinfo.tm_mday);

    // Lägg till 24 timmar för att få morgondagens tid
    time_t now = time(nullptr);
    time_t tomorrow = now + 86400;  // Lägg till 86400 sekunder (24 timmar)

    // Konvertera till en struct tm för att få datumdelarna
    struct tm* timeinfo_tomorrow = localtime(&tomorrow);

    // Skriv ut morgondagens datum
    Serial.print("Morgondagens datum: ");
    Serial.printf("%04d-%02d-%02d\n", timeinfo_tomorrow->tm_year + 1900, timeinfo_tomorrow->tm_mon + 1, timeinfo_tomorrow->tm_mday);


    // Build API URL dynamically
    char apiBuffer[100];
    snprintf(apiBuffer, sizeof(apiBuffer), "https://www.elprisetjustnu.se/api/v1/prices/%d/%02d-%02d_SE4.json", timeinfo.tm_year + 1900, timeinfo.tm_mon + 1, timeinfo.tm_mday);
    apiUrl1 = String(apiBuffer);
    //  char apiBuffer2[100];
    snprintf(apiBuffer, sizeof(apiBuffer), "https://www.elprisetjustnu.se/api/v1/prices/%d/%02d-%02d_SE4.json", timeinfo_tomorrow->tm_year + 1900, timeinfo_tomorrow->tm_mon + 1, timeinfo_tomorrow->tm_mday);
    apiUrl2 = String(apiBuffer);


    Serial.println(apiUrl1);
    Serial.println(apiUrl2);


    String responseBody;
    String responseBody2;


    HTTPClient http;
    http.begin(apiUrl1);

    int httpResponseCode = http.GET();
    if (httpResponseCode > 0) {
      responseBody1 = http.getString();
      //     Serial.println(httpResponseCode);
      //     Serial.println(responseBody1);

      HTTPClient http;
      http.begin(apiUrl2);

      int httpResponseCode = http.GET();
      if (httpResponseCode > 0) {
        responseBody2 = http.getString();
        //      Serial.println(httpResponseCode);
        //      Serial.println(responseBody2);
        Serial.println(responseBody2.charAt(0));
        if (responseBody2.charAt(0) == '[') {
          responseBody = responseBody1 + responseBody2;
          oneOrtwopl = 47;
        } else {
          responseBody = responseBody1;
          oneOrtwopl = 23;
        }

        //            Serial.println(responseBody);

        int position = responseBody.indexOf("][");
        if (position != -1) {
          responseBody.remove(position, 1);
          char ord = ',';
          responseBody.setCharAt(position, ord);
          //  responseBody.insert(position, ',');
        }

      } else {
        Serial.println("Kunde inte hämta morgondagens data");
        responseBody = responseBody1;
      }

      Serial.println(responseBody1);
      Serial.println(responseBody2);


      Serial.println(responseBody);


      DynamicJsonDocument doc(2048);
      DeserializationError error = deserializeJson(doc, responseBody);

      if (error) {
        Serial.print(F("Failed to parse JSON: "));
        Serial.println(error.f_str());
        tft.fillScreen(TFT_BLACK);
        tft.println("JSON Parse Error");
        return;  // Stop execution if JSON fails
      }

      JsonArray prices = doc.as<JsonArray>();
      if (prices.isNull()) {
        Serial.println("Prices array is null");
        tft.fillScreen(TFT_BLACK);
        tft.println("No prices available");
        return;  // Stop if the array is null
      }

      tft.fillScreen(TFT_BLACK);  // Clear display
      tft.setCursor(0, 0);
      tft.println("Elpriser:");

      int recordNo = 0;

      for (JsonObject price : prices) {
        const char* time = price["time_start"].as<const char*>();
        String timex = price["time_start"];
        float priceValue = price["SEK_per_kWh"];

        // Kontrollera om data är giltig innan bearbetning
        if (time != nullptr && !isnan(priceValue)) {

          // fyll på värden i structen

          record[recordNo].dag = timex.substring(8, 10).toInt();
          record[recordNo].timme = timex.substring(11, 13).toInt();
          record[recordNo].pris = (priceValue + 0.0841) * 1.25;

          Serial.printf("Dag: %i, Timme: %i, Pris: %.2f SEK/kWh, record no: %i\n", record[recordNo].dag, record[recordNo].timme, record[recordNo].pris, recordNo);

          recordNo++;



          //          Serial.printf("Tid: %s, Pris: %.2f SEK/kWh\n", time, priceValue);
          Serial.printf("Dag: %s, Tid: %s, Pris: %.2f SEK/kWh\n", timex.substring(8, 10), timex.substring(11, 13), (priceValue + 0.0841) * 1.25);

          //          tft.printf("Dag: %s, Tid: %s, Pris: %.2f SEK/kWh\n", timex.substring(8,10),timex.substring(11,13), priceValue);
          //         delay(100);  // Delay to make it easier to read
        }
       
        // Ladda nuTimme med nuvarande timme

        nuTimme = timeinfo.tm_hour;


        //            tft.printf("Hej: %s, Tid: %s, Pris: %.2f", timex.substring(8,10),timex.substring(11,13), priceValue);
      }


      Serial.printf("nu timme: %i\n", nuTimme);

      // for (int i = 0; i <= 47 and timeinfo.tm_hour <= record[i].timme; i++) {


      for (int i = 0; i <= 47; i++) {
        //   Serial.printf("Match: %i, recno: %i, innehåll %i\n", timeinfo.tm_hour, i, record[i].timme);
        if (nuTimme == record[i].timme) {
          recTim = i;
          i = 50;
          Serial.printf("Matchx: %i, rec: %i\n", timeinfo.tm_hour, recTim);
        }
      }
//      tft.fillScreen(TFT_BLACK);  // Clear display

      tft.setCursor(5, 2);
      //     tft.println("Elpriser:");

      // stora cirkeln

      if (record[recTim].pris <= 0.25) {
      tft.fillScreen(tft.color565(dgR, dgG, dgB)); 
        tft.fillCircle(240, 100, 90, tft.color565(gR, gG, gB));
        tft.fillCircle(240, 100, 70, tft.color565(mgR, mgG, mgB));
        tft.setTextColor(TFT_WHITE, tft.color565(mgR, mgG, mgB));

      } else {
      tft.fillScreen(tft.color565(dyR, dyG, dyB)); 
        tft.fillCircle(240, 100, 90, tft.color565(yR, yG, yB));
        tft.fillCircle(240, 100, 70, tft.color565(myR, myG, myB));
        tft.setTextColor(TFT_WHITE, tft.color565(myR, myG, myB));

      }
      if (record[recTim].pris >= 0.75) {
      tft.fillScreen(tft.color565(drR, drG, drB)); 
        tft.fillCircle(240, 100, 90, tft.color565(rR, rG, rB));
        tft.fillCircle(240, 100, 70, tft.color565(mrR, mrG, mrB));
        tft.setTextColor(TFT_WHITE, tft.color565(mrR, mrG, mrB));
      }

//      tft.fillCircle(240, 100, 55, TFT_BLACK);

      tft.setCursor(225, 70);
      tft.setTextSize(3);

      tft.printf("%02d", record[recTim].timme);
      tft.setCursor(205, 102);
      tft.printf("%.2f", record[recTim].pris);

//        tft.setTextColor(TFT_WHITE, TFT_BLACK);


      // lilla nr 1

      if (record[recTim + 1].pris <= 0.25) {
        tft.fillCircle(50, 250, 45, tft.color565(gR, gG, gB));
        tft.fillCircle(50, 250, 35, tft.color565(mgR, mgG, mgB));
        tft.setTextColor(TFT_WHITE, tft.color565(mgR, mgG, mgB));
      } else {
        tft.fillCircle(50, 250, 45, tft.color565(yR, yG, yB));
        tft.fillCircle(50, 250, 35, tft.color565(myR, myG, myB));
        tft.setTextColor(TFT_WHITE, tft.color565(myR, myG, myB));
      }
      if (record[recTim + 1].pris >= 0.75) {
        tft.fillCircle(50, 250, 45, tft.color565(rR, rG, rB));
        tft.fillCircle(50, 250, 35, tft.color565(mrR, mrG, mrB));
        tft.setTextColor(TFT_WHITE, tft.color565(mrR, mrG, mrB));
      }

//      tft.fillCircle(50, 250, 35, TFT_BLACK);

      tft.setCursor(40, 230);
      tft.setTextSize(2);

      tft.printf("%02d", record[recTim + 1].timme);
      tft.setCursor(28, 250);
      tft.printf("%.2f", record[recTim + 1].pris);

      // lilla nr 2

      if (record[recTim + 2].pris <= 0.25) {
        tft.fillCircle(145, 250, 45, tft.color565(gR, gG, gB));
        tft.fillCircle(145, 250, 35, tft.color565(mgR, mgG, mgB));
        tft.setTextColor(TFT_WHITE, tft.color565(mgR, mgG, mgB));
      } else {
        tft.fillCircle(145, 250, 45, tft.color565(yR, yG, yB));
        tft.fillCircle(145, 250, 35, tft.color565(myR, myG, myB));
        tft.setTextColor(TFT_WHITE, tft.color565(myR, myG, myB));
      }
      if (record[recTim + 2].pris >= 0.75) {
        tft.fillCircle(145, 250, 45, tft.color565(rR, rG, rB));
        tft.fillCircle(145, 250, 35, tft.color565(mrR, mrG, mrB));
        tft.setTextColor(TFT_WHITE, tft.color565(mrR, mrG, mrB));
      }

//      tft.fillCircle(145, 250, 35, TFT_BLACK);

      tft.setCursor(135, 230);
      tft.setTextSize(2);

      tft.printf("%02d", record[recTim + 2].timme);
      tft.setCursor(123, 250);
      tft.printf("%.2f", record[recTim + 2].pris);

      // lilla nr 3

      if (record[recTim + 3].pris <= 0.25) {
        tft.fillCircle(240, 250, 45, tft.color565(gR, gG, gB));
        tft.fillCircle(240, 250, 35, tft.color565(mgR, mgG, mgB));
        tft.setTextColor(TFT_WHITE, tft.color565(mgR, mgG, mgB));
      } else {
        tft.fillCircle(240, 250, 45, tft.color565(yR, yG, yB));
        tft.fillCircle(240, 250, 35, tft.color565(myR, myG, myB));
        tft.setTextColor(TFT_WHITE, tft.color565(myR, myG, myB));
      }
      if (record[recTim + 3].pris >= 0.75) {
        tft.fillCircle(240, 250, 45, tft.color565(rR, rG, rB));
        tft.fillCircle(240, 250, 35, tft.color565(mrR, mrG, mrB));
        tft.setTextColor(TFT_WHITE, tft.color565(mrR, mrG, mrB));
      }

//      tft.fillCircle(240, 250, 35, TFT_BLACK);

      tft.setCursor(230, 230);
      tft.setTextSize(2);

      tft.printf("%02d", record[recTim + 3].timme);
      tft.setCursor(218, 250);
      tft.printf("%.2f", record[recTim + 3].pris);

      // lilla nr 4

      if (record[recTim + 4].pris <= 0.25) {
        tft.fillCircle(335, 250, 45, tft.color565(gR, gG, gB));
        tft.fillCircle(335, 250, 35, tft.color565(mgR, mgG, mgB));
        tft.setTextColor(TFT_WHITE, tft.color565(mgR, mgG, mgB));
      } else {
        tft.fillCircle(335, 250, 45, tft.color565(yR, yG, yB));
        tft.fillCircle(335, 250, 35, tft.color565(myR, myG, myB));
        tft.setTextColor(TFT_WHITE, tft.color565(myR, myG, myB));
      }
      if (record[recTim + 4].pris >= 0.75) {
        tft.fillCircle(335, 250, 45, tft.color565(rR, rG, rB));
        tft.fillCircle(335, 250, 35, tft.color565(mrR, mrG, mrB));
        tft.setTextColor(TFT_WHITE, tft.color565(mrR, mrG, mrB));
      }

//      tft.fillCircle(335, 250, 35, TFT_BLACK);

      tft.setCursor(325, 230);
      tft.setTextSize(2);

      tft.printf("%02d", record[recTim + 4].timme);
      tft.setCursor(313, 250);
      tft.printf("%.2f", record[recTim + 4].pris);

      // lilla nr 5

      if (record[recTim + 5].pris <= 0.25) {
        tft.fillCircle(430, 250, 45, tft.color565(gR, gG, gB));
        tft.fillCircle(430, 250, 35, tft.color565(mgR, mgG, mgB));
        tft.setTextColor(TFT_WHITE, tft.color565(mgR, mgG, mgB));
      } else {
        tft.fillCircle(430, 250, 45, tft.color565(yR, yG, yB));
        tft.fillCircle(430, 250, 35, tft.color565(myR, myG, myB));
        tft.setTextColor(TFT_WHITE, tft.color565(myR, myG, myB));
      }
      if (record[recTim + 5].pris >= 0.75) {
        tft.fillCircle(430, 250, 45, tft.color565(rR, rG, rB));
        tft.fillCircle(430, 250, 35, tft.color565(mrR, mrG, mrB));
        tft.setTextColor(TFT_WHITE, tft.color565(mrR, mrG, mrB));
      }

//      tft.fillCircle(430, 250, 35, TFT_BLACK);

      tft.setCursor(420, 230);
     tft.setTextSize(2);
 //    tft.setFreeFont(&FreeSans9pt7b);        // För FreeSans storlek 9
//tft.setFreeFont(&FreeSansBold9pt7b);    // För FreeSans Bold storlek 9


      tft.printf("%02d", record[recTim + 5].timme);
      tft.setCursor(408, 250);
      tft.printf("%.2f", record[recTim + 5].pris);

      // skriv ut kommande priser i en färgad "bar"

//      int noOfsegments = oneOrtwopl - recTim - 6;
      int noOfsegments = oneOrtwopl - recTim - 5;
      float segLen = 470.00 / ((float)noOfsegments - 1.00); // minus 1 för att räkna ut mellanrumsstorleken
      int pos = 0;
      int step = 0;
      int stepDif = 0;

       // testa att skriva ut alla records
       for (int i = 0; i <= 47; i++) {
          Serial.printf("nu jäklar blir det koll - Dag: %i, Timme: %i, Pris: %.2f SEK/kWh, record no: %i\n", record[i].dag, record[i].timme, record[i].pris, i);
        } 


      Serial.printf("****** antal segment: %i segments pixellängd: %.2f recTim+6: %i längd på prislista: %i\n", noOfsegments, segLen, recTim+6, oneOrtwopl);

//      for (int i = recTim + 6; i <= oneOrtwopl; i++) {
       for (int g = recTim + 6; g <= oneOrtwopl; g++) {
        // fyll med utskrift av rektanglar
        step = pos * segLen;
//      Serial.printf("** step: %i pos: %i\n", step, pos);
        // Parametrar: drawRect(x, y, bredd, höjd, färg)
        // tft.fillRect(5+(segLen * pos), 305 , segLen, 5, TFT_WHITE); // Rita en vit rektangel
          // Parametrar: fillRoundRect(x, y, bredd, höjd, radie, färg)
        if (record[g].pris <= 0.25) {
//          tft.fillRoundRect(5 + (step), 305, segLen-1, 5, 1, tft.color565(gR, gG, gB));
          tft.fillCircle(5 + (step), 305, 3, tft.color565(gR, gG, gB));
        } else {
//          tft.fillRoundRect(5 + (step), 305, segLen-1, 5, 1, tft.color565(yR, yG, yB));
          tft.fillCircle(5 + (step), 305, 3, tft.color565(yR, yG, yB));
        }
        if (record[g].pris >= 0.75) {
//          tft.fillRoundRect(5 + (step), 305, segLen-1, 5, 1, tft.color565(rR, rG, rB));
          tft.fillCircle(5 + (step), 305, 3, tft.color565(rR, rG, rB));
        }
        
        // printa en svart mellan barsen
        //          tft.fillRect(5 + (segLen * pos), 305, 1, 5, TFT_BLACK);

        Serial.printf("g: %i x: %i stepDif: %i y: %i bredd: %.2f höjd: %i timme: %2d pris: %.2f\n", g, 5 + step, stepDif, 305, segLen, 5, record[g].timme, record[g].pris);

        stepDif = step;
        pos++;
      }
      //     tft.fillRect(5, 305, 100, 5, TFT_WHITE); // Rita en vit rektangel


    } else {
      Serial.printf("Error on HTTP request: %d\n", httpResponseCode);
      tft.fillScreen(TFT_BLACK);
      tft.println("Failed to fetch data.");
    }
    http.end();
  } else {
    tft.fillScreen(TFT_BLACK);
    tft.println("WiFi Disconnected!");
  }
}





void loop() {
  // Check if 10 minutes have passed
  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis >= updateInterval) {
    previousMillis = currentMillis;  // Reset the timer
    // Fetch and display new electricity prices
    fetchElectricityPrices();
  }
}

Your sketch is not compatible with the latest ESP32 board package. There were significant changes when Espressif moved from 2.x to 3.x of their board package. See the migration guide (Migration from 2.x to 3.0 - - — Arduino ESP32 latest documentation).

You can either apply the necessary changes mentioned in the migration guide (I have no idea which ones) or downgrade the board package to version 2.x.

You don't mention which exact board you're compiling for. I've taken the ESP32S3 and encountered your problem; after downgrading the board package to version 2.0.17, it compiles with a warning that needs attention

C:\Users\bugge\AppData\Local\Temp\.arduinoIDE-unsaved2024929-25156-1aa9xk7.x0by\sketch_oct29b\sketch_oct29b.ino:292:25: warning: format '%s' expects argument of type 'char*', but argument 3 has type 'String' [-Wformat=]
           Serial.printf("Dag: %s, Tid: %s, Pris: %.2f SEK/kWh\n", timex.substring(8, 10), timex.substring(11, 13), (priceValue + 0.0841) * 1.25);

Hi @Piddepadde.

Explanation

I investigated the issue and found that there is an incompatibility between the default configuration of the "TFT_eSPI" library and the "esp32" boards platform's "WebServer" library.

The problem is that the default configuration of the TFT_eSPI library defines the SMOOTH_FONT macro:

When the SMOOTH_FONT macro is defined, the library defines the FS_NO_GLOBALS macro:

When the FS_NO_GLOBALS macro is defined, the "esp32" platform's "FS" library has a different configuration:

Which then breaks the "WebServer" library, causing the compilation error.

Here is a minimal sketch that demonstrates the problem:

#include <TFT_eSPI.h>
#include <WebServer.h>
void setup() {}
void loop() {}

or even more minimal:

#define FS_NO_GLOBALS
#include <FS.h>
FS *foo;
void setup() {}
void loop() {}

Solution

Fortunately there is a simple solution to the problem. You only need to change the order of the #include directives in your sketch so that the directive for WebServer.h comes before the directive for TFT_eSPI.h.

So change lines 3-5 of your sketch from this:

#include <TFT_eSPI.h>  // Display library for SC-01
#include <time.h>      // time
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager

To this:

#include <time.h>      // time
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
#include <TFT_eSPI.h>  // Display library for SC-01
4 Likes

Thanks for the suggestions. I have done a reinstallation of the Arduino IDE and downloaded an older version: board package to version 2.0.17. It is an ESP32S3 that I am using. The code has been working before i started to update boards and som libraries - I do not know which but now I have a clean reinstallment and the compilation goes fine but now I have an anoying reboot problem and in the serial monitor it looka like this:

Backtrace: 0x4201998c:0x3fcebc50 0x42019a61:0x3fcebc80 0x42005c93:0x3fcebca0 0x4201f06a:0x3fcebf40




ELF file SHA256: 196ceb39492bc13c

Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0xa (SPI_FAST_FLASH_BOOT)
Saved PC:0x420abf86
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x4bc

and I cannot find the problem.

I also did a order change in the #include statements to this:

#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
#include <time.h>      // time
#include <WiFiManager.h> // https://github.com/tzapu/WiFiManager
#include <TFT_eSPI.h>  // Display library for SC-01

The solution I provided was intended to allow you to use the latest version of the "esp32" boards platform.

Thank you, I will update the esp32 board platform to the latest version and see if the reboot sequence disapear.

Hi, the compilation works even with the updated board version.
I have used the code before and it works fine but now the ESP32S3 board reboots all the time - see the messages that comes in the serial monitor:


Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0xa (SPI_FAST_FLASH_BOOT)
Saved PC:0x4037b38e
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3818,len:0x109c
load:0x403c9700,len:0x4
load:0x403c9704,len:0xb50
load:0x403cc700,len:0x2fe4
entry 0x403c98ac
Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.

Is there anything more than that in Serial Monitor? If not, try resetting the board while Serial Monitor is running to see if it will catch more.

The reason I ask is that the information you shared only tells us that there was an exception, and that the exception is of the "StoreProhibited" type:

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/fatal-errors.html#loadprohibited-storeprohibited

LoadProhibited, StoreProhibited

These CPU exceptions happen when an application attempts to read from or write to an invalid memory location. The address which has been written/read is found in the EXCVADDR register in the register dump. If this address is zero, it usually means that the application has attempted to dereference a NULL pointer. If this address is close to zero, it usually means that the application has attempted to access a member of a structure, but the pointer to the structure is NULL. If this address is something else (garbage value, not in 0x3fxxxxxx - 0x6xxxxxxx range), it likely means that the pointer used to access the data is either not initialized or has been corrupted.

Your sketch is very complex so tracking down the cause of the exception might be difficult. Normally when an exception is thrown, a backtrace is printed to Serial Monitor. This backtrace is very cryptic, but there is an extension you can install in Arduino IDE that will interpret the backtrace and give you information about which part of the sketch program code caused the exception. That information might allow you to identify the bug in your code. However, it is only possible to get that information if you have a backtrace to feed the extension.

Hi, here comes the serial monitor writings from the beginning:

9�!k''a�a�)1BA��q�bc'�i)0B1�X�B�a#��!�a�I)�h#q!�H�DIO, clock div:1
load:0x3fce3818,len:0x109c
load:0x403c9700,len:0x4
load:0x403c9704,len:0xb50
load:0x403cc700,len:0x2fe4
entry 0x403c98ac
Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x4201cce3  PS      : 0x00060230  A0      : 0x8201cdb8  A1      : 0x3fcebbb0  
A2      : 0x00000010  A3      : 0x00000000  A4      : 0x60004000  A5      : 0x0000000d  
A6      : 0x000000ff  A7      : 0x00000000  A8      : 0x08000000  A9      : 0x3fcebb80  
A10     : 0x3fc9a21c  A11     : 0x00000001  A12     : 0x019bfcc0  A13     : 0xffffffff  
A14     : 0x00000031  A15     : 0x00000000  SAR     : 0x00000002  EXCCAUSE: 0x0000001d  
EXCVADDR: 0x00000010  LBEG    : 0x4202153c  LEND    : 0x42021583  LCOUNT  : 0x00000000  


Backtrace: 0x4201cce0:0x3fcebbb0 0x4201cdb5:0x3fcebbe0 0x420060eb:0x3fcebc00 0x4202286f:0x3fcebf30 0x4037fe3e:0x3fcebf50




ELF file SHA256: 4419da59a21e6fd8

Rebooting...
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0xa (SPI_FAST_FLASH_BOOT)
Saved PC:0x4037b38e
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3818,len:0x109c
load:0x403c9700,len:0x4
load:0x403c9704,len:0xb50
load:0x403cc700,len:0x2fe4
entry 0x403c98ac

Hi, I have used the exception decoder and I got this message back but I am not so good at understand the contents of this so pls help me to understand whats gone wrong.

PC: 0x4037b38e: esp_cpu_wait_for_intr at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_hw_support\cpu.c:121
EXCVADDR: 0x00000010

Decoding stack results
0x4201cce0:  is in TFT_eSPI::writecommand(unsigned char) (C:\Users\patri\OneDrive\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:81).
0x4201cdb5:  is in TFT_eSPI::init(unsigned char) (C:\Users\patri\OneDrive\Documents\Arduino\libraries\TFT_eSPI\TFT_eSPI.cpp:692).
0x420060eb: setup() at C:\Users\patri\OneDrive\Desktop\SC01 Plus\el_priser_05\el_priser_05.ino:57
0x4202286f: loopTask(void*) at C:\Users\patri\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\cores\esp32\main.cpp:59
0x4037fe3e: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa\port.c:162

Paste exception to decode...

OK, this does pinpoint the problem to the "TFT_eSPI" library. I see there are some other reports of this problem in the library's bug tracker:

In those reports, it is stated that the problem occurs when using the library with versions of the "esp32" boards platform >2.0.14. So the workaround would be to use the Arduino IDE Boards Manager to install version 2.0.14 of the "esp32" boards platform, then upload the sketch to your ESP32 board again. Hopefully after doing that the problem will no longer occur.

Hi again and thank you for your help. To go back to board version 2.0.14 helped to stop the reboot problem but there is another problem:
The screen is black, it seems like the TFT_eSPI library functions doesn't write the screen content.

It is best to start a project by using a collection of simple sketches to verify that each individual aspect of the project is working perfectly before you start to combine them into the complete project. It is a bad idea to try to just jump into the thing with a complex sketch like the one you have because there are far too many factors.

You can often use the example sketches that come with most libraries for this purpose if you don't want to write your own test sketches. You will find the TFT_eSPI library's example sketches under Arduino IDE's File > Examples > TFT_eSPI menu. Check to see if the same problem occurs after you upload the relevant example sketch (or your own bespoke test sketch if you prefer) of the library to your board.

I just changed the sections of the lines and there was no problem.

#include <WiFiUdp.h>
#include <TFT_eSPI.h>             // version=2.5.30
#include <WiFiManager.h>

#include <WiFiUdp.h>
#include <WiFiManager.h>
#include <TFT_eSPI.h>             // version=2.5.30

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.