In this tutorial we will show how to program ESP8266 directly in Arduino IDE. That's how we will get Arduino simplicity and power of ESP8266. In tihs case we do not need Arduino, just ESP8266 module. For start we will create blink example.

We can program ESP8266 native code or use ESP8266 NodeMCU. But there is better way. Recently there was released ESP8266 Arduino IDE. Thanks to guys behind this great work.

EDIT: updated manual is available at Arduino ESP8266 IDE.

See more tutorials at ​http://iot-playground.com/build​

Materials 

 

-ESP8266 module

ESP8266 ESP-01 Serial WIFI Wireless Transceiver ModuleESP8266 ESP-01 Serial WIFI Wireless Transceiver Module
$2.11
$17.00
ESP8266 ESP-03 Serial WIFI Wireless Transceiver ModuleESP8266 ESP-03 Serial WIFI Wireless Transceiver Module
$2.07
$2.15
ESP8266 ESP-12 Serial WIFI Wireless Transceiver ModuleESP8266 ESP-12 Serial WIFI Wireless Transceiver Module
$2.06
$1.75
ESP8266 ESP-05 Serial WIFI Wireless Transceiver ModuleESP8266 ESP-05 Serial WIFI Wireless Transceiver Module
$1.88
ESP8266 ESP-07 Serial WIFI Wireless Transceiver ModuleESP8266 ESP-07 Serial WIFI Wireless Transceiver Module
$2.18
$1.88

 

-FT232RL FTDI USB to TTL Serial Adapter 

FT232RL FTDI USB to TTL Serial Adapter 5V, 3.3VFT232RL FTDI USB to TTL Serial Adapter 5V, 3.3V
$2.59
$3.99

 

-1K resistor

400X 0.25w 1/4w Metal Film Resistor Pack Kit 1% 20 Value Each 20 Pcs 10 ~ 1M ohm400X 0.25w 1/4w Metal Film Resistor Pack Kit 1% 20 Value Each 20 Pcs 10 ~ 1M ohm
$1.88
$5.50

 

-LED diode

100PCS 3mm Red Round LED Bright Light-Emitting Diodes100PCS 3mm Red Round LED Bright Light-Emitting Diodes
$1.67
$1.74

 

Program 

First we download ESP8266 Arduino IDE. Latest version can be found on GitHub. Just download latest version and unpack it in Arduino ESP folder on your computer. Run Arduino.exe. Before we start programming we connect ESP8266 module to our computer. Connection is similar as if update firmware on ESP8266. For programming we need need FT232RL FTDI USB to TTL Serial+Adapter. Set FTDI programmer to 3.3V. See buying guide for details.

Warning: Some versions of FT232 USB serial adapters do not provide enough current for ESP8266. In this case use external 3.3V power supply connected to ESP8266 only.

 ESP8266 firmware update.

Next we need to change some settings in Arduino IDE. Select right COM port (Tools->Port), set programmer (Tools->Programmer->esptool)

 

and board (Tools->Board->Generic ESP8266 board).

 

Now we can load program. Basically this is standard Blink example program. Because we will use ESP8266 instead of Arduino we change pin number in standard program. Replace pin 13 with pin 2 which is PIN02 in ESP8266 GPIO.

Here is modified program. It can be also downloaded on GitHub.

 

When you modify program just press upload button. If everything is correct program will compile and upload to ESP8266 module. After you finish programming disconnect GND wire on GPIO0.

Connection

To see our blink example working connect LED and 1K resistor to GPIO2 pin. On picture below VCC connection to CH_PD is missing - add also this wire.

 

ESP8266 blink example

 

In next post we will show how to build sensor with Arduino IDE.

See more tutorials at ​http://iot-playground.com/build​ 

Buying guide

 

To support this site and EasyIoT framework development please buy in our store.

 

FT232RL FTDI USB to TTL Serial Adapter 5V, 3.3V

FT232RL FTDI USB for Arduino or ESP8266 programming. Support 5V and 3.3V

400X 0.25w 1/4w Metal Film Resistor Pack Kit 1% 20 Value Each 20 Pcs 10 ~ 1M ohm

100PCS 3mm Red Round LED Bright Light-Emitting Diodes

All purpose red LED.

2xAA 3V Battery Holder Box Case Wire

This 2xAA battery holder puts a nice finishing touch on your battery powered project.

10Pcs 2xAA Plastic Battery Storage Case Box Holder

This 2xAA battery holder puts a nice finishing touch on your battery powered project.

ESP8266 ESP-07 Serial WIFI Wireless Transceiver Module

ESP8266 with external antenna

ESP8266 ESP-01 Serial WIFI Wireless Transceiver Module

ESP8266 Serial WIFI Wireless Transceiver Module

ESP8266 ESP-05 Serial WIFI Wireless Transceiver Module

ESP8266 ESP-05 Serial WIFI Wireless Transceiver Module

ESP8266 ESP-12 Serial WIFI Wireless Transceiver Module

ESP8266 serial Port WIFI wireless module ESP-12

ESP8266 ESP-03 Serial WIFI Wireless Transceiver Module

ESP8266 serial WIFI model ESP-03

ESP8266 Lua Nodemcu WIFI Network Development Board

ESP8266 Lua Nodemcu WIFI Network Development Board


Comments   

+1 #14 Andy 2015-12-16 18:54
Hi.. I am using esp8266 -201, do i still set pin number to 02 for GPIO2 ? Since i do not know how they arrange the pin number
+1 #13 Super User 2015-08-24 16:23
Quoting sai:
how to add esptool to programmer in arduino ide


use modified Arduino Ide

https://github.com/esp8266/arduino

For more questions please join community forum.
+1 #12 sai 2015-08-16 08:16
how to add esptool to programmer in arduino ide
-1 #11 bzhenel 2015-05-26 22:32
Quoting Super User:

It looks like your programmer is not correctly connected to ESP8266. Please join forum and ask questions there. Maybe some other community member has similar problem.


It's work! I changed the FTDI module. Thank you, very much!
#10 Super User 2015-05-26 21:20
Quoting bzhenel:
Quoting Super User:

Aha, they changed installation. Now you install board in standard Arduino IDE. Follow installation instructions on their GitHub.


I do, but no esptool either with the "autoinstall". But I found a ready to use installation in "release" section that include esptool. Now, I'm stuck by programming step.

I have this message when I try to program the esp8862:

Quote:

Uploading 29072 bytes from C:\Users\Nicolas\AppData\Local\Temp\build5451417096252290836.tmp/sketch_may25a.cpp_00000.bin to flash at 0x00000000
warning: espcomm cmd: didn't receive command response
warning: espcomm_send_command(FLASH_DOWNLOAD_BEGIN) failed


Thank for your help
It looks like your programmer is not correctly connected to ESP8266. Please join forum and ask questions there. Maybe some other community member has similar problem.
#9 bzhenel 2015-05-25 22:10
Quoting Super User:

Aha, they changed installation. Now you install board in standard Arduino IDE. Follow installation instructions on their GitHub.


I do, but no esptool either with the "autoinstall". But I found a ready to use installation in "release" section that include esptool. Now, I'm stuck by programming step.

I have this message when I try to program the esp8862:

Quote:

Uploading 29072 bytes from C:\Users\Nicolas\AppData\Local\Temp\build5451417096252290836.tmp/sketch_may25a.cpp_00000.bin to flash at 0x00000000
warning: espcomm cmd: didn't receive command response
warning: espcomm_send_command(FLASH_DOWNLOAD_BEGIN) failed
Thank for your help
#8 Super User 2015-05-25 20:09
Quoting bzhenel:
Quoting Super User:


Do you use Arduino IDE from GitHub and not standard Arduino IDE?


Yes, I downloaded the IDE from GitHub. But I haven't found the arduino.exe. So, I unpacked the .zip folder from GitHub to an arduino installation. The esp8862 board type appeared in Tools menu. But not the esptool programmer. I don't understand why.


Aha, they changed installation. Now you install board in standard Arduino IDE. Follow installation instructions on their GitHub.
#7 bzhenel 2015-05-25 11:07
Quoting Super User:


Do you use Arduino IDE from GitHub and not standard Arduino IDE?


Yes, I downloaded the IDE from GitHub. But I haven't found the arduino.exe. So, I unpacked the .zip folder from GitHub to an arduino installation. The esp8862 board type appeared in Tools menu. But not the esptool programmer. I don't understand why.
#6 Super User 2015-05-25 09:15
Quoting bzhenel:
hi!

I tried your solution, but i haven't found the esptool programmer. Any idea?

Thank you.


Do you use Arduino IDE from GitHub and not standard Arduino IDE?
#5 bzhenel 2015-05-25 01:10
hi!

I tried your solution, but i haven't found the esptool programmer. Any idea?

Thank you.

You have no rights to post comments

Forum latest

  • No posts to display.