When using espduino32 on Arduino IDE, an error message appears: A programmer is required to upload

#include <ESP8266WiFi.h>
#include <Servo.h>
#define IO13 13

const char* ssid = ""; // Enter WiFi network name here
const char* password = ""; // Enter WiFi password here

const int servoPin = 13; // Servo motor pin settings
Servo servo; // Create Servo object

WiFiServer server(80); // Create WiFiServer object

int servoPosition = 0; // Current position of the servo motor (0 degrees or 90 degrees)

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

   servo. attach(servoPin); //connect to servo motor pin

   // WiFi connection
   Serial.println();
   Serial.println("Connecting to WiFi...");
   WiFi.begin(ssid, password);
   while (WiFi.status() != WL_CONNECTED) {
     delay(500);
     Serial.print(".");
   }
   Serial.println("WiFi connected.");
   Serial.print("IP address: ");
   Serial.println(WiFi.localIP());

   server.begin();
}

void loop() {
   WiFiClient client = server.available();
   if (!client) {
     return;
   }

   String request = client.readStringUntil('\r');
   if (request.indexOf("/servo/on") != -1) {
     // When approaching the "/servo/on" path, change the servo motor to ON state.
     if (servoPosition == 0) {
       servo.write(90); // Rotate servo motor to 90 degree position
       servoPosition = 90;
     }
   } else if (request.indexOf("/servo/off") != -1) {
     // When approaching the "/servo/off" path, change the servo motor to OFF state.
     if (servoPosition == 90) {
       servo.write(0); // Rotate servo motor to 0 degree position
       servoPosition = 0;
     }
   }

   // web page response
   client.println("HTTP/1.1 200 OK");
   client.println("Content-Type: text/html");
   client.println();
   client.println("<html><body>");
   client.println("<h1>Servo Control</h1>");
   client.println("<p><a href='/servo/on'>Turn Servo ON</a></p>");
   client.println("<p><a href='/servo/off'>Turn Servo OFF</a></p>");
   client.println("</body></html>");

   client.stop();
}

. Variables and constants in RAM (global, static), used 28556 / 80192 bytes (35%)
║ SEGMENT BYTES DESCRIPTION
╠══ DATA 1504 initialized variables
╠══ RODATA 1196 constants
╚══ BSS 25856 zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 61183 / 65536 bytes (93%)
║ SEGMENT BYTES DESCRIPTION
╠══ ICACHE 32768 reserved space for flash instruction cache
╚══ IRAM 28415 code in IRAM
. Code in flash (default, ICACHE_FLASH_ATTR), used 248420 / 1048576 bytes (23%)
║ SEGMENT BYTES DESCRIPTION
╚══ IROM 248420 code in flash
A programmer is required to upload

Hi @guswls6138. I'm going to ask you to post the full verbose output from an upload attempt.


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


Please do this:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Check the box next to Show verbose output during: ☐ compilation in the "Preferences" dialog.
  3. Check the box next to Show verbose output during: ☐ upload.
  4. Click the "OK" button.
  5. Attempt an upload, just as you did before.
  6. Wait for the upload to fail.
  7. You will see a "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  8. Open a forum reply here by clicking the "Reply" button.
  9. 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.
    Code tags icon on toolbar
  10. Press Ctrl+V.
    This will paste the error output from the upload into the code block.
  11. Move the cursor outside of the code tags before you add any additional text to your reply.
  12. Click the "Reply" button to post the output.

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:

  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 forum reply here by clicking the "Reply" button.
  5. Click the "Upload" icon (Upload icon) on the post composer toolbar:
    Upload icon on toolbar
    A dialog will open.
  6. In the dialog, select the .txt file you saved.
  7. Click the "Open" button.
  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.

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