espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.73k stars 7.43k forks source link

Error pls help #10306

Open SKR-2311 opened 2 months ago

SKR-2311 commented 2 months ago

Board

ESP WROOM 32

Device Description

In file included from C:\Users\USER\Documents\Arduino\libraries\WiFi\src/WiFiSTA.h:29, from C:\Users\USER\Documents\Arduino\libraries\WiFi\src/WiFi.h:33, from C:\Users\USER\AppData\Local\Temp.arduinoIDE-unsaved202487-4112-10o9avr.3gh7\sketch_sep7a\sketch_sep7a.ino:1: C:\Users\USER\Documents\Arduino\libraries\WiFi\src/WiFiGeneric.h:36:10: fatal error: network_provisioning/manager.h: No such file or directory 36 | #include "network_provisioning/manager.h" | ^~~~~~~~ compilation terminated. exit status 1

Compilation error: exit status 1

CODE:

include

// Replace with your network credentials const char ssid = "your_SSID"; const char password = "your_PASSWORD";

// Create an instance of the WiFiServer class WiFiServer server(80);

// Define the pin for the built-in LED const int ledPin = 2; // This is typically the built-in LED on most ESP32 boards

void setup() { // Initialize serial communication Serial.begin(115200);

// Initialize the LED pin as an output pinMode(ledPin, OUTPUT);

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

// Start the server server.begin(); }

void loop() { // Check if a client has connected WiFiClient client = server.available(); if (client) { Serial.println("New Client");

// Wait for data from the client
String request = "";
while (client.connected()) {
  if (client.available()) {
    char c = client.read();
    request += c;
    if (c == '\n') {
      if (request.indexOf("GET /LED=ON") >= 0) {
        digitalWrite(ledPin, HIGH); // Turn the LED on
      }
      if (request.indexOf("GET /LED=OFF") >= 0) {
        digitalWrite(ledPin, LOW); // Turn the LED off
      }
      // Break out of the loop after receiving the full request
      break;
    }
  }
}

// Send an HTTP response to the client
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("Connection: close");
client.println();
client.println("<!DOCTYPE HTML>");
client.println("<html>");
client.println("<h1>ESP32 LED Control</h1>");
client.println("<p><a href=\"/LED=ON\">Turn On LED</a></p>");
client.println("<p><a href=\"/LED=OFF\">Turn Off LED</a></p>");
client.println("</html>");

// Close the connection
client.stop();
Serial.println("Client Disconnected");

} }

PLS HELP HOW TO SOLVE THE ERROR I HAVE TO SUBMIT THE PROJECT IN 2 DAYS PLS HELP

Hardware Configuration

Nothing external

Version

v3.0.4

IDE Name

Arduino IDE

Operating System

Windows 10

Flash frequency

40Mhz

PSRAM enabled

yes

Upload speed

115200

Description

Compilation error: exit status 1

Sketch

#include <WiFi.h>

// Replace with your network credentials
const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";

// Create an instance of the WiFiServer class
WiFiServer server(80);

// Define the pin for the built-in LED
const int ledPin = 2; // This is typically the built-in LED on most ESP32 boards

void setup() {
  // Initialize serial communication
  Serial.begin(115200);

  // Initialize the LED pin as an output
  pinMode(ledPin, OUTPUT);

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

  // Start the server
  server.begin();
}

void loop() {
  // Check if a client has connected
  WiFiClient client = server.available();
  if (client) {
    Serial.println("New Client");

    // Wait for data from the client
    String request = "";
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
        request += c;
        if (c == '\n') {
          if (request.indexOf("GET /LED=ON") >= 0) {
            digitalWrite(ledPin, HIGH); // Turn the LED on
          }
          if (request.indexOf("GET /LED=OFF") >= 0) {
            digitalWrite(ledPin, LOW); // Turn the LED off
          }
          // Break out of the loop after receiving the full request
          break;
        }
      }
    }

    // Send an HTTP response to the client
    client.println("HTTP/1.1 200 OK");
    client.println("Content-Type: text/html");
    client.println("Connection: close");
    client.println();
    client.println("<!DOCTYPE HTML>");
    client.println("<html>");
    client.println("<h1>ESP32 LED Control</h1>");
    client.println("<p><a href=\"/LED=ON\">Turn On LED</a></p>");
    client.println("<p><a href=\"/LED=OFF\">Turn Off LED</a></p>");
    client.println("</html>");

    // Close the connection
    client.stop();
    Serial.println("Client Disconnected");
  }
}

Debug Message

In file included from C:\Users\USER\Documents\Arduino\libraries\WiFi\src/WiFiSTA.h:29,
                 from C:\Users\USER\Documents\Arduino\libraries\WiFi\src/WiFi.h:33,
                 from C:\Users\USER\AppData\Local\Temp\.arduinoIDE-unsaved202487-4112-10o9avr.3gh7\sketch_sep7a\sketch_sep7a.ino:1:
C:\Users\USER\Documents\Arduino\libraries\WiFi\src/WiFiGeneric.h:36:10: fatal error: network_provisioning/manager.h: No such file or directory
   36 | #include "network_provisioning/manager.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: exit status 1

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

lbernstone commented 2 months ago

That file location appears incorrect. WiFi should be part of the board core, which is typically in C:\Users\{username}\AppData\Local\Arduino15\packages\hardware\esp32. If you have manually added this library to your sketch folder, you should remove it. Follow the installation instructions

SKR-2311 commented 2 months ago

Now i get this errror

Sketch uses 908889 bytes (69%) of program storage space. Maximum is 1310720 bytes. Global variables use 44812 bytes (13%) of dynamic memory, leaving 282868 bytes for local variables. Maximum is 327680 bytes. esptool.py v4.6 Serial port COM4 Connecting............Traceback (most recent call last): File "esptool.py", line 37, in File "esptool__init__.py", line 1064, in _main File "esptool__init__.py", line 859, in main File "esptool\cmds.py", line 466, in write_flash File "esptool\util.py", line 37, in flash_size_bytes TypeError: argument of type 'NoneType' is not iterable [8276] Chip is ESP32-D0WD-V3 (revision v3.0) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz MAC: 40:91:51:fc:88:64 Uploading stub... Running stub... Stub running... Changing baud rate to 921600 Changed. WARNING: Failed to communicate with the flash chip, read/write operations will fail. Try checking the chip connections or removing any other hardware connected to IOs. Configuring flash size... Failed to execute script 'esptool' due to unhandled exception! Failed uploading: uploading error: exit status 1

SKR-2311 commented 2 months ago

Pls help @lbernstone

SKR-2311 commented 2 months ago

That file location appears incorrect. WiFi should be part of the board core, which is typically in C:\Users{username}\AppData\Local\Arduino15\packages\hardware\esp32. If you have manually added this library to your sketch folder, you should remove it. Follow the installation instructions

Now i get this help

Sketch uses 908889 bytes (69%) of program storage space. Maximum is 1310720 bytes. Global variables use 44812 bytes (13%) of dynamic memory, leaving 282868 bytes for local variables. Maximum is 327680 bytes. esptool.py v4.6 Serial port COM4 Connecting............Traceback (most recent call last): File "esptool.py", line 37, in File "esptool__init__.py", line 1064, in _main File "esptool__init__.py", line 859, in main File "esptool\cmds.py", line 466, in write_flash File "esptool\util.py", line 37, in flash_size_bytes TypeError: argument of type 'NoneType' is not iterable [8276] Chip is ESP32-D0WD-V3 (revision v3.0) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz MAC: 40:91:51:fc:88:64 Uploading stub... Running stub... Stub running... Changing baud rate to 921600 Changed. WARNING: Failed to communicate with the flash chip, read/write operations will fail. Try checking the chip connections or removing any other hardware connected to IOs. Configuring flash size... Failed to execute script 'esptool' due to unhandled exception! Failed uploading: uploading error: exit status 1

lbernstone commented 2 months ago

WARNING: Failed to communicate with the flash chip, read/write operations will fail. Try checking the chip connections or removing any other hardware connected to IOs.

The flash chip has failed. If you have nothing plugged in, and this is an Espressif devkit, this is likely a hardware failure. Perhaps you can do your homework on http://wokwi.com

SKR-2311 commented 2 months ago

@lbernstone i have to submit only hard ware no software pls understand and how to fix hardware

SuGlider commented 2 months ago

You can try to make the ESP32 enter in download mode before starting the flashing. Hold BOOT button and pulse RESET/EN button. Then flash it.

VojtechBartoska commented 2 months ago

@SKR-2311 Please rename the issue title to something meaningful, it will increase chances that someone will help you.