From charlesreid1

Notes on the ESP8266 chip.

ArduinoWifi.jpg

Overview

This board enables Arduinos and other embedded devices to communicate with wireless networks via the 802.11 protocol.

The board has a microchip that implements the entire TCP/IP stack, so you don't have to implement it on your embedded device. The embedded device simply uses serial commands to control and interact with the chip. Think of it as a dumbed-down, physical API for wifi.

The chip has an 8-pin array on the underside. The pins here use 3.3 V logic, so it is important you use it with embedded devices that also use 3.3 V logic! Some embedded devices (such as the Arduino Uno) use 5 V logic. If you have a device using 5 V logic, you need a down-converter (also called a level shifter) to convert the 5 V logic signals to 3.3 V logic signals.

Pinout

The 8 pins on the chip are arranged as follows:


TOP VIEW:

___________________________________________
|        _______            _____________  |
|   (1)  | O O | (2)        |   _________| |
|        |     |            |   |________  |
|   (3)  | O O | (4)        |    ________| |
|        |     |            |   |________  |
|   (5)  | O O | (6)        |    ________| |
|        |     |            |   |________  |
|   (7)  | O O | (8)        |            | |
|        -------            |            | |
|__________________________________________|

(1) TXD     (2) GND
(3) CH_PD   (4) GPIO2
(5) RST     (6) GPIO0
(7) VCC     (8) RXD

Serial Communication

To communicate with the chip, use serial commands, at a baud rate of 57600.

Commands fall into three different categories:

  • Set
    • Modify the parameters on the chip
  • Inquiry
    • Read the current state of the chip's parameters
  • Test
    • Return the different modes supported

The AT commands are all listed in the following table: http://wiki.iteadstudio.com/ESP8266_Serial_WIFI_Module#AT_Commands


Mini USB to Serial UART Board

I was using a PL2303 board, which has a Mini USB connector on one side and four serial pins on the other. Once nice aspect of this board is, you can control the voltage level with a jumper, so it can operate in 3.3 V or 5 V mode, depending on how you place the jumper.

Originally, I made the mistake of using an ArmorView USB to TTL 4-pin connector, which was a cheap knockoff of a USB-to-serial adapter from Prolific. I hooked it up to the board and tried to send a signal to it. However, the ESP8266 requires 3.3 V, so I fried the board. The board was only hooked up for about 5 seconds, but it still got cooked - it smelled like overheated electronics and was physically hot.

Using the PL2303 board solves that problem. It is relatively straightforward:

Wiring of PL2303 and ESP8266

To wire up the Mini USB to serial adapter,

Serial Software

To communicate with the serial device, I used Pyserial, which is a Python library for communicating with serial devices.

The program we will write will communicate with the wifi chip by sending various AT commands out over the transmit wire. There is a comprehensive list of all of the AT commands here: http://wiki.iteadstudio.com/ESP8266_Serial_WIFI_Module#AT_Commands

To test communication with the device, I started by sending a simple "AT" command. The ESP8266 should return an "OK" message.

Serial Experiments

I had problems hooking this thing up. These boards have no documentation whatsoever, there are ten different versions of the board floating around, several different versions of firmware, and nobody who has tinkered with this board, it seems, is capable of articulating complex ideas with words. (Or pictures.)

That means I'm pretty much on my own.

ESP8266/Serial Debugging

Still no luck.

Reflashing the ESP8266

ESP8266/Reflashing

Useful (and Not-So-Useful) Links

Guides to ESP8266

Links that guide you on the usage of the ESP8266 chip.

Wiki Guides

Wikis that have some information on the ESP8266 board:

Comprehensive guide to this chip here: http://wiki.iteadstudio.com/ESP8266_Serial_WIFI_Module

Nurdspace page with basically the same info: https://nurdspace.nl/ESP8266#Translated_datasheet

Electrodragon wiki page (with plenty of additional links and documents): http://www.electrodragon.com/w/index.php?title=Category:ESP8266

Reflashing the ESP8266

Guide to reflashing the ESP8266:

The only sensible guide I've found to flashing the ESP8266: http://www.xess.com/blog/esp8266-reflash/ (Warning: requires Windoze)

esptool, designed as a cross-platform replacement tool for reflashing the memory in these chips: https://github.com/themadinventor/esptool

To reflash the firmware with an image called the "AT Command" firmware, I used a Google Drive link [1] posted on Xess.com in one of the blog posts linked to above [2].

Github Code

Various Github projects that are useful for dealing with the ESP8266:

Link to Github repos: https://github.com/esp8266

A wiki on Github with some useful information (much of this information is also in other wikis and pages though): https://github.com/esp8266/esp8266-wiki/wiki

Projects

Nice LCD display, plus ESP8266, plus Arduino, plus weather station sensors: http://zeflo.com/2014/esp8266-weather-display/

Flags