Skip to main content

ESP8266 First Program Guide

Espressif ESP8266 Logo

Connect Your Board & Select It in the IDE

  1. Plug your ESP8266 board into your computer using a USB cable.

  2. In the Arduino IDE, go to Tools → Board → ESP8266 Boards and select your exact board (e.g. NodeMCU 1.0 (ESP-12E Module)).

  3. Go to Tools → Port and select the port your board appears on:

    • Windows: COM3, COM4, etc.
    • macOS: /dev/cu.usbserial-XXXX or /dev/cu.SLAB_USBtoUART
    • Linux: /dev/ttyUSB0
  4. Set Tools → Upload Speed to 115200 if you run into upload errors.

If no port appears, double-check the USB cable (some are charge-only) and that the driver is installed correctly — see Hardware Setup.


Run a Test Sketch

  1. Open File → Examples → 01.Basics → Blink.
  2. Click Upload. Most NodeMCU and Wemos boards upload automatically without holding any buttons (unlike some ESP32 boards).
  3. The onboard LED should start blinking once your sketch runs (note: on many ESP8266 boards, the built-in LED is active LOW, so it blinks inverted).

Want a guided walkthrough with wiring and code explanations? Check out the LED Blink tutorial.


Troubleshooting

  • "Failed to connect to ESP8266: Timed out waiting for packet header" — hold the FLASH/GPIO0 button on bare ESP-01 modules while uploading, or use a board with auto-reset circuitry like NodeMCU.
  • Port doesn't show up — install the correct USB driver — see Hardware Setup — and try a different USB cable.
  • Garbled text in Serial Monitor — make sure the monitor's baud rate matches your sketch's Serial.begin() value (commonly 115200).

What's Next?


Comments