- Download and Install CP2102 usb to uart driver
- Download and Install NodeMCU Flasher
- Download and install JAVA(SE version 7 and above)
- Download ESPlorer IDE
STEP 1: FLASHING NODEMCU FIRMWARE
Open the NodeMCU Flasher by following the below path
Now connect NodeMCU to computer using usb.
Select the appropriate COM Port in ESP8266 Flasher. Now click on Flash Option. This will flash the NodeMCU firmware on NodeMCU board which is already available in Flasher software.
If the flashing does not start try to disconnect NodeMCU from computer and connect again.
STEP 2: SETTING UP ESPLORER IDE FOR NODEMCU
Open the ESPlorer IDE by clicking on ESPlorer executable jar file
- Click on Refresher Button to See the available COM Port
- Choose appropriate COM Port
- Click on Open Option which will turn close and IDE will be connected with NodeMCU through COM Port
- Press Reset button on NodeMCU.
After this you should get Output as shown in below picture.
Till this part you have successfully done the Initial setup for NodeMCU lua programming.
STEP 3: RUNNING FIRST LUA PROGRAM ON NODEMCU
Now let’s start with some coding. In this step we will interface an LED with NodeMCU and write a Lua code to blink it.
I have interfaced LED with pin D6 as shown in below figure.
Here is the ready code to blink led connected to pin D4.
LED_PIN = 4
tmr.alarm(0, 500, 1, function ()
if val==0 then
Simply copy the code and paste in ESPlorer. Click on save button and save it as. Then click on Save to ESP button and enjoy the blinking.
Congratulations..! You have successfully run first lua project on NodeMCU.
Note thatis the program which runs as a part of NodeMCU boot process whenever it resets. If you save program with some other name the program will not be executed after reset.