Arduino18.0编译WiFi例程到ESP32-USB-OTG出错-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 422|回复: 0

[未解决] Arduino18.0编译WiFi例程到ESP32-USB-OTG出错

[复制链接]
发表于 2022-4-21 21:27 | 显示全部楼层 |阅读模式
错误信息:Arduino:1.8.18 (Windows 10), 开发板:"ESP32-S3-USB-OTG, USB-OTG, UART0 / Hardware CDC, 8M Flash (3MB APP/1.5MB FAT), Debug"
C:\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Arduino\hardware -tools C:\Arduino\tools-builder -tools C:\Arduino\hardware\tools\avr -built-in-libraries C:\Arduino\libraries -libraries C:\Users\abc\Documents\Arduino\libraries -fqbn=espressif:esp32:esp32s3usbotg:USBMode=default,UploadMode=default,PartitionScheme=default_8MB,DebugLevel=debug -vid-pid=10C4_EA60 -ide-version=10818 -build-path C:\Users\abc\AppData\Local\Temp\arduino_build_313823 -warnings=all -build-cache C:\Users\abc\AppData\Local\Temp\arduino_cache_393040 -prefs=build.warn_data_percentage=75 -verbose C:\Arduino\hardware\espressif\esp32\libraries\WiFi\examples\SimpleWiFiServer\SimpleWiFiServer.ino

C:\Arduino\arduino-builder -compile -logger=machine -hardware C:\Arduino\hardware -tools C:\Arduino\tools-builder -tools C:\Arduino\hardware\tools\avr -built-in-libraries C:\Arduino\libraries -libraries C:\Users\abc\Documents\Arduino\libraries -fqbn=espressif:esp32:esp32s3usbotg:USBMode=default,UploadMode=default,PartitionScheme=default_8MB,DebugLevel=debug -vid-pid=10C4_EA60 -ide-version=10818 -build-path C:\Users\abc\AppData\Local\Temp\arduino_build_313823 -warnings=all -build-cache C:\Users\abc\AppData\Local\Temp\arduino_cache_393040 -prefs=build.warn_data_percentage=75 -verbose C:\Arduino\hardware\espressif\esp32\libraries\WiFi\examples\SimpleWiFiServer\SimpleWiFiServer.ino

Using board 'esp32s3usbotg' from platform in folder: C:\Arduino\hardware\espressif\esp32

Using core 'esp32' from platform in folder: C:\Arduino\hardware\espressif\esp32

cmd /c if exist "C:\\Arduino\\hardware\\espressif\\esp32\\libraries\\WiFi\\examples\\SimpleWiFiServer\\partitions.csv" COPY /y "C:\\Arduino\\hardware\\espressif\\esp32\\libraries\\WiFi\\examples\\SimpleWiFiServer\\partitions.csv" "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_313823\\partitions.csv"

cmd /c if not exist "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_313823\\partitions.csv" if exist "C:\\Arduino\\hardware\\espressif\\esp32\\variants\\esp32s3usbotg\\partitions.csv" COPY "C:\\Arduino\\hardware\\espressif\\esp32\\variants\\esp32s3usbotg\\partitions.csv" "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_313823\\partitions.csv"

cmd /c if not exist "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_313823\\partitions.csv" COPY "C:\\Arduino\\hardware\\espressif\\esp32\\tools\\partitions\\default_8MB.csv" "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_313823\\partitions.csv"

cmd /c IF EXIST "C:\\Arduino\\hardware\\espressif\\esp32\\libraries\\WiFi\\examples\\SimpleWiFiServer\\bootloader.bin" ( COPY /y "C:\\Arduino\\hardware\\espressif\\esp32\\libraries\\WiFi\\examples\\SimpleWiFiServer\\bootloader.bin" "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_313823\\SimpleWiFiServer.ino.bootloader.bin" ) ELSE ( IF EXIST "C:\\Arduino\\hardware\\espressif\\esp32\\variants\\esp32s3usbotg\\bootloader.bin" ( COPY "C:\\Arduino\\hardware\\espressif\\esp32\\variants\\esp32s3usbotg\\bootloader.bin" "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_313823\\SimpleWiFiServer.ino.bootloader.bin" ) ELSE ( COPY /y "C:\\Arduino\\hardware\\espressif\\esp32\\tools\\sdk\\esp32s3\\bin\\bootloader_qio_80m.bin" "C:\\Users\\abc\\AppData\\Local\\Temp\\arduino_build_313823\\SimpleWiFiServer.ino.bootloader.bin" ) )

ϵͳ�Ҳ���ָ����·����

exit status 1

为开发板 ESP32-S3-USB-OTG 编译时出错。





例程程序代码:

/*
WiFi Web Server LED Blink

A simple web server that lets you blink an LED via the web.
This sketch will print the IP address of your WiFi Shield (once connected)
to the Serial monitor. From there, you can open that address in a web browser
to turn on and off the LED on pin 5.

If the IP address of your shield is yourAddress:
http://yourAddress/H turns the LED on
http://yourAddress/L turns it off

This example is written for a network using WPA encryption. For
WEP or WPA, change the Wifi.begin() call accordingly.

Circuit:
* WiFi shield attached
* LED attached to pin 5

created for arduino 25 Nov 2012
by Tom Igoe

ported for sparkfun esp32
31.01.2017 by Jan Hendrik Berlin

*/

#include <WiFi.h>

const char* ssid     = "yourssid";
const char* password = "yourpasswd";

WiFiServer server(80);

void setup()
{
    Serial.begin(115200);
    pinMode(5, OUTPUT);      // set the LED pin mode

    delay(10);

    // We start by connecting to a WiFi network

    Serial.println();
    Serial.println();
    Serial.print("Connecting to ");
    Serial.println(ssid);

    WiFi.begin(ssid, password);

    while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
    }

    Serial.println("");
    Serial.println("WiFi connected.");
    Serial.println("IP address: ");
    Serial.println(WiFi.localIP());

    server.begin();

}

int value = 0;

void loop(){
WiFiClient client = server.available();   // listen for incoming clients

  if (client) {                             // if you get a client,
    Serial.println("New Client.");           // print a message out the serial port
    String currentLine = "";                // make a String to hold incoming data from the client
    while (client.connected()) {            // loop while the client's connected
      if (client.available()) {             // if there's bytes to read from the client,
        char c = client.read();             // read a byte, then
        Serial.write(c);                    // print it out the serial monitor
        if (c == '\n') {                    // if the byte is a newline character

          // if the current line is blank, you got two newline characters in a row.
          // that's the end of the client HTTP request, so send a response:
          if (currentLine.length() == 0) {
            // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
            // and a content-type so the client knows what's coming, then a blank line:
            client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println();

            // the content of the HTTP response follows the header:
            client.print("Click <a href=\"/H\">here</a> to turn the LED on pin 5 on.<br>");
            client.print("Click <a href=\"/L\">here</a> to turn the LED on pin 5 off.<br>");

            // The HTTP response ends with another blank line:
            client.println();
            // break out of the while loop:
            break;
          } else {    // if you got a newline, then clear currentLine:
            currentLine = "";
          }
        } else if (c != '\r') {  // if you got anything else but a carriage return character,
          currentLine += c;      // add it to the end of the currentLine
        }

        // Check to see if the client request was "GET /H" or "GET /L":
        if (currentLine.endsWith("GET /H")) {
          digitalWrite(5, HIGH);               // GET /H turns the LED on
        }
        if (currentLine.endsWith("GET /L")) {
          digitalWrite(5, LOW);                // GET /L turns the LED off
        }
      }
    }
    // close the connection:
    client.stop();
    Serial.println("Client Disconnected.");
  }
}

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-11-28 09:23 , Processed in 0.077066 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表