The ESP8266 ESP-01 is a Wi-Fi module that allows microcontrollers access to a Wi-Fi network. This module is a self-contained SOC (System On a Chip) that doesn’t necessarily need a microcontroller to manipulate inputs and outputs as you would normally do with an Arduino, for example, because the ESP-01 acts as a small computer. Depending on the version of the ESP8266, it is possible to have up to 9 GPIOs (General Purpose Input Output). Thus, we can give a microcontroller internet access like the Wi-Fi shield does to the Arduino, or we can simply program the ESP8266 to not only have access to a Wi-Fi network, but to act as a microcontroller as well. This makes the ESP8266 very versatile, and it can save you some money and space in your projects.

In this tutorial we are going to show you how to set up the ESP-01 Wi-Fi module, configure it, and verify that there is communication established between the module and another device.

Step 1: Materials

Step 2: ESP-01 Setup

When you buy the ESP8266 ESP-01, it comes with a pre-installed AT firmware. It is possible to program the chip with another firmware such as NodeMCU, for example. However, AT firmware is compatible with the Arduino IDE, so we are going to use this firmware for this tutorial. If you want to know how to install a different firmware, then read the Miscellaneous section in this tutorial.

First use the jumper wires to connect the Wi-Fi module to the Arduino as shown in these images.

Step 3: ESP-01 Setup Continued

Upload the BareMinimum example to ensure that no previous programs are running and using the serial communication channel. Next, open the serial monitor and type the following command:


You should get an “OK” response. This means that the module is working and that you are good to go. Now we are ready to test a two way communication between the module and another device.

Step 4: Basic AT Commands

The ESP8266 ESP-01 module has three operation modes:

  1. Access Point (AP)
  2. Station (STA)
  3. Both

In AP the Wi-Fi module acts as a Wi-Fi network, or access point (hence the name), allowing other devices to connect to it. This does not mean that you will be able to check your Facebook from your device while the ESP-01 module is operating in the AP mode. It simply establishes a two way communication between the ESP8266 and the device that is connected to it via Wi-Fi.

In STA mode, the ESP-01 can connect to an AP such as the Wi-Fi network from your house. This allows any device connected to that network to communicate with the module.

The third mode of operation permits the module to act as both an AP and a STA.

Step 5: Basic AT Commands - STA Mode

In this tutorial, we are going to set the module to operate in STA mode by typing the following command:


The corresponding number for each mode of operation is as follows:

  • STA = 1
  • AP = 2
  • Both = 3

Step 6: Basic AT Commands - Check Mode

If you want to check what mode your Wi-Fi module is in, you can simply type the following command:


This will display a number (1, 2, or 3) associated with the corresponding mode of operation.

Step 7: Basic AT Commands - Connecting Wi-Fi Network

Once we have the ESP-01 operating in STA mode, we need to connect to a Wi-Fi network. First we can check if we are already connected to one by sending the command:


This will display the station IP address of our ESP-01 module. If you don’t get an IP address after entering the previous command, use the following command to connect to your network:

AT+CWJAP= “Wi-FiNetwork”,“Password” 

Type the name of your Wi-Fi network and the password to connect to it. Make sure you include the quotation marks. After a couple of seconds, you should get an "OK" response. You can check again to see if you have an IP address using the AT+CIFSR command.

Step 8: Basic AT Commands - Enable Connections

Then we need to enable multiple connections before we can configure the ESP8266 ESP-01 module as a server. Type the next command:


Once again, each number is associated with a type of connection:

  • Single = 0
  • Multiple = 1

The following step is to start the server at port 80:


The first number is used to indicate whether we want to close server mode (0), or open server mode (1). The second number indicates the port that the client uses to connect to a server. We chose port 80 because this is the default port for HTTP protocol.

Step 9: Basic at Commands - Response

Now, when we open a web browser and type the IP address of our ESP module we get the following response as shown in the image above.

This is the HTTP request that our computer sends to the server to fetch a file. It contains some interesting information such as what file you want to retrieve, name of the browser and version, what operating system you are using, what language you prefer to receive the file in, and more.

Step 10: Basic AT Commands - Send and Display Data

We can now use the following commands to send some data and display it in our web browser’s window:


The “0” indicates the channel through which the data is going to be transferred; while “5” represents the number of characters that are going to be sent.

When we hit enter, the symbol “>” appears. This indicates that we can now type the characters that we want to send to the browser. In this example we chose “hello.”

After a couple of seconds we get the response "SEND OK." This means that the data has been transmitted successfully to the client. However, nothing appears on the web browser’s window yet. This is because it is required to close the channel first in order to display the characters. We use the following command to close the channel:


“0” indicates the channel that is being closed.

Once we hit enter, our message is displayed on the web browser’s window as shown in the image above.

You can refer to the following site to see the ESP8266 AT Command Set:

Step 11: Check That Our ESP-01 Receives Data - Mobile Telnet

Now we want to check that our ESP-01 module receives data. We will use the Android application “Mobile Telnet” to test this.

  1. Open the Android application and from the menu select “Telnet Settings."

Step 12: Check That Our ESP-01 Receives Data - Mobile Telnet Con.t'

Type in the IP address and the port number.

Click “OK” and from the menu select “Connect.”

Step 13: Check That Our ESP-01 Receives Data - Mobile Telnet Con.t'

Type the characters that you want to send and then click the “Send” button.

Step 14: Check That Our ESP-01 Receives Data - Mobile Telnet Con.t'

We get the following response as shown in the image above on the serial monitor.

The message is successfully received and displayed.

Step 15: Check That Our ESP-01 Receives Data - PuTTY

Instead of Mobile Telnet, you can also use PuTTY to check that the ESP-01 is receiving data correctly. You can download PuTTY here.

If you decide to use PuTTY follow these steps:

  1. Open the program
  2. Select “Telnet” as the connection type
  3. Type the IP address and the port number
  4. Click on “Open"

Step 16: Check That Our ESP-01 Receives Data - PuTTY Con.t'

5. Type the characters that you want to send and hit “Enter.”

Step 17: Check That Our ESP-01 Receives Data - PuTTY Con.t'

We get the same response as before.

Step 18: Miscellaneous - Different Firmware

If you want to use a different firmware such as NodeMCU, you need to download an ESP8266 flasher such as this one. Then you need to download the binary file. You can use the following site to do it. Make sure you download just the integer type.


Step 19: Different Firmware Set-up Con.t'

Open the ESP8266 flasher and select the bin that you just downloaded. Select the serial port and type 0x40000080. Before you click on “Download,” make sure you ground GPIO0. This is required every time a new firmware is being flashed.

When you click on “Download” the flasher will delete the current firmware and start installing the new one.

Step 20: Different Firmware Set-up Con.t'

Once the firmware has been installed, you can disconnect GPIO0 and use it normal.

We hope you enjoyed this Instructable, and you can find more tutorials about the ESP8266 and more on Jaycon System's website.

If you have any questions about this tutorial, do not hesitate to post a comment, shoot us an email, or post it in our forum.

Thanks for reading!

<p>It is taking too long like 5 to 10 min to connect to the IP which was generated, is there any solution to it??</p>
<p>I'm a complete newbie at this stuff so forgive me if I'm confused, but I noticed a few things in these instructions that may explain why people are having problems. If I'm off-base, please correct me so I can learn something :).</p><p>1) In everything I've read about asynchronous serial communication, the Rx, Tx of one side should be wired to the Tx, Rx of the other side. You show Rx -&gt; Rx and Tx -&gt; Tx...why is that?</p><p>2) The arduino Tx line will be driven at 5V and the ESP-01 Rx line should (I've read) only be exposed to 3.3V, so most guides show a level converter between them. (Maybe the same applies to the arduino Rx line)</p><p>3) The 3.3V output of the arduino may not supply the peak current that the ESP-01 may need at times.</p>
<p>You're right on all three. Rx should go to Tx, and Tx to Rx. This is likely why so many comments are about being unable to get a response, saying they wired exactly as it says. ESP Tx should be on Uno Pin 0, and ESP Rx should be Uno Pin 1<br><br>A logic level converter is needed so the esp8266 isn't damaged from the 5V. But if you supply the arduino from a 3.3-3.7V source you don't need it. Powering from USB or a wall plug you need logic level shifting or it will eventually damage the ESP-01. May work for a little while anyways, but why risk it.<br><br>And the Arduino 3.3V current supplies up to 200mA per the specs, and Esp8266 can draw up to 250mA. It's likely it will still work and never reach 250mA, but there is still potential for communication errors and unstable operation.</p>
<p>My ESP-01 now is working and responding to commands, but I can connect to the network... somebody can help? </p>
<p>When I do the AT commands it give me a response of unreadable its like encrypted character. somebody can help?</p>
Bottom right side select cl &amp; rf or something like that and choose correct baud rate. Most likely 9600
<p>may I know which bottom? is it in serial monitor? </p>
<p>Success! ... did two things ... 1) added batteries to power ESP ( common grnd), and 2) switched Tx Rx lines in my frustration .. lables on Uno are confusing ..</p><p>Anyway as soon as I did it responded to AT and serveral other commands including </p><p>AT+GMR</p><p>AT version: 5 2015 16:27:16)</p><p>SDK version:1.1.1</p><p>Ai-Thinker Technology Co. Ltd.</p><p>Jun 5 2015 23:07:</p><p>2015 ... I would assume I need firmware update ... it was not responding to some of the AT commands .. ( AT+CLOMODE=1 ..</p><p>Also .... it did respond with an IP Address ( AT+CIFSR)</p><p>AT+CIFSR</p><p>+CIFSR:APIP,&quot;;</p><p>+CIFSR:APMAC,&quot;5e:cf:7f:84:ba:ed&quot;</p><p>.. but Chrome could connect to it </p><p>I was unable to log in using AT+CWJAP=&quot;Name&quot;,&quot;PW&quot; .. go ERROR</p><p>Also on my IPhone I can see a device AI-Thinker_9 but not showing an IP Address ...</p><p>Anyway having a blast ... baby steps </p><p>G</p>
<p>Yes, in async serial communications the connections are Rx -&gt; Tx and Tx -&gt; Rx, this looks like a mistake in the instructions. I've also read that the 3.3v output of the arduino may not provide enough current to the ESP-01, your message seems to validate these points. Did you put a level converter on the arduino Rx, Tx so that the ESP-01 isn't subjected to 5V (outside its operating range?) </p>
Yes I did use level converter
<p>i did the connections same as above but i got this error every time i upload a program. no response to AT commands..and please help me with this confusion .... while checking AT commands should we remove arduino IC or do simply as it is?</p><p>warning: espcomm_sync failed</p><p>error: espcomm_open failed</p><p>error: espcomm_upload_mem failed</p><p>error: espcomm_upload_mem failed</p>
<p>Nice tutorial, thanks. I've tried two different Uno boards with two different 8266 boards (Makerfire) and end up at the same place ... when I type AT ... nothing.</p><p>I've checked voltages &amp; wiring multiple times. Reading the thread here has helped ( baud rate etc) but can't seem to isolate the problem. So . I'll go try a different experiment &amp; come back to this one. I'm sure its something basic but doubt you can offer more than is already here.</p><p>Anyway these things are like puzzles ... keeps it interesting.</p>
<p>It's been a while, but I was using thing guide and saw this comment. I was having trouble, too. One amazon review of the Makerfire chip said that they had to reflash the firmware. And, I also wired GPIO0 to the 3.3V (along with VCC and CH_PD).</p><p>I'm getting the &quot;OK&quot; response now.</p>
<p>Have you tried changing the baud rate to &quot;115200&quot; and select &quot;Both NL &amp; CR&quot; in the serial monitor, as wklin pointed out earlier? I was in the same position and that solved my problem.</p>
<p>Hello guys, </p><p>Everything works fine with the AT commands, but the browser doesn't connect to the IP address. I tried both the IPs, 'APIP' and 'STAIP' but no luck. The telnet thing says 'connection refused'. </p><p>What should I do??</p>
<p>UPDATE: AT Commands are working fine, I can connect to my home network but the second I want to check the IP address (AT+CWJAP?), I get &quot;busy p...&quot; then a FAIL message and +CWJAP:3. If you have a dual band router, you need to connect to the 2.4GHz network.</p>
<p>For those of you using the ESP8266 ESP-01S (S Series) will realise that VCC and CH_PD is not listed on the afore mentioned module. I have inserted jumper wires into the &quot;3V3&quot; (which replaces the VCC) and the &quot;EN&quot; (which replaces the CH_PD). I then ran the BareMinimum Sketch, opened the serial monitor, changing settings to &quot;Both NL &amp; CR&quot; and &quot;115200 baud rate&quot;. This worked for me. However, I do notice that the module is getting slightly warm.</p>
<p>Excellent article! You should approach tips like <a href="http://www.geekstips.com/arduino/esp8266-01-wifi-module-for-arduino-review-and-tutorial" rel="nofollow">the DEEP SLEEP workaround for ESP-01</a> . Many people are buying ESP 12 version just because they don't know that ESP01 can handle DEEP SLEEP mode too by just soldering a little wire to the MCU.</p>
<p>Awesome tutorial. Grade A stuff</p>
<p>i did the connections same as above but i got this error every time i upload a program. no response to AT commands..and please help me with this confusion .... while checking AT commands should we remove arduino IC or do simply as it is?</p><p>warning: espcomm_sync failed</p><p>error: espcomm_open failed</p><p>error: espcomm_upload_mem failed</p><p>error: espcomm_upload_mem failed</p>
<p>Hi Thanks for this stuff ...I had did the exact connection between arduino and ESP8266 as in instructable. While giving the AT cmd i am not getting any response from ESP. Please give the solution for this, if it available</p>
<p>Hi! Thanks for reading! Double check your connection from the ESP to the Arduino as shown in the four diagrams in Step 2. If that doesn't work, then you may need to update your firmware. Arduino IDE Version 1.6.5 works best with ESP8266. If you are using an earlier version of Arduino IDE, then that may be the problem. If that is not the problem, then reply back or make another comment, and we'll try and find the solution for you. Best wishes!</p>
Thanks for the reply geek, My connection between ESP and Arduino is perfect.<br> Is there anyway to find the current working Firmware version of ESP8266, If in this case how it is, or <br>kindly provide me how i can update my new firmware version which is best suitable for this ESP, then please mention the version . <br>Provide me if there is any instructable or link for perfect firmware update.
<p>Hi calibrearun. We wanted to make sure we gave the basic advice as we weren't sure where the specific problem was occuring. Thank you for provdiing more details. This instructable: <a href="https://www.instructables.com/id/Intro-Esp-8266-firmware-update/">https://www.instructables.com/id/Intro-Esp-8266-fir...</a> suggests this site: <a href="http://www.xess.com/blog/esp8266-reflash/">http://www.xess.com/blog/esp8266-reflash/ </a> that provides links to currently working firmware for the ESP8266. And here is a direct link to download the firmware: <a href="https://github.com/espressif/ESP8266_AT">https://github.com/espressif/ESP8266_AT </a> <br>Please let us know if there is anything else we can do, and if these solutions help your project. Thank you for reading, and let us know how your project went. Best wishes. </p>
<p>i did the connections same as above but i got this error every time i upload a program. no response to AT commands..and please help me with this confusion .... while checking AT commands should we remove arduino IC or do simply as it is?</p><p>warning: espcomm_sync failed</p><p>error: espcomm_open failed</p><p>error: espcomm_upload_mem failed</p><p>error: espcomm_upload_mem failed</p>
<p>I had the same issue as you at beginning, no responding after typing AT. However, I change the baud rate to &quot;115200&quot; and select &quot;Both NL &amp; CR&quot; at the bottom-right of the serial monitor and things were working fine.</p><p>I got the hint from <a href="http://rancidbacon.com/files/kiwicon8/ESP8266_WiFi_Module_Quick_Start_Guide_v_1.0.4.pdf" rel="nofollow">http://rancidbacon.com/files/kiwicon8/ESP8266_WiFi...</a></p>
<p>wklin, your comment worked perfect for me. Thanks!</p>
<p>There may be two issues with the setup presented here that would lead to erratic behavior of the 8266</p><p>a) Ard Tx &amp; Rx are 5v .. should use level shifted (https://www.hackster.io/rayburne/esp8266-01-using-...</p><p>b) The Ard 3.3V supply is probably insufficient for the 100ma draw from the 8266 when Txn, which would reset it if V spikes below 3v</p><p>Of couse the author knows a lot more about this than I do as a newbie .. but for what its worth I'll pass these observations along from other sites I've visited</p><p>G</p>
<p>Gtmize - make sure you are sending CR + LF at the end of the lines you type or the ESP will ignore you.</p><p>It took me a little while to figure that one out.</p>
<p>Great instructions, thank you so much! The comments also helped a lot - e.g. I needed the Serial Monitor set to &quot;115200 baud&quot; as well as &quot;Both NL &amp; CR&quot; to get it working.</p>
<p>Hi really you well done. many many thanks. In my idea this is the best tutorial that I could find in the net. it was for long times I wanted to work with esp8266 wifi but was not able because of not correct and enough information in the net I was found., But with this tutorial I could get lots of information and could handle my job this is the first tutorial I studied I am sure with next two tutorial I can get all I need. Again thanks and best regards </p>
<p>hi can you help me?</p><p>&eth;AT</p><p>OK</p><p>AT+CWMODE=1</p><p>OK</p><p>AT+CWMODE?</p><p>+CWMODE:1</p><p>OK</p><p>AT+CIFSR</p><p>+CIFSR:STAIP,&quot;;</p><p>+CIFSR:STAMAC,&quot;60:01:94:0f:7f:32&quot;</p><p>OK</p><p>AT+CWJAP= &quot;SINGTEL(5G)-7787&quot;,&quot;0015103879&quot;</p><p>ERROR</p>
<p>&eth;AT</p><p>OK</p><p>AT+CWMODE=1</p><p>OK</p><p>AT+CWMODE?</p><p>+CWMODE:1</p><p>OK</p><p>AT+CIFSR</p><p>+CIFSR:STAIP,&quot;;</p><p>+CIFSR:STAMAC,&quot;60:01:94:0f:7f:32&quot;</p><p>OK</p><p>AT+CWJAP= &quot;SINGTEL(5G)-7787&quot;,&quot;0015103879&quot;</p><p>ERROR</p>
<p>hello, what if i get: AT+CWJAP=&quot;SINGTEL(5G)-7787&quot;,&quot;0015103879&quot;</p><p>+CWJAP:3</p><p>FAIL</p><p>what should i do?:( please help thanks:)</p>
<p>I tried nearly all tutorials about beginning to use ESP8266 but I haven't succeeded yet.</p><p>- I made the wiring as shown in the diagram,<br>- Uploaded bare minimum,<br>- Used serial monitor and saw ready message</p><p>But I didn't get any response for AT command. And after a short while ESP started to reboot itself every 10 seconds. And gets really really hot. This is the message after every reboot:</p><blockquote>ets Jan 8 2013,rst cause:4, boot mode:(3,5)</blockquote><blockquote>wdt reset<br>load 0x40100000, len 1396, room 16<br>tail 4<br>chksum 0x89<br>load 0x3ffe8000, len 776, room 4<br>tail 4<br>chksum 0xe8<br>load 0x3ffe8308, len 540, room 4<br>tail 8<br>chksum 0xc0<br>csum 0xc0</blockquote><blockquote>2nd boot version : 1.4(b1)<br>SPI Speed : 40MHz<br>SPI Mode : DIO<br>SPI Flash Size &amp; Map: 8Mbit(512KB+512KB)<br>jump to run user1 @ 1000</blockquote><blockquote>{l�&sbquo;{l&Igrave;&yuml;<br>Ai-Thinker Technology Co.,Ltd.</blockquote><blockquote>ready</blockquote><p>I have been trying to make this board work for more than 10 hours and I am about to give up. I hope someone can help me with it.</p>
<p>I have connect the esp to arduino nano... I am not able to upload the bareminimum program and the esp is not responding to any AT commands... please help</p>
<p>Hi Thanks for this stuff ...I had did the exact connection between arduino and ESP8266 as in instructable. While giving the AT cmd i am not getting any response from ESP. Please give the solution for this, if it available</p>
Hi! Connect the Arduino (or ftdi) ground and Esp power supply ground. this solve the problem.
<p>I'm glad I could help.<br>If you have any questions feel free to write me!</p>
<p>Hi and thanks for the great tutorial. I'm stuck on step 9, I can't get it to accept my WiFi network &amp; password!! I use AT+CWJAP=&ldquo;MyWiFiSSID&rdquo;,&ldquo;MyPassword&rdquo; but all I get is ERROR. When I use AT+CWLAP i can see my Wifi network listed. Any advice?</p>
<p>use &quot; instead of &ldquo; and &rdquo; and of course your own SSID and password.</p>
<p>I have 1 question with regard to step 2: Whether this is safe? In this <a href="https://www.instructables.com/id/ESP8266-Wi-fi-module-explain-and-connection/" rel="nofollow"> https://www.instructables.com/id/ESP8266-Wi-fi-mod...</a></p><p> in step 7 and some other materials tell us that we should use a voltage divider (for example) between Tx pin from Arduino to Rx pin on ESP, to lower the voltage from 5 to 3.3 V. I would like to be able to hook it as shown in this example but I'm afraid about my ESP device...</p>
<p>Hi Thanks for this stuff ...I had did the exact connection between arduino and ESP8266 as in instructable. While giving the AT cmd i am not getting any response from ESP. Please give the solution for this, if it available</p>
By default esp8266 comes with baud rate of 115200.. For testing upload blank code to arduino then open Arduino serial monitor screen and set baud rate to 115200.. Send AT command and check for response. If still doesn't work try with other baud rate.
<p>Hi..I tried doing all that was suggested above but nothing worked for me..the serial monitor displays nothing for the AT commands..plz help..my project is stuck just bcoz of this.. :( </p>
<p>This is a great product!! I've been looking for something like this! Is it be possible to use I2C and a modified(?) version of the arduino wire library?</p>
<p>Thanks for reading! Here is the datasheet for the ESP8266 which explains the pins that should be used with I2C in section 3.4, but the datasheet as a whole is helpful: <a href="https://www.adafruit.com/images/product-files/2471/0A-ESP8266__Datasheet__EN_v4.3.pdf">https://www.adafruit.com/images/product-files/2471...</a> <br>Also, here is a link to an updated software download for the ESP8266: <a href="https://github.com/plerup/espsoftwareserial">https://github.com/plerup/espsoftwareserial </a> <br>In the previous comment I mentioned the different firmwares that can be used to update the ESP8266. I hope this helps your question. <br>Best wishes!</p>

About This Instructable




Bio: We are tinkerers, inventors, geeks, students, teachers, hobbyist, engineers, and dreamers. We provide the building blocks to your projects!
More by JayconSystems:Sending Commands Via the LCD Backpack Programming a Single 7 Segment Display The Complete Guide to DIY Molding & Resin Casting  
Add instructable to: