As we know, NodeMCU is an open-source IoT platform for to Lua based firmware developed for ESP8266 and ESP8266 is WiFi SoC (System on Chip) developed by Espressif Systems. Usually NodeMCU comes with inbuilt Lua interpreter, but preferred way is to program NodeMCU ESP8266 with Arduino IDE. NodeMCU is one of the most widely used development.
- 1 What is NodeMCU?
- 2 Steps to Program NodeMCU
- 3 Program is getting stucked at “uploading” ?
- 4 Still unable to Program NodeMCU esp8266?
What is NodeMCU?
As discussed earlier, NodeMCU is an open source IoT platform. There are different boards available with NodeMCU firmware such as Lolin, Wemos etc. NodeMCU has on chip SoC WiFi available with 12 GPIO and 11 usable GPIOs. NodeMCU comes with inbuilt Lua interpreter. We can also program NodeMCU with Arduino IDE.
NodeMCU is around $3.5 board which can be used in IoT applications or as an development platform. It has one microUSB port which we can connect to the Laptop or PC for programming. It can be also progrramed by serialy, but in this tutorial, we are going to program it from microUSB serial port. Before Programming NodeMCU with Arduino IDE, we need to install NodeMCU board in Arduino IDE. So, let’s see the Steps to install NodeMCU board in Arduino IDE.
Steps to Program NodeMCU
Step 1: Download and install latest Arduino IDE
The fisrt and foremost thing we will require to program this microcontroller is Arduino IDE. So, first we will install Arduino IDE. Depending on the OS you are using, install respected version of Arduino IDE. You can download Arduino IDE from HERE.
Step 2: Add ESP8266 board preferences
Go to File > Preferences
The preference window will open. In Additional Boards Manager, paste the link below:
Step 3: Install ESP8266 Board in Arduino IDE
Tools > Board > Boards Manager.
Now, after this, Arduino Boards Manager will open.
In search box of Arduino Boards Manager, searach
As shown in above image, you will find the board with name “esp8266 by ESP8266 Community”. Below of this, choose version and hit install.
Step 4: Install USB serial drivers
Click Here to DOWNLOAD CH340G driver setup
Click Here to DOWNLOAD SCILAB CP2102 driver setup
File> Example > ESP8266 > Blink
Now, new window will open, with ESP8266 Blink sketch example. In this sketch, you will find that, pin named as
LED_BUILTINis declared as output. This is pin number D13 for NodeMCU. In NodeMCU, pin D13 is internally connected with the on board LED.
After programming NodeMCU esp8266, you will find the LED on NodeMCU is blinking with the given ON-OFF delay. You can change this delay by editing the code. We uploded the code, just to ensure the NodeMCU is programmed or not. If LED is blinking with given delay, hurrey, you just completed setup of NodeMCU programming from Arduino IDE.
Program is getting stucked at “uploading” ?
Connect your NodeMCU to Laptop/PC and follow this sequesnce of Push buttons:-
- Press and hold “Flash” Button + Press and release “Reset” Butto
- Now release flash button
This will enable program mode of you NodeMCU, now click on Upload button, and you will find issue is resolved.
Still unable to Program NodeMCU esp8266?
It may possible that, you are still not able to program NodeMCU ESP8266. Check for if any below reason:
- NodeMCU not getting connected to Laptop/Desktop (Mostly Driver issue)
Follow this troubleshooting guide for more.