How to Upload code in ESP8266 Nodemcu from Arduino IDE

esp8266 nodemcu

ESP8266 NodeMCU is the smallest & cheapest IoT Development board. Price is only starting from $2. There is two chipset model available, one is CH340 and another one is CP2102. You can buy it from the following links.

CH340 AliExpress Amazon
CP2102 AliExpress Amazon

In this post, I will tell how to configure & upload code in ESP8266 from Arduino IDE. This is for the absolute beginners who are very new to this device. You can also see tutorial video in Hindi.

Download Arduino IDE

First go to the following link and download setup files for your system.

https://www.arduino.cc/en/Main/Software

How to Upload code in ESP8266 Nodemcu from Arduino IDE

If you are using windows, then it will be very simple. Just Download installer or zip and run the EXE file.

Here in this tutorial I will share the process to install Arduino IDE in Linux system.

How to Install Arduino in Linux

In the download page mentioned earlier, select Linux 32/64 bit version according to your system & download the file which extension is .tar.xz

How to Upload code in ESP8266 Nodemcu from Arduino IDE

Open the file using Archive manager and extract to a folder. I am extracting it a folder setup inside my home directory.

How to Upload code in ESP8266 Nodemcu from Arduino IDE

Then go to extracted path and Right click to Open in Terminal.
Now run the following command to create a desktop and start menu launcher shortcut. If you do not want to create shortcut then skip this step and click the file namedarduinofrom the extracted path to start Arduino IDE.

Now go to properties of newly created desktop icon and click allow executing file as program.

How to Upload code in ESP8266 Nodemcu from Arduino IDE

Now you are done. Arduino IDE has been installed successfully.

Add ESP8266 to Arduino IDE

To add ESP8266 Nodemcu module in the IDE, we have to go preferences from the file menu.

How to Upload code in ESP8266 Nodemcu from Arduino IDE

Now paste the following URL to the Additional board manager URL.

https://arduino.esp8266.com/stable/package_esp8266com_index.json

How to Upload code in ESP8266 Nodemcu from Arduino IDE

Now go to Tools > Board > Board manager.

How to Upload code in ESP8266 Nodemcu from Arduino IDE

Now type esp8266 in search bar. Then select latest stable build & install.

How to Upload code in ESP8266 Nodemcu from Arduino IDE

Now from the tools menu do the following settings.
Board: Generic ESP8266 Module
Flash Mode: DOUT
Reset Method:
nodemcu
Flash Size: 4M(1M SPIFFS)


ESP8266 generally comes with 32 Mb(4M). We reserve 1M for the file store for file handlaning programmes. This is why we selected 1M SPIFFS. If you wish you can change SPIFFS size.

Now from the examples chose basic LED blinking program to upload in Nodemcu.

How to Upload code in ESP8266 Nodemcu from Arduino IDE

Now connect ESP8266 via micro USB to USB data cable.
Select port from the tools menu. Normally the port is /dev/ttyUSB0

How to Upload code in ESP8266 Nodemcu from Arduino IDE

Now Click the Right arrow icon to upload the code.

Now you have successfully uploaded the code & built-in LED will start blinking.

How to Upload code in ESP8266 Nodemcu from Arduino IDE


If you are facing “cannot access /dev/ttyUSB0”, then follow the Post below.

How to fix cannot access /dev/ttyUSB0 in Arduino IDE

If you wanted to create bin file from Arduino IDE and flash it into ESP8266, then follow these posts.

How to create bin file from Arduino IDE

Install Arduino IDE in Raspberry Pi 3B+ with ESP8266 Nodemcu

How to flash bin file to ESP8266 from Windows OS

How to flash bin file to ESP8266 from Linux OS

Share with Friends
0 0 votes
Rating
guest
0 Comments
Inline Feedbacks
View all comments