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.
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.
- 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.
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.
2. Copy and paste the following line to the Additional Boards Manager URLs field.
http://arduino.esp8266.com/stable/package_esp8266com_index.json
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.
4. Search for ESP8266 and press the install button for esp8266 by ESP8266 Community.
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);
}
Uploading the Sketch
Select your board before uploading the code. On the top drop-down menu, click on “Select other board and port…“
A new window, as shown below, will open. Search for your ESP8266 board model
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.
After a few seconds, the upload should be complete.
The ESP8266 on-board LED should be blinking every second.
Serial Monitor
You can click on the Serial Monitor icon to open the Serial Monitor tab.
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:
Troubleshooting
1) If you try to upload a new sketch to your ESP8266 and you get this error message “esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header“. It means that your ESP8266 is not in flashing/uploading mode.
Having the right board name and COM port selected, follow these steps:
- Hold-down the BOOT/FLASH button in your ESP8266 development board
- Press the Upload button in the Arduino IDE to upload your sketch
- When you see the “Connecting….” message in your Arduino IDE, release the finger from the BOOT/FLASH button
- After that, you should see the “Done uploading” message
Your ESP8266 should have the new sketch running. Press the ENABLE/RESET button to restart the ESP8266 and run the new uploaded sketch.
2) If you get the error “COM Port not found/not available”, you might need to install the CP210x Drivers:
- Install USB Drivers – CP210x USB to UART Bridge (Windows PC)
- Install USB Drivers – CP210x USB to UART Bridge (Mac OS X)
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:
“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
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.
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
try going in to board manager and setting the esp8266 driver files from version 3.1.1 to 3.1.0
this may help.
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
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
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 🙁
Hi.
At the moment, I still prefer using Arduino 1.8 or VS Code + PlatformIO instead of Arduino 2.0.
Regards,
Sara
I agree Sara, Arduino 1.8 is more friendly to use. Something is not quite right with the user experience on v.2.0.
Please keep up the great work (both of you).
Thanks 🙂
Hi, Can it be connected to a network (wifi or data mobile) other than the one to which the module is connected?
Greetings to Sara and Rui.
I installed Arduino IDE 2.3.2.,it worked fine. Then I needed to replace the board, it did not find a new one, in the end no ESP could be installed anymore. Reinstalling the complete IDE did not help either. So where is wrong, I expect an answer from the Arduino team on their site as well.
Why can’t boards from Esspressif ESP8266 or ESP 32 be installed in the Arduino IDE 2.x.x. Support is already declared, or even real. Whoever harms, the Russians, you harm everyone, or the Chinese, Espressif has its IDE, or the Italians, pushing its paid cloud.
Hi.
I’m sorry, but I didn’t understand your issue???
You can install ESP8266 and ESP32 boards on the new Arduino IDE without any problem.
Please provide more details about your issue.
Regards,
Sara
Greetings to Sara and Rui.
No board from Espressif can be installed, neither 32 nor 8266, nor from Arduino, nor from Espressif. But I have ESP 8266 boards functional, I will not discard them. Rather, bye, bye Arduino IDE.
That’s weird…
Maybe you’re doing something wrong?
It works perfectly fine on my computer…
Regards,
Sara