Background reading

Understand ESP32 Sketches and Serial Output

Already completed the first upload? Read a matching Serial sketch, understand setup() and loop(), and separate compiler, upload and runtime output checks.

18 min read · Updated 2026-11-04

Supplied Serial Monitor capture showing Hello from ESP32 at 115200 baud; recorded with core 2.0.17
Reference Guide

Understand ESP32 Sketches and Serial Output

The Story

Your first upload is working. Now connect each message in Serial Monitor to the sketch that produced it, and learn which checks happen at compilation, transfer and runtime.

Explain Like I'm 12

Arduino IDE is the app where you write small programs called sketches. The ESP32 board package teaches Arduino IDE how to compile those sketches for ESP32 boards and upload them through USB.

Review, Testing, and References

Author: Abdul Mubeen and the ESP32 Engine editorial team. Last updated: 2026-11-04. Reviewed: educational accuracy and beginner safety. Level: Beginner. Estimated time: 18 min read.

This guide is written for learning and bench prototyping. Check the testing notes before adapting the circuit to different boards, batteries, relays, motors, or outdoor hardware.

Jump to a section

Read and understand an Arduino IDE session

Use this reference after the first-upload setup works. Follow the recorded Serial sketch, distinguish compiling from transferring firmware, and connect the messages to setup() and loop().

The supplied captures document Arduino IDE 2.3.10, Espressif core 2.0.17 and the Hello sketch below. They do not establish a hardware test on the separate 3.3.2 documentation-review baseline.

What you need before starting

  • ESP32 development board: a common ESP32 DevKit or ESP32-WROOM board with USB.
  • USB data cable: many charging cables power the board but cannot upload code.
  • Computer: Windows, macOS, or Linux with permission to install software.
  • Arduino IDE 2.x: the current beginner-friendly Arduino editor.
  • Internet access: needed for package, dependency and later update downloads.

If you are still choosing a board, read the ESP32 DevKit component guide first. It explains USB, pins, power, and why ESP32 GPIO is 3.3 V.

What Arduino IDE does for ESP32

Arduino IDE is the program where you write sketches. A sketch is a small C++ program with two important functions: setup(), which runs once, and loop(), which repeats.

Arduino IDE does not support ESP32 by default. You add the official Espressif board package so the IDE knows which compiler, upload tool, board menu, and ESP32 core libraries to use. After that, uploading to ESP32 feels similar to uploading to a classic Arduino board, but the voltage, pin behavior, and board selection are ESP32-specific.

Setup prerequisites and the installation route

Complete the Arduino IDE installation and first-upload guide before using this reference. It is the full procedure for package installation, board selection and USB recovery.

The installation lesson prints ESP32 upload OK. The separate sketch below prints Hello from ESP32 and matches the supplied Serial-session captures on this page.

Verify and upload the recorded Serial sketch

This recorded-session example needs only USB and Serial Monitor. It does not depend on an onboard LED or external circuit.

esp32_serial_session.ino
void setup() {
    Serial.begin(115200);
    delay(1000);
    Serial.println("ESP32 is running from Arduino IDE!");
  }

  void loop() {
    Serial.println("Hello from ESP32");
    delay(1000);
  }
  1. Copy the sketch into Arduino IDE.
  2. Click Verify to compile for the selected board. A successful compile does not transfer firmware or test the physical circuit.
  3. Click Upload to compile and transfer firmware through the selected port. A successful transfer is separate from observing the expected program output.
  4. Wait for the upload to finish and the board to reset.

A successful upload usually ends with a message similar to Hard resetting via RTS pin. The wording can vary by board and Arduino core version.

Supplied Serial upload session

Explore the build photos and recorded results. Open any image to inspect the details.

About this recorded build

The supplied screenshots record Arduino IDE 2.3.10, Espressif core 2.0.17, ESP32 Dev Module and COM7. The visible sketch matches this reference’s Serial-only example and prints Hello from ESP32 once per second.

A recorded 2.0.17 session does not establish testing on Arduino-ESP32 3.3.2, which remains the site’s 3.x API review baseline. The separate beginner installation guide has a first sketch that prints ESP32 upload OK.

ESP32 Dev Module and COM7 selected in Arduino IDE board and port dialog
Image 01

ESP32 Dev Module and COM7 are selected for this supplied session. Choose the profile for your actual board; your COM number can differ.

View full-size image
Arduino IDE showing the complete Serial demonstration sketch and Done uploading notification
Image 02

The supplied capture reports Done uploading and a verified data hash. It records this Serial demonstration, not the Blink sketch or an independent retest.

View full-size image
Arduino Serial Monitor at 115200 baud displaying repeated Hello from ESP32 messages
Image 03

The supplied Serial Monitor capture shows Hello from ESP32 on COM7 at 115200 baud. Your port and room setup can differ.

View full-size image

Interpret the Serial Monitor messages

  1. Open Tools > Serial Monitor.
  2. Set the baud rate to 115200.
  3. Press the board's EN or RESET button if the first line does not appear.

You should now see ESP32 is running from Arduino IDE!, followed by Hello from ESP32 once per second. That proves the board package, board selection, port selection, upload process, and serial monitor are all working together.

How setup() and loop() produce the output

LineWhat it meansWhy it matters
setup()Runs once after reset.Good place to start Serial, configure pins, and print a ready message.
Serial.begin(115200)Starts serial communication at 115200 baud.Serial Monitor must use the same baud rate.
loop()Runs repeatedly forever.Most beginner ESP32 behavior starts here.
delay(1000)Waits for 1000 milliseconds.Slows the messages so you can read them.

Later projects replace the Serial message with GPIO output, button input, sensor readings, OLED display updates, Wi-Fi requests, and MQTT messages.

If your board has a documented user LED, you can blink it after Serial output works. Do not assume every ESP32 board uses GPIO2. Some boards use a different GPIO, and some have no user LED.

For a reliable beginner hardware check, follow the dedicated Blink an LED with ESP32 mission. It uses an external LED, a resistor, and a clear wiring diagram, so the result does not depend on a board-specific onboard LED.

Common ESP32 Arduino IDE problems

ProblemLikely causeSafest fix
ESP32 board does not appear in Boards ManagerBoard manager URL missing or mistyped.Recheck the Espressif URL in Preferences, restart Arduino IDE, then search for esp32 again.
No COM or serial port appearsCharge-only cable, missing driver, bad port, or unsupported USB adapter.Try a known data cable, another USB port, and identify its actual USB bridge and install only its manufacturer driver if needed; CP210x, CH34x and FTDI adapters differ.
Upload says Failed to connectESP32 did not enter bootloader mode.For a documented classic BOOT/EN board, hold BOOT, tap EN, start upload, then release BOOT when writing begins. Lower upload speed if needed.
Port busy or access deniedSerial Monitor, another IDE, or a terminal app is using the port.Close Serial Monitor and other serial tools, unplug and reconnect the board, then upload again.
Sketch compiles for the wrong chipWrong board selected.Select the exact ESP32 family or a safe generic entry for your DevKit, then compile again.
Serial Monitor shows unreadable textBaud rate mismatch.Set Serial Monitor to the same baud rate as Serial.begin(), usually 115200.
Upload worked but no Serial output appearsBoard did not reset, wrong baud rate, or native USB setting differs.Press EN/RESET, check 115200 baud, and review USB CDC settings for native USB ESP32-S3 or C3 boards.
Linux permission deniedUser account cannot access serial devices.Add your user to the serial or dialout group according to your distro, log out, and reconnect the board.

BOOT, EN and the upload stage

On the classic UART DevKit used here, EN resets the chip and BOOT selects the download-mode input during reset. An error while connecting to the bootloader is different from a compiler error that occurs before transfer.

Use the documented classic BOOT/EN recovery procedure when appropriate for your board. Native USB C3/S2/S3 boards need their own documented settings; the classic sequence is not universal.

What to learn next

Once Serial output works, follow a build-first path. Each step uses a real existing ESP32 Engine page:

  1. Understand ESP32 basics so 3.3 V GPIO and board families make sense.
  2. Blink an LED to control a GPIO output safely.
  3. Control an LED with a button to read digital input.
  4. Learn floating pins, then pull-up and pull-down resistors.
  5. Read analog inputs and understand ADC limits.
  6. Read a DHT11 temperature sensor or explore BME280 for weather data.
  7. Show values on an OLED display.
  8. Build a complete project such as the ESP32 IoT Weather Station, ESP32 Smart Thermostat, or ESP32 Line Following Robot.

Quick checklist before every upload

  • Correct board selected in Tools > Board.
  • Correct port selected in Tools > Port.
  • USB cable supports data.
  • Serial Monitor is closed during upload.
  • No external circuit is pulling BOOT strapping pins into the wrong state.
  • Serial Monitor baud rate matches the sketch after upload.

Technical references

Frequently Asked Questions

Verify compiles for the selected board. Upload compiles and transfers firmware through the selected port. Observing the expected Serial output is a separate runtime check.

setup() prints once after reset, so the monitor may open too late to show its message. The loop repeats Hello from ESP32 once per second; check 115200 baud and reset the board when appropriate.

The USB-only Hello from ESP32 sketch on this page matches the recorded session. The installation guide uses a different ESP32 upload OK sketch. The captures record core 2.0.17, not a tested 3.3.2 upload.

No. Compilation checks the selected software target. Firmware transfer and the expected Serial output must be checked separately.

Use the Arduino IDE installation and first-upload guide linked in Setup prerequisites. It covers the board package, board/port selection, actual USB bridge and classic BOOT/EN recovery.

Conclusion

Use the installation guide for first-time setup. This reference explains the separate Hello from ESP32 sketch, its recorded Serial session, setup() and loop(), and the difference between compiling, uploading and observing output. Continue to the external LED lesson when the USB-only checks work.