Esp8266 12e With Arduino IDE With Solution+Examples

30,099

48

41

Published

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

About: 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 such as Android Apps or Website and Hardware both are designed by me...

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

Share

    Recommendations

    • Woodworking Contest

      Woodworking Contest
    • Casting Contest

      Casting Contest
    • Oil Contest

      Oil Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    Hy, I think Step 5 could solve my problem, but i use a mac and there is only one Version in the Folder. In Arduino there is no Port - only Bluetooth. ???

    41 Comments

    Solved my problem, worked AAA, thanks mate.

    Spent many, many worhless hours for searching a solution... Step 5 helped instantly! Thanks.

    1 reply

    Had been through the same....
    That's why posted this instructable so others can save their time...

    And m happy that it helped you.

    Simples rápido e direto!! Parabéns!! Obrigadoresolveu meu problema estava quase desistindo não achava mais solução para este problema abraço!!

    Yet another "thank you", it solved my problem.

    THANKS!!!!!! Was pulling my hair out.

    Thank you VERY MUCH for the help in Step 5.

    1 reply

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

    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)

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

    Glad...it helped... :)

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

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

    Thanks man.

    1 reply

    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

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

    1 reply

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

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

    Thank you so much!!!! :)