A valid ESP32 sketch would uplaod without error about the beginning of the year - Now giving error codes

I could upload my ESP32 Vroom

Now I get this error message for the same code, using the same ESP32
File not found "executable": "C:/Users\iwils\AppData\Local\arduino\sketches\72112B1ABC817C8A30D391B805819AEA\ESP32_MultDS_Server1.ino.elf"

[code]

//https://lastminuteengineers.com/multiple-ds18b20-esp32-web-server-tutorial/
#include <WiFi.h>
#include <WebServer.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Adafruit_Sensor.h>
#include <DHT.h>
//param = DHT22 signal pin
#define DHTPIN 27 // Digital pin connected to the DHT sensor
#define DHTTYPE DHT22 // DHT 27 (AM2302)
DHT dht(DHTPIN, DHTTYPE);

// Data wire is plugged into port 26 on the ESP32
#define ONE_WIRE_BUS 26
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
uint8_t sensor1[8] = { 0x28, 0xDF, 0x6A, 0x56, 0xB5, 0x01, 0x3C, 0xD3 };
uint8_t sensor2[8] = { 0x28, 0x9D, 0x9C, 0x76, 0xE0, 0x01, 0x3C, 0xCC };
uint8_t sensor3[8] = { 0x28, 0x47, 0x2F, 0x75, 0xD0, 0x01, 0x3C, 0x90 };
uint8_t sensor4[8] = { 0x28, 0xBF, 0x1C, 0x75, 0xD0, 0x01, 0x3C, 0x89 };


/*Put your SSID & Password*/
const char* ssid = "Wilsons";  // Enter SSID here
const char* password = "i9a1n123";  //Enter Password here

WebServer server(80);    

// Set your Static IP address ADDED***
IPAddress local_IP(10, 0, 0, 37);
// Set your Gateway IP address
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 0, 0);

float tempSensor1, tempSensor2, tempSensor3, tempSensor4;
 
void setup() {
  Serial.begin(115200);

  // Configures static IP address
if (!WiFi.config(local_IP, gateway, subnet)) {
  Serial.println("STA Failed to configure");
}
  delay(100);
  
  sensors.begin();              
 
  dht.begin(); //initialise DHT22
  
  Serial.println("Connecting to ");
  Serial.println(ssid);

  //connect to your local wi-fi network
  WiFi.begin(ssid, password);

  //check wi-fi is connected to wi-fi network
  while (WiFi.status() != WL_CONNECTED) {
  delay(1000);
  Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected..!");
  Serial.print("Got IP: ");  Serial.println(WiFi.localIP());
// Print ESP MAC Address
  Serial.println("ESP MAC address: ");
  Serial.println(WiFi.macAddress());
  server.on("/", handle_OnConnect);
  server.onNotFound(handle_NotFound);

  server.begin();
  Serial.println("HTTP server started");

}
void loop() {
  server.handleClient();
}

void handle_OnConnect() {
  sensors.requestTemperatures();
  tempSensor1 = sensors.getTempC(sensor1); // Gets the values of the temperature
  tempSensor2 = sensors.getTempC(sensor2);
  tempSensor3 = sensors.getTempC(sensor3);
  tempSensor4 = sensors.getTempC(sensor4); 
 if (tempSensor1 < -100) tempSensor1 =-10;
 if (tempSensor2 < -100) tempSensor2 =-10;
 if (tempSensor3 < -100) tempSensor3 =-10;
 if (tempSensor4 < -100) tempSensor4 =-10;
// Read the humidity in %:
  float h = dht.readHumidity();//
  // Read the temperature as Celsius:
  float t = dht.readTemperature(); 
// Check if any reads failed and exit early (to try again):

server.send(200, "text/html", SendHTML(tempSensor1,tempSensor2,tempSensor3,tempSensor4,h,t));
}

void handle_NotFound(){
  server.send(404, "text/plain", "Not found");
}

String SendHTML(float tempSensor1,float tempSensor2,float tempSensor3,float tempSensor4, float h, float t){
  String ptr = "<!DOCTYPE html> <html>\n";
ptr += "<head><meta name=\"viewport\" content=\"width=device-width,initial-scale=1.u0s,e r-scalable=no\">\n";
ptr += "<title>Stepup Energy Systems</title>\n";
ptr += "<style>html { font-family: Helvetica; display: inline-block; margin: 0px auto; text-align: center;}\n";
ptr += "body{margin-top: 50px;} h1 {color: #444444;margin: 50px auto 30px;}\n";
ptr += "p {font-size: 24px;color: #444444;margin-bottom: 10px;}\n";
ptr += "p1 {font-size: 8px;color: #444444;margin-bottom: 10px;}\n";
ptr += "</style>\n";
ptr += "<script>\n";
ptr += "setInterval(loadDoc,1000);\n";
ptr += "function loadDoc() {\n";
ptr += "var xhttp = new XMLHttpRequest();\n";
ptr += "xhttp.onreadystatechange = function() {\n";
ptr += "if (this.readyState == 4 && this.status == 200) {\n";
ptr += "document.body.innerHTML =this.responseText}\n";
ptr += "};\n";
ptr += "xhttp.open(\"GET\", \"/\", true);\n";
ptr += "xhttp.send();\n";
ptr += "}\n";
ptr += "</script>\n";
ptr += "</head>\n";
ptr +="<script>\n";
ptr +="setInterval(loadDoc,1000);\n";
ptr +="function loadDoc() {\n";
ptr +="var xhttp = new XMLHttpRequest();\n";
ptr +="xhttp.onreadystatechange = function() {\n";
ptr +="if (this.readyState == 4 && this.status == 200) {\n";
ptr +="document.body.innerHTML =this.responseText}\n";
ptr +="};\n";
ptr +="xhttp.open(\"GET\", \"/\", true);\n";
ptr +="xhttp.send();\n";
ptr +="}\n";
ptr +="</script>\n";
ptr += "<body>\n";

ptr += "<p>Geyser : ";
ptr += tempSensor1;
ptr += "&deg;C</p>";
ptr += "<p>Panel to geyser : ";
ptr += tempSensor2;
ptr += "&deg;C</p>";
ptr += "<p>Geyser to panel : ";
ptr += tempSensor4;
ptr += "&deg;C</p>";

ptr += "<p>Temperature & Humidity: ";
ptr += t;
ptr += "&deg;C &  ";
ptr += h;
ptr += "&#37;</p>";
ptr += "<p> </p>";
ptr += "</div>\n";
ptr += "<p1>SP32_MultiDS_Server1</p1>";
ptr += "</body>\n";
ptr += "</html>\n";
return ptr;
}

[/code]

Hi @ianow. I'm going to ask you to provide the full output from a compilation.


:red_exclamation_mark: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Open your sketch in Arduino IDE.
  2. Select Sketch > Verify/Compile from the Arduino IDE menus.
  3. Wait for the compilation to fail.
  4. You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  5. Open a reply here on this forum topic by clicking the "Reply" button.
  6. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
  7. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the compilation output into the code block.
  8. Move the cursor outside of the code block markup before you add any additional text to your reply.
  9. Click the "Reply" button to publish the post.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here.

Click here for attachment instructions

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a reply here on this forum topic by clicking the "Reply" button.
  5. Click the "Upload" icon (Upload icon) on the post composer toolbar:

    The "Open" dialog will open.
  6. Select the .txt file you saved from the "Open" dialog.
  7. Click the "Open" button.
    The dialog will close.
  8. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

The error code was huge
Here is the txt file

Code with errors.txt (122.6 KB)

hello,

if your sketch once compiled well there basicly is no problem with the sketch. The problem is your PC or the installed SW components related to the IDE. Now what you can check or remember:

did you change your PC ?

did you upgrade or reinstall the Arduino IDE ?

did you remove or relocate libraries ?

did you upgrade the Boardplatform (Boards Manager) ?

did you select the right processor board before compiling ?

What I see in the first line of the error messages there is just missing a file somewhere inside of the IDE relevant directory.

OK, great. The error message in that output is different from what you provided in post #1

xtensa-esp-elf-g++.exe: fatal error: cannot execute 'C:/Users/iwils/AppData/Local/Arduino15/packages/esp32/tools/esp-x32/2411/bin/../libexec/gcc/xtensa-esp-elf/14.2.0/cc1plus.exe': CreateProcess: No such file or directory

The cc1plus.exe file should indeed be located at the specified path. It may be missing due to your antivirus/security software having quarantined it. If so, if you can recover it from the quarantine and configure the antivirus so that it won't quarantine it once again, then that should fix the problem.

Thank you
I will check again

Generally these issues arises due to upgradation of Libraries and Board Compliers.

Downgrade to ESP32 ver 2 instead of current 3 version.

I have not reviewed your Error file / Code, just sharing from experience , I had to downgrade for few old codes

Somehow the Arduino IDE has been upgraded and nothing is in place anymore.

Now when I click Tools - Manage library, there is a list in the left pane. All I get is a long list of several hundred irrelevant (to me) items for installation. The old list of modules for me to include is missing.

If you value your privacy I suggest not to use email to reply to messages. Your phone number and some other details are visible in your post #6.

The list in the left pane are all libraries that are submitted to Arduino. You can filter for installed libraries

If you did install libraries from a ZIP archive (e.g. from github) they will not show in the library manager,

To see which libraries are actually installed you can navigate to the libraries directory under the sketchbook directory (probably C:\Users\iwils...\Arduino\libraries).

PS
We're kind-of neighbours.

Thank you.
You have identified my problem.
The Library folder is missing. It could have happened when I replaced my broken laptop

The libraries directory is created when you install the first library; not sure if this applies to manually installing from a zip (I think it does) but it definitely is created when you install using library manager.