Basic ESP8266 Setup and Operation

(click here to see index of all ESP8266 posts)

I started playing with an ESP8266-01 WIFI module a bit in the last week. The ESP8266 is a cheap and small WIFI module that communicates serially almost exactly like the GPRS cellular radio I was playing with last month.

You can connect it to an Arduino (or a PC for that matter) and xmit/receive data serially much as you would have done with a modem way back when. But, people have been tweaking it to the extent that you may well not even need an arduino.

The Hardware

I purchased my first ESP8266 from Amazon Prime so it would show up pretty quick, and it was still pretty cheap at $8:

I didn’t sit down to figure anything out until it arrived. I discovered that it needs 3.3v and the data pins are not 5v tolerant. I only have a 5V FTDI cable. You could play with voltage dividers, level converters, or get a 3V FTDI cable. I opted to get this regulated breadboard adapter instead from ebay:

This solves the voltage problem and let’s me connect the ESP8266 into a breadboard which is handy to flash the firmware, if nothing else.

Note: the ESP8266 is oriented on this board such that the ESP8266 will hang off the adapter, not over it (in the picture of the adapter above, the ESP8266 connects with its pins on its left).

Your FTDI cable should look like this:

Using M-F jumper wires, connect VCC and GND and connect tx->rx and rx->tx (cross over).

Once the FTDI cable is connected, plug it into your PC. You should see a red LED come on solid on the ESP8266 and a blue LED will flicker momentarily at start up.

Aug 2015 Update: Don’t know how I didn’t see this first time thru, but if your FTDI cable has pinouts in the same order as listed above, you can connect it directly to the adapter.

At this point, you are connected and you can go into the terminal emulator of your choice.

For my ESP8266, it communicates using 9600 baud 8-n-1. When you type AT, you should see AT echo back. If not, try different baud rates.

From what I can tell, the more recent version of the firmware requires that lines be terminated with control-m control-j, not just control-m (e.g. enter). So if pressing just ENTER does not give you a OK response, type control-j and that should do it. See here for more info on the control-j issue:

ESP8266 Echos AT but will not Respond with OK

Updating Firmware

For my ESP8266, typing AT+RST resets the chip and displays the revision of the firmware.

I had trouble finding the actual updated firmware. Most of the instructions point to to a page that no longer exists. This probably changes on a weekly basis, so the best bet is to google esp8266 firmware update and see what you can find. My link below may very well go out of date quickly.

I found this website had links to a loader and firmware (.09.02.02) that worked for me:

To do the upgrade,

  • Unplug ESP8266 from USB
  • Connect GPIO0 pin to ground
  • Plug ESP8266 back into USB
  • Start the esp8266_flasher.exe program.
  • Enter the name of the file containing the firmware
  • Enter the appropriate COM port.
  • Click download button


It’s OK to get the ‘failed to leave flash mode’ message.

I reconnected to the ESP8266 and verified that I could connect to it serially.

Testing the ESP8266

Working from the wiki, I tried several types of communication to my echo server to verify I understood how to communicate.

The wiki is here:

Info on setting up an echo server is here:

Establishing a Network Connection

CWMODE=1 sets the ESP8266 to act as a station (rather than an access point). The we list all visible Access points:


+CWLAP:(0,"Wind Wireless 10",-88,"00:15:6d:63:a1:74",9)
+CWLAP:(3,"246C 2.4",-93,"e4:f4:c6:13:7c:26",9)


Now we connect to the access point and request the assigned IP address:




 Send TCP Data in Non-transparent Mode

CIPMUX=0 indicates we will allow for only 1 connection. We then setup the TCP session with CIPSTART. AT+CIPSEND must be told the number of characters to be transmitted. The data, hello world, is then typed. We receive the data echoed back as +IPD,11 … and finally we close the the session:



> hello world

+IPD,11:hello world


Transmit TCP data in Transparent Mode

Transparent Mode is like serial modems used to act. Once the connection is made, data flows back and forth until it is interrupted with ‘+++’. In this example, as I type each character, it is echoed back to me immediately by the echo server so you will not see the data in a separate line as you did above.

Note, the +++ must be typed in fast. To do this, copy +++, then paste it into the terminal emulator.




>This is a test
hello world
<<< +++ was pasted here >>


Sending a UDP Packet

To send a UDP packet, you must allow mutiple connections via CIPMUX=1. Otherwise, it is very similar to TCP above:




> hello world
+IPD,4,11:hello world




This entry was posted in c-esp8266 and tagged . Bookmark the permalink.

3 Responses to Basic ESP8266 Setup and Operation

  1. Zero says:

    Excelent post, but no matter what i do, i cannot exit transparent mode.

    • Dan TheMan says:

      When I tried transparent mode, I had to paste the ‘+++’ into the terminal emulator to get it to work. Just typing +++ didn’t work. Way back in the days of analog modems I believe one of the S registers set the time required between typing each +. You might see if there is still such an S register and if it makes any difference.

      I looks like I will be playing with the ESP8266 again soon. If I come up with any additional information while playing with it I’ll try to remember to post it here.

  2. Pingback: ESP8266 and Using the Arduino IDE | Big Dan the Blogging Man

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s