Introduction: Esp8266 12e With Arduino IDE With Solution+Examples

ABOUT- NodeMCU is an open source IoT platform. It uses the Lua scripting language, BUT this development board is now compatible to be programmed with Arduino IDE

esp8266 12e is a great way to achieve IoT with anything in a very cost effective manner,
The ESP8266 is like an Arduino with a builtin WiFI.

FEATURES ==> --10 GPIOs D0-D10 & ADC A0

--PWM functionality

--Communicaiton = I2C , SPI , 1-Wire

Note:- IT IS PREFERABLE TO USE THE LATEST VERSION OF ARDUINO IDE OR AT LEAST GREATER THAN v1.5, TO AVOID ANY POSSIBLE ERRORS THAT MIGHT COME WITH OLDER VERSIONS


NOTE :- IF YOU ARE LOOKING FOR SOLUTION ON "Board nodemcuv2 (platform esp8266, package esp8266) is unknown" PROBLEM, THEN YOU CAN DIRECTLY SKIP TO STEP 5.


Step 1: INSTALLING DRIVERS & Softwares

ARDUINO IDE -- I am assuming that you have downloaded the latest version of Arduino IDE, if hasn't yet, you can download it from HERE.

By default drivers for CP210X , which is a USB to UART converter mounted on the board is automatically installed when you plugin the board, if it doesn't,

or a YELLOW Caution sign appears with its name in DEVICE MANAGER , then you can go and check out this LINK
and download drivers, for this chip, depending on your OS.

File downloaded from this zip file will have, drivers for both 32-bit and 64-bit OS, you will find two ".exe" files in this folder, Install-
1) CP210xVCPInstaller_x64 - If you have 64-Bit OS
2) CP210xVCPInstaller_x86 - If you have 32-Bit OS

Once the drivers are properly installed the caution symbol will disappear, and you will be able to see your board at COM port greater than 2,
If it is still on COM port less than or equal to 2, then try changing the USB port you are plugging the board into.

Step 2: Adding Esp8266 12e Board Into Arduino IDE

As in most cases you won't be having, this esp866 12e development board, into your board manager of Arduino IDE, so you need to add it, manually by following these steps, as shown in the pictures

1) Open Arduino IDE (Version 1.6.5 or higher)
2) goto FILE => PREFERENCE or just press Ctrl and Comma simultaneously, and preference screen will open
3) goto Additional Board Manager's URL and add this URL http://arduino.esp8266.com/stable/package_esp8266com_index.json into the Text Box

4) Press OK
5) goto TOOLS => BOARDS => BOARDS MANAGER (as shown in the pictures above)
6) In this screen here search for "esp8266", you will find one option, Click it and download it
7) After downloading, choose the version you want to use from "SELECT VERSION" drop down (version 2.0 or above is recommended).
8) Press OK

NOW YOU HAVE ALL THE BOARDS UNDER THIS PACKAGE IN YOUR BOARD MANAGER :-)

Step 3: SELECT YOUR BOARD

step 1)Two types of board are mainly available, one with version 0.9 and other with version 1.0

But version 1.0 is recommended by me, as i had some issues with v0.9 like,

a) Automatic resetting
b) Not breadboard friendly

the only advantage, of version 0.9 is that its cheaper than the v1.0

step 2) goto to "PORT" - choose COM port, which is greater than 2, normally you will find "COM 7"

NOTE:- Keep rest of the parameters, default, as shown in the picture above


Step 4: UPLOAD THE SKETCH

step1) goto FILE => EXAMPLES => ESP8266 => BLINK

This will open Built In LED blink sketch,

step2) click on UPLOAD BUTTON as shown in the picture or just press ctrl and U, simultaneously on your keyboard

it will take some time to upload, as their are a lot of conversions, going on with the sketch

after the sketch is uploaded, you should see a little light blinking on the board.

NOTE:- IF YOU GET ANY ERROR WHILE UPLOADING THE SKETCH, THEN GOTO STEP 5, OTHERWISE SKIP STEP 5, AND ENJOY !!! :-)

SOME SAMPLES CODE ARE PROVIDED WITH IT AS WELL, YOU CAN DOWNLOAD MYSAMPLE CODES HERE

GOOD LUCK WITH YOUR DEVELOPMENT.

Step 5: Board Nodemcuv2 (platform Esp8266, Package Esp8266) Is Unknown

IF YOU ARE GETTING THIS ERROR WHICH MANY PEOPLE DOES, as i have noticed,

you need to follow the steps below, to get rid of it...

Open arduino in your PC and then

step_1) goto FILE=> PREFERENCES or press "ctrl and comma" simultaneously.

step_2) goto the PATH mentioned at the Bottom of preferences screen, as shown HIGHLIGHTED IN A RED BOX in the picture above by clicking on it
(ex-
C:\Users\"Your Username"\AppData\Local\Arduino15)

step_3) Your PC will then open a folder in the File Explorer, as shown in picture above.

step_4) Now follow this Path as => packages ==> esp8266 ==> hardware ==> esp8266
H
ERE YOU WILL FIND TWO FOLDERS, REPRESENTING TWO VERSIONS OF "esp8266"
DELETE THE OLDER VERSION, TRY UPLOADING THE SKETCH AGAIN,

AND THIS TIME THE SKETCH WILL BE UPLOADED, YOUR PROBLEM SOLVED :)
Do comment if it helped...

Good Luck, happy developing...



YOU CAN DOWNLOAD
MY SAMPLE CODES HERE

Comments

author
jrybak (author)2017-05-14

Thank you VERY MUCH for the help in Step 5.

author
pspranav7 (author)jrybak2017-05-15

Glad it helped....if anything else i could help in.,...than please do ask.

author
mo.nicholas (author)2017-03-27

When I am at the last step, instead of seeing a "older version" I see a folder labeled 2.0, and when I compile it says "error compiling for board NodeMCU 0.9 (ESP-12 Module)

author
SándorN (author)2017-03-09

Thanks a lot! It really helped me!

author
pspranav7 (author)SándorN2017-03-09

Good to know...!! Happy it helped....and Good Luck... :)

author
Harisiqbalengr (author)2017-01-26

it really helped...thnx :)

author
pspranav7 (author)Harisiqbalengr2017-01-26

Glad...it helped... :)

author
uncels (author)2016-12-19

I was going mad, until i read this article Step 5

So simple, but... you gotta know it.

Thanks man.

author
pspranav7 (author)uncels2016-12-19

I can understand what you went through.... As same thing made me mad, when I myself was working with it..that's why I specifically mentioned that step 5

author
FixieG (author)2016-11-20

Thanks a lot!! it really helped me!!!

author
pspranav7 (author)FixieG2016-11-21

I am glad....that I could help you...
Good luck for your projects... :)

author
BartDaCaveman (author)2016-10-16

That was a great guide! Thanks!

author
pspranav7 (author)BartDaCaveman2016-10-18

Thanks.....that's the aim.... always

author
nodoubtman (author)2016-09-12

Thank you so much!!!! :)

author
pspranav7 (author)nodoubtman2016-09-13

Glad....i could help. :)

author
RobertoCarlos (author)2016-09-03

ok. Muito obrigado

author
pspranav7 (author)RobertoCarlos2016-09-11

muito obrigado .... para a apreciação .... feliz em ajudar
desculpas por responder tarde...

author
RobertoCarlos (author)2016-09-03

Thanks.

Very good.

author
brunobayon (author)2016-08-31

Merci beaucoup !

Très clair et efficace !

author
pspranav7 (author)brunobayon2016-09-01

heureux d'aider.....
Pranav

author
RobertoCarlos (author)2016-08-17

Congratulations!!!!!

Thank you very much!!!

You saved my day.

author
pspranav7 (author)RobertoCarlos2016-08-23

Happy to help... :)

Pranav Sharma

author
xuansontdh (author)2016-08-15

warning: espcomm_sync failed

error: espcomm_open failed

error: espcomm_upload_mem failed

author
pspranav7 (author)xuansontdh2016-08-16

These type of errors are mainly due to, improper connection between esp 12e board and your pc....
Here are the things you can try:-
1) Try plugging your board into different ports
2) In your Arduino IDE, go to Tools => Port => Port " " NodeMcu Esp8266 12 e
Check if you can see your board in the Port Tab, with port number more than 2
Generally For esp8266 12e the Port Number will be 12 or 16
but it could differ
3) try opening the Serial Monitor, if it opens up, then your connection is fine, and you are good to go...

If your Board doesn't show up, here "Tools => Port =>"
then you should refer to Step 1 and Step 5 of my instructable
this should solve your problem....
if it still doesn't work, then reply back...and i will try to give some other solution

author
sandip83 (author)pspranav72016-08-20

I am getting the same error. Tried all 5 steps as you suggested in two different computers (uninstalling and reinstalling everything), but it did not help.

When USB cable is connected, the PC detects it in COM5. Also I can see the output in the Serial monitor for the last uploaded sketch. It was doing fine till the last sketch was uploaded, but suddenly I started getting this error and its persistent.... now I am unable to upload any new sketch. Please help.

author
pspranav7 (author)sandip832016-08-23

hi, sandip83, first of all i am really sorry for replying so late, I was cut off from internet from past 4 days

Anyways, as far I can analyze your problem is that you can not upload any new code in the module

So if we start from very basic, it is a connection problem and should be solved by doing things I mentioned above in my comments
but still you can try one more thing, try using a new USB cable, it should not be long.
if it doesn't work out then, answer these
1) Arduino IDE version you are using ?
2) Esp Dev. Board version you are using ? you can find it in
Tools => BoardManager=>(Search ESP8266 in search Box)
As I showed in my "Step 2"
3) Have you tried uploading a new code ? instead of problematic code?

And the last thing you can possibly do is , Factory Reset ESP module

you can refer to these Links For the same ...
https://room-15.github.io/blog/2015/03/26/esp8266-...
http://learn.acrobotic.com/tutorials/post/esp8266-...
http://www.esp8266.com/viewtopic.php?f=6&t=2895

If it still doesn't solve your problem, then possibly your module is damaged...and you have to try with a new module

Hope it helps....good luck...
Pranav Sharma

author
dinojedi (author)2016-07-27

Thanks a lot...do not sure which version I downloaded (I had two versions to choose from on my SparkFun Blynk)...Deleted both and re-download the correct one.

author
pspranav7 (author)dinojedi2016-08-01

Always choose the latest one, except if you are not using any older version of Arduino IDE....
but happy that u worked it out.....congo :)

author
vedranius (author)2016-07-23

Hi,

can you please describe or write a new instructable how to make a button trigger with NodeMCU, which would send the notification when pressed via Pushbullet or to a Raspberry Pi?

Thanks!

author
pspranav7 (author)vedranius2016-07-27

I will try .... But i can't give you a timeline... May be by next weekend... :)

author
vedranius (author)pspranav72016-07-27

Thank you! No hurry! ;)

author
zuzalite (author)2016-07-19

Thanks a Lot! This solved my problem.

author
pspranav7 (author)zuzalite2016-07-27

Happy to help...!!!

author
FredR19 (author)2016-06-19

thanks Step5 solved my compiling problem

author
pspranav7 (author)FredR192016-06-20

hAppy to help.....share it with others, who having this problem... (y)

About This Instructable

20,120views

46favorites

License:

Bio: I am a hardcore IoT developer, i develop IoT based projects as a hobbyist as well as professionally as my source of earning. Software part ... More »
More by pspranav7:Arduino with t6963c 240x128 Graphic LCD TutorialEsp8266 12e with Arduino IDE With Solution+ExamplesConnecting Arduino with Temboo and Read email
Add instructable to: