Before attempting to use ESP8266 Module with a microcontroller like Arduino it is a good idea to test and get familiar with it by using a USB-to-Serial converter. With the converter AT commands can be issued directly to the module. Since some functions are not available on older firmware versions it is advisable to flash ESP8266 Wi-Fi module firmware to the latest version before proceeding to configure it.
Wire ESP8266 & FTDI Programmer
ESP8266 chip comes in several different packages. ESP-07 package is SMD and requires additional connections to be made. With ESP-07 pin GPIO15 need to be connected to Ground. A 10k resistor in series can be used but in practice is not needed and does not cause any noticeable effects. Before connecting power make absolutely sure that the FTDI Programmer provides 3.3V and not 5V as it could destroy the ESP8266 module. To put the module into flash mode GPIO0 pin also need to be connected to ground.
Sending RS-232 / Serial Commands
FTDI programmer or other USB-to-Serial adapter connect the ESP8266 module to a computer. To access and interpret the data being received and to send data a terminal emulator is needed.
Putty is a popular option on Windows. It has in-built Serial terminal but does not work with older ESP8266 firmware versions. With latest ESP8266 firmware it works reliably but lack some convenient features. Putty is a good option as it can be used for many other tasks such managing Unix based operating systems remotely.
A standalone option for Windows is termite. Unlike Putty it does one thing only and does it well. It is simple and works reliably even with older ESP8266 firmware versions.
Check ESP8266 Firmware Version
Show the module firmware version.
The output should be the AT firmware version along with the date and time it was compiled and the date the firmware was issued.
00200.9.5(b1) compiled @ Dec 25 2014 21:40:28 AI-THINKER Dec 25 2014
Save Power by Putting ESP8266 to Sleep
Put the module into deep-sleep mode.
The only parameter specifies the length of time that the module should sleep for and is specified in milliseconds (ms). A value of
1000 will put the module to sleep for 1 second. The module will not respond to the usual AT commands while in sleep mode so care should be taken not to very large values or the module may need to be power cycled to regain access to it.
Set ESP8266 Operating Mode
Set the operating mode of the module.
STA mode is short for Station while AP is an acronym for Access Point and AP+STA is a combination of both modes. Station mode allows the module to behave as only a client and connect to an access point – commonly a router. Access point mode allows other clients including ESP8266 module in STA mode to connect to it. AP+STA mode allows both modes of operation simultaneously. This means the module can connect to clients and clients can connect to the module at the same time. With this mode a bridge can be formed allowing the module to relay network packets from any device type to any other device type such as AP to AP.
Once the mode has been set, configure ESP8266 Wi-Fi module as an access point and/or configure ESP8266 Wi-Fi module as a station / client.
Toggle ESP8266 Command Echo
Optionally disable AT command echo.
Default setting is
ATE1 which will return the AT command entered before outputting the response.
Set ESP8266 Baud Rate
Baud rate determines how fast the serial data is transmitted. Software serial library on Arduino is limited and can become unreliable at higher baud rates. Since older firmware versions have 115200 baud rate by default and do not have the ability to change it it is necessary to flash ESP8266 module firmware to a newer version to be able to use it with software serial library.
Check the current baud rate.
Check possible valid baud rate range.
Set the baud rate.
Reset the module to make sure the changes take effect.