Installing ESP8266 NodeMCU Board in Arduino IDE 2 (Windows, Mac OS X, Linux)

There is a new Arduino IDE—Arduino IDE 2. In this tutorial, you’ll learn how to install the ESP8266 boards in Arduino IDE 2.X and upload code to the board. This tutorial is compatible with Windows, Mac OS X, and Linux operating systems.

Installing Programming ESP8266 NodeMCU Board in Arduino 2.0 Windows Mac OS X Linux

According to the Arduino website: “The Arduino IDE 2.0 is an improvement of the classic IDE, with increased performance, improved user interface and many new features, such as autocompletion, a built-in debugger and syncing sketches with Arduino Cloud“.

If you want to install the ESP8266 boards on the “classic” Arduino IDE, follow the next tutorial instead:

If you prefer programming the ESP8266 using VS Code + PlatformIO, go to the following tutorial:

You might also like reading the ESP32 Guide: Installing ESP32 Board in Arduino IDE 2.0 (Windows, Mac OS X, Linux)

Prerequisites: Arduino IDE 2 Installed

Before proceeding make sure you have Arduino IDE 2 installed on your computer.

Go to the Arduino website and download the version for your operating system.

Arduino IDE 2 Software Install Download
  • Windows: run the file downloaded and follow the instructions in the installation guide.
  • Mac OS X: copy the downloaded file into your application folder.
  • Linux: extract the downloaded file, and open the arduino-ide file that will launch the IDE.
Arduino IDE 2.0 installation successful Windows Mac OS X Linux

If you have doubts, you can go to the Arduino Installation Guide.

Do you need an ESP8266 board? You can buy it here.

Recommended reading: Best ESP8266 Boards Comparison

Install ESP8266 NodeMCU Add-on in Arduino IDE 2

To install the ESP8266 board in your Arduino IDE 2, follow these next instructions:

1. In the Arduino IDE 2, go to File > Preferences.

Arduino IDE 2 File, Preferences

2. Copy and paste the following line to the Additional Boards Manager URLs field.

http://arduino.esp8266.com/stable/package_esp8266com_index.json
Arduino 2 - Additional Boards URL

Note: if you already have the ESP32 boards URL, you can separate the URLs with a comma, as follows:

http://arduino.esp8266.com/stable/package_esp8266com_index.json, https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

3. Open the Boards Manager. You can go to Tools > Board > Boards Manager… or you can simply click the Boards Manager icon in the left-side corner.

Arduino IDE 2 - Boards Manager

4. Search for ESP8266 and press the install button for esp8266 by ESP8266 Community.

Install ESP8266 NodeMCU boards Arduino IDE 2

That’s it. It should be installed after a few seconds.

Testing the Installation

To test the ESP8266 add-on installation, we’ll upload a simple code that blinks the on-board LED (GPIO 2).

Copy the following code to your Arduino IDE:

/*********
  Rui Santos
  Complete project details at https://RandomNerdTutorials.com/vs-code-platformio-ide-esp32-esp8266-arduino/
*********/

#include <Arduino.h>

#define LED 2

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  pinMode(LED, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(LED, HIGH);
  Serial.println("LED is on");
  delay(1000);
  digitalWrite(LED, LOW);
  Serial.println("LED is off");
  delay(1000);
}

View raw code

Uploading the Sketch

Select your board before uploading the code. On the top drop-down menu, click on “Select other board and port…

Arduino IDE 2 - select board

A new window, as shown below, will open. Search for your ESP8266 board model

Arduino IDE 2 select board model and COM port

Select the ESP8266 board model you’re using, and the COM port. In our example, we’re using the NodeMCU 1.0 board. Click OK when you’re done.

Now, you just need to click on the Upload button.

Arduino IDE 2 Upload Button

After a few seconds, the upload should be complete.

ESP8266 NodeMCU Arduino IDE 2.0 Upload Successful Programming demonstration

The ESP8266 on-board LED should be blinking every second.

ESP8266 NodeMCU board running blink LED example code Arduino IDE 2.0

Serial Monitor

You can click on the Serial Monitor icon to open the Serial Monitor tab.

Open Arduino IDE Serial Monitor Arduino IDE 2.0 ESP8266 NodeMCU

That’s it! You’ve installed the ESP8266 Boards successfully in Arduino IDE 2.

Filesystem Uploader Plugin (LittleFS)

If you want to add support to upload files to the ESP8266 LittleFS filesystem, you can follow the next tutorial:

Wrapping Up

This is a quick guide that shows how to prepare Arduino IDE 2 for the ESP8266 Boards on a Windows PC, Mac OS X, or Linux computer.

Next, you might want to read: Getting started with ESP8266 or learn more about the ESP8266 board with our resources:



Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »
Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »

Enjoyed this project? Stay updated by subscribing our newsletter!

11 thoughts on “Installing ESP8266 NodeMCU Board in Arduino IDE 2 (Windows, Mac OS X, Linux)”

  1. “Linux: extract the downloaded file, and open the arduino-ide file that will launch the IDE.”
    may sound simpler than it is. the only way that worked for me is from the command line by going to the proper directory and typing ./arduino-ide

    Reply
  2. Linuxmint: Your instructions were too glib and left out much complexity. I am erasing the entire mess and sticking with 1.8.15 until you and Arduino get the bugs out.

    Reply
  3. excelent tutorial.
    I had a problem: my board doesnt update the code, I have already tried many differents boards( ESP8266, nodemcu, wemos mini R1 and I always have the same message. I did a test in Windows 10 and no problems.
    I am using Ubuntu 20.

    Compilation complete.
    esptool.py v3.0
    Serial port /dev/ttyS0
    Connecting…….._____….._____….._____….._____….._____….._____….._____
    Traceback (most recent call last):
    File “/home/jonata/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/upload.py”, line 66, in
    esptool.main(cmdline)
    File “/home/jonata/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool/esptool.py”, line 3552, in main
    esp.connect(args.before, args.connect_attempts)
    File “/home/jonata/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool/esptool.py”, line 529, in connect
    raise FatalError(‘Failed to connect to %s: %s’ % (self.CHIP_NAME, last_error))
    esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
    Upload error: Error: 13 INTERNAL: Failed uploading: uploading error: exit status 1

    Reply
  4. Hallo.
    I have a problem with my board and programming. Here is listing of my problem:

    Compilation complete.
    esptool.py v3.0
    Serial port COM3
    Connecting…….._____….._____….._____….._____….._____….._____….._____
    Traceback (most recent call last):
    File “C:\Users\ivang\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2/tools/upload.py”, line 66, in
    esptool.main(cmdline)
    File “C:/Users/ivang/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool\esptool.py”, line 3552, in main
    esp.connect(args.before, args.connect_attempts)
    File “C:/Users/ivang/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool\esptool.py”, line 529, in connect
    raise FatalError(‘Failed to connect to %s: %s’ % (self.CHIP_NAME, last_error))
    esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
    Upload error: Failed uploading: uploading error: exit status 1

    Thank you for answer.
    Ivan

    Reply
    • Hi, in the meantime I tried again and today I finally succeeded. I switched to a new computer, the old one was 32bit, the new one I now have 64-bit, I transfer these programs. I’m an amateur in these things. Well thank you

      Reply
  5. Thanks for these random but always usefull articles 🙂

    September 2022: I downloaded the new ‘stable’ release of the Arduino 2.0rc IDE on Mac Monterey 12.6 … and it’s still buggy!!! Would it open anything other than a default document? No. Would it compile? There seemed to be some missing dependency to XCode which was already installed on Monterey???

    Even though the Arduino IDE is now what it should have been eight years ago, I will be staying with VS Code and the PlatformIO extension – which together do embedded IoT development in one slick IDE.

    Sorry Arduino 🙁

    Reply

Leave a Comment

Download Our Free eBooks and Resources

Get instant access to our FREE eBooks, Resources, and Exclusive Electronics Projects by entering your email address below.