This is a tutorial to show you how to flash a firmware to ESP8266-01 and connect to Blynk using an ESP8266 - 01 as an Arduino wifi shield.

Hardware needed:

*Arduino Uno/Mega

*Jumper wires

*USB A to USB B cable


Software needed:

For easy access, move or download the following software to the desktop of your Linux. It can be moved later.

*Linux or Mac for flashing firmware.

*Arduino IDE link: https://www.arduino.cc/en/main/software

*Most recent BLYNK library link: https://github.com/blynkkk/blynk-library

*Blynk_v0.3.4.zip https://github.com/blynkkk/blynk-library/releases

*pySerial link: https://sourceforge.net/projects/pyserial/files/p...

*ESP8266 blynk library: https://github.com/vshymanskyy/ITEADLIB_Arduino_W...

*esptool link: https://github.com/themadinventor/esptool

*Sdk1.0.0 v0.22 ESP8266 firmware link:


*Download esp8266_flasher [For Windows]


*Blynk app on iphone or android.

Step 1: Download These Files

*Download Arduino IDE

*Download most recent Blynk library

*Download the Blynk-ESP8266 library

Click the link provided, download and install the library.

*Download pySerial

Click the link provided in the intro and click what is in the red box. Make sure you move it to your desktop. Once it's there, double click the "pyserial-2.7.tar.gz" file and it will create a pyserial-2.7 folder.

*Download esptool

Click the link provided in the intro and click what is in the red box. Make sure you move it to your desktop.

*Download Sdk1.0.0 v0.22 ESP8266 firmware

This will download just by clicking the link in the intro page. Make sure you move it to your desktop. Open the "esptool-master" folder and move the "AT22SDK100-2015-03-20-boot12.bin" file into it. Then, rename it to "AT22SDK10020150320boot12.bin".

*Download esp8266_flasher [For Windows]

Download esp8266_flasher.exe

Step 2: Using Windows:

*Connect your arduino to your computer using an USB 2.0 cable.

  • *ESP8266:____________ Arduino:
  • GND -------------------------- GND
  • GP2 -------------------------- Not connected
  • GP0 -------------------------- GND
  • RXD -------------------------- RX
  • TXD -------------------------- TX
  • CHPD ------------------------ 3.3V
  • RST -------------------------- Not connected
  • VCC -------------------------- 3.3V

*Open "esp8266_flasher.exe" and click on bin.

*Select the binary file "AT22SDK100-2015-03-20-boot12.bin".

*Enter proper COM port. In this case it is COM3

*Then click on download button,

*If your connections are proper the flashing will begin after erasing flash memory.

*After completion it shows "failed to leave flash mode this is OK.

Step 3: Using Linux: Changing the Directory

Open your Terminal (here we are using Kali linux), then type "cd". Next, drag the "pyserial-2.7" folder into the terminal window and hit enter.

Step 4: Installing PySerial

Enter this command “python setup.py install" into the terminal

(If your terminal doesn’t have root/administrator/Superuser privilege access use "sudo python setup.py install" and enter password when asked.)

Step 5: Connecting Arduino and ESP8266-01

*Connect your arduino to your computer using an USB 2.0 cable.

*ESP8266:____________ Arduino:

GND -------------------------- GND

GP2 -------------------------- Not connected

GP0 -------------------------- GND

RXD -------------------------- RX

TXD -------------------------- TX

CHPD ------------------------ 3.3V

RST -------------------------- Not connected

VCC -------------------------- 3.3V

Step 6: Flashing the Firmware to ESP8266-01

*Type "cd". Next, drag the "esptool-master" folder into the terminal window and hit enter.

* Esptool-master should contain following files

[ AT22SDK10020150320boot12.bin, esptool.py, LICENCE, MANIFEST.in, README.md, setup.py ]

*Enter this command

"sudo python esptool.py --port /dev/ttyACM0 write flash 0x00000 AT22SDK10020150320boot12.bin"

Note:The port address of your arduino may be different. You can use the command “ls /dev/tty*” to list all devices.

Step 7: Add the Blynk Library and the Blynk-ESP8266 Library to Your Arduino IDE.

*Arduino IDE >> Sketch >> Include library >> Add .zip library.

* And install "blynk-library-master" and "ITEADLIB_Arduino_WeeESP8266-master" libraries.

*Update the ESP8266 library from “Arduino IDE >> Sketch >> Include library >> manage library”.

Step 8: Uploading the Code to Arduino

  • USING Arduino MEGA:

ESP8266:____________ Arduino:

GND -------------------------- GND

GP2 -------------------------- Not connected

GP0 -------------------------- Not connected

RXD -------------------------- TX

TXD -------------------------- RX

CHPD ------------------------ 3.3V

RST -------------------------- Not connected

VCC -------------------------- 3.3V

We will be using a 1K POT connected to analog0 pin and an LED connected to D7 of arduino mega.

*Open Your “Blynk app” from android/iPhone get the “authentication token”.

  • Open the code in “Arduino IDE >> File >>examples >> blynk >> BoardsAndShields>> ESP8266_Shield_HardSer”
  • Add your authentication token to the code
  • Enter "SSID" and "PASSWORD" in respective fields.
  • Upload the code to your arduino.

Step 9: Connecting, Controlling and Monitoring Arduino Pins Using Blynk App

In the Serial monitor you can see that the connection has been established with blynk server.

Here’s the screenshot of the blynk app

Digital Pin 7 of Arduino mega --------->>controlled by blynk app.

Analog Pin 0 data from Pot -------- >> displayed on graph.


Similarly you can also use arduino uno....


GND -------------------------- GND

GP2 -------------------------- Not connected

GP0 -------------------------- Not connected

RXD -------------------------- D3 (SoftwareSerial)

TXD -------------------------- D2 (SoftwareSerial)

CHPD ------------------------ 3.3V

RST -------------------------- Not connected

VCC -------------------------- 3.3V

For Arduino UNO you can use “Arduino IDE >> File >> examples >> blynk >> BoardsAndShields>> ESP8266_Shield_SoftSer”

*The “Baud rate” of ESP8266 has to be changed to 9600 in Software Serial.

*AT command “AT+UART_DEF=9600,8,1,0,0”.

<p>Great instruction, thanks! Also if you want to interconnect many devices using Blynk App read this <a href="http://www.geekstips.com/blynk-bridge-another-way-to-communicate-between-two-esp8266/" rel="nofollow">Blynk Bridge Tutorial</a>. </p>
I have connected all thing correctly but i m getting error <br>Connecting to esp<br>AT version 0.22.0/0<br>SDK version 1.0.0<br>co10<br>Failed to enable MUX <br>Failed to set STA mode <br>Can anyone help me
<p>Can you plz look at this</p><p><a href="https://www.instructables.com/community/security-system-not-responding-after-combinin-ultr/" rel="nofollow">https://www.instructables.com/community/security-s...</a></p><p>small help thanks</p>
<p>Hi my esp is getting connected to internet but when I play the project on Blynk app it says &quot;Your arduino uno is not in network&quot;. Can some one help me out </p><p>Thanks in advance </p>
<p>Thanks, I have successfully implemented this. It is working perfectly when I sending AT commands, and responding acccording to them.<br>But its not working when I am sending AT commands from code.<br>Please help me to get out of this. </p>
<p>Hi , I just do all the steps and connect well to Blynk but only when the Mega is connected to my PC and the serial monitor is open , and dont connect to blynk when I use the external power supply on the Mega and the system is stand alone , can you help me to fix this ? Thank you .</p>
<p>Download Sdk1.0.0 v0.22 ESP8266 firmware</p><p>This will download just by clicking the link in the intro page. Make sure you move it to your desktop. Open the &quot;esptool-master&quot; folder and move the &quot;AT22SDK100-2015-03-20-boot12.bin&quot; file into it. Then, rename it to &quot;AT22SDK10020150320boot12.bin&quot;.</p><p>cannot find the filel</p>
<p>nothing came out</p>
<p>helpl, Click the link provided in the intro and click what is in the red box. Make sure you move it to your desktop. Once it's there, double click the &quot;pyserial-2.7.tar.gz&quot; file and it will create a pyserial-2.7 folder.</p>
<p>some files do not exist</p>
<p>I follow the step 2 but I can not upload AT22SDK100-2015-03-20-boot1.2.bin to the ESP8266. The message from the flashe downloader program is:</p><p>connecting ....</p><p>Erasing flash...</p><p>Invalid head of packet</p><p>Please help me to explain how to solve this problem</p>
<p>first upload a blank sketch to your arduino and later flash your esp</p>
Looks a lot like mine ;) Thank you for adding a Windows tutorial. Lots of people have been asking me for it and I haven't gotten the chance to do it yet
<p>Hi, </p><p>i've an error : <br>after be connected and ready my serial says : Login timeout<br>in the blynk apps : arduino uno was disconnected </p><p>someone have an idea ?</p>
are you getting the connection status in serial monitor? <br>connected to SSID wifi... <br>.....<br>ready <br>Ping...? <br>
it was exactly my problem! thanks you !
i found my error. my network doesn't allow this connection even if it said &quot;connected to WiFi&quot; i tried With an other network and it Works ! thanks for this tutorial !
can you try it on a local server
<p>New and working AT Firmware:</p><p>http://iot-playground.com/swdownload/ESPfirmware/v0.9.5.2%20AT%20Firmware.bin</p>
<p>why are you flashing the firmware? as far as i know if you just want to use it as a wifi shield the standard firmware suffices, at least id did when i used it. Or am i missing something? :-)</p>
<p>I guess the standard firmware works(haven't tried though)... I had uploaded some lua code to ESP8266-01, it wasn't responding properly to AT commands... that is why I flashed a new firmware. :)</p>
<p>Lua scripts, thats NodeMCU firmware for esp8266 , it will not respond for AT commands because its using different commands</p>
<p>ah ok, i get it</p>
<p>I'm having problems with the last step...</p><p>*The &ldquo;Baud rate&rdquo; of ESP8266 has to be changed to <strong>9600</strong> in Software Serial.</p><p>*AT command &ldquo;<strong>AT+UART_DEF=9600,8,1,0,0</strong>&rdquo;.</p><p>How are where do you enter the AT commands? I've tried in the serial monitor but nothing shows up. I have to be able to change the esp8266 baud rate while it's connected to the pc through the arduino uno as I currently have no way to directly connect it to my pc.</p>
<p>I'd like to help. Make sure you know the difference between the Baud rate that your Arduino uses and the Baud rate that the ESP module uses.. I used an UNO, and it's baud rate is 9600, so your serial monitor should be set up to that rate if using an UNO. </p><p>Now, after the &quot;AT+UART_DEF=9600,8,1,0,0&quot; command, you need to alter the sketch you have loaded into the arduino, specifically the part that tells the arduino at the speed you are trying to communicate at.. for me, I had to go from 115200, to 9600 after the command.. after that, all my commands come back free of garbage. </p><p>I hope this helps, I am a newbie to this and was stuck on something similar for quite a while!</p>
<p>*Upload a blank code(bare minimum) to arduino</p><p>For AT command mode connections between arduino and esp8266 are as follows- </p><p>TXD to TX</p><p>RXD to RX</p><p>Serial monitor in &quot;NL and CR&quot; mode.</p><p>Then type &quot;AT&quot; in serial monitor, it responds with an &quot;OK&quot;.</p><p>if you get a garbage value change the baudrate and try again :) </p>
<p>I've tried this, but still getting nothing to show up after typing AT commands.</p>
<p>flash the firmware ...</p><p>Even then if nothing shows up, assume</p><p>either connections are wrong or the ESP isn't working</p>
<p>I've tried 2 different esp8266, after I flash them, does that set to 9600 baud rate?</p>
it depends the firmware you flash... if you flash the firmware given in this instructables... baudrate will be at 115200..
<p>Hello, I can't compile the &quot;ESP8266_Shield_SoftSer&quot; this is the message error that I've been receiving:</p><p>Arduino:1.6.8 (Windows 10), Tarjeta:&quot;Arduino/Genuino Uno&quot;</p><p>Opciones de compilaci&oacute;n cambiadas, reconstruyendo todo</p><p>sketch\ESP8266_Shield_SoftSer.ino.cpp.o: In function `__static_initialization_and_destruction_0':</p><p>C:\Users\Hector\Documents\Arduino\libraries\blynk-library-master\examples\BoardsAndShields\ESP8266_Shield_SoftSer/ESP8266_Shield_SoftSer.ino:40: undefined reference to `ESP8266::ESP8266(SoftwareSerial&amp;)'</p><p>collect2.exe: error: ld returned 1 exit status</p><p>exit status 1</p><p>Error compilaci&oacute;n en tarjeta Arduino/Genuino Uno.</p><p>Is a library missing? I've downloaded all the libraries that you suggested. If you have any idea It would help me a lot. </p><p>Thanks. C:</p>
<p>install <strong style=""><a href="https://github.com/blynkkk/blynk-library/releases/download/v0.3.4/Blynk_v0.3.4.zip" style="">Blynk_v0.3.4.zip</a> [</strong> <a href="https://github.com/blynkkk/blynk-library/releases">https://github.com/blynkkk/blynk-library/releases </a> ] library and check again. :)</p>
<p>Thanks!! </p><p>Now I'm playing with a led!! </p>
<p>again error ? </p><p>[19] Blynk v0.3.3</p><p>[520] Connecting to PATIL</p><p>[1536] Failed to disable Echo</p>
<p>I use Arduino Mega 2560. </p><p>I do as follow and it done: I changed connection from TX1 and RX1 to RX0 and TX0 (TXD - RX0 and RXD - TX0) and change code from serial1 to serial, baudrate of esp to 9600.</p>
if you are using Arduino mega <br>use serial1 <br>RXD to TX1<br>TXD to RX1 <br>Don't change baud rate after flashing.... <br>hardware serial works fine at 115200
<p>The same with me.</p>
I guess connections aren't proper..... Or the baud rate.<br>If you are using UNO you should use software serial and initially change the baud rate of esp8266-01 to 9600 using AT commands
i use software serial program... <br>and connection is also proper...<br>esp8266 - arduino<br>RXD - PORT 2<br>TXD - PORT 3
It should be <br>Esp. arduino <br>RXD. tx (D pin 3)<br>TXD. rx(D pin 2)
<p>bro connections proper kr bhi vhi error arha h? :(</p><p>[19] Blynk v0.3.3</p><p>[520] Connecting to PATIL</p><p>[1536] Failed to disable Echo</p>
check <br>* if esp8266-01 has proper firmware<br>* if the ESP8266-01 is responding to AT commands. It(esp) should be at 9600 baud rate.<br>* esp. Arduino <br> RXD to software serial TX<br> TXD to software serial RX<br>* proper wifi with Ssid, password &amp; Internet. <br><br>If everything is correctly done it will work!
<p>help me pls? program error? what i do?</p><p>C:\Users\Shreyas\Documents\Arduino\libraries\blynk-library-master\examples\BoardsAndShields\ESP8266_Shield_HardSer\ESP8266_Shield_HardSer.ino:31:29: fatal error: ESP8266_HardSer.h: No such file or directory</p><p> #include &lt;ESP8266_HardSer.h&gt;</p><p> ^</p><p>compilation terminated.</p><p>exit status 1</p><p>Error compiling.</p>
You haven't installed proper libraries... Try to install blynk library from the given link. :)
https://github.com/blynkkk/blynk-library/releases install this library ...
Nice instructable. If you include also instructions for windows, it would be easier for new users that are not so much involved with linux.
<p>Done !</p>
Your tutorial is for mac and linux ,can this be done in windows 10...?
<p>In this tutorial the flashing is done in linux, similar commands can be used in mac</p><p>for eg:</p><p>To change the directory</p><p><strong> cd /Users/Home/Desktop/pyserial-2.7</strong> </p><p>--------</p><p>To install pyserial--- </p><p><b style="">sudo python setup.py install</b> </p><p> Flashing firmware---change the directory and the command given below, here <strong>usbmodemfd121</strong> is the device address.</p><p><strong>sudo ./esptool.py --port /dev/tty.usbmodemfd121 write_flash 0x00000<br>AT22SDK10020150320boot12.bin</strong></p><p><strong>-----------------------------------------------------------------------------------------------------------</strong></p><p><strong>In WINDOWS </strong></p><p><strong>You can probably use </strong><a href="https://github.com/Stadslab/ESP8266_example/blob/master/ESP8266_flasher_V00170901_00_Cloud%20Update%20Ready/esp8266_flasher.exe" style="">esp8266_flasher.exe</a><b style=""> to upload the </b><strong style="">AT22SDK10020150320boot12.bin file by choosing proper COM port.</strong></p>

About This Instructable




Bio: An Electronics and communication engineer !!!
More by Amith MP:Home automation using arduino with wifi, bluetooth and IR remote control Connecting ESP8266-01 to Arduino UNO/ MEGA and BLYNK 
Add instructable to: