ESP8266

From ElectroDragon
Revision as of 06:09, 26 September 2015 by Chao (Talk | contribs) (Steps and note)

Jump to: navigation, search

Module wiring

  • Use FT232RL can supply enough power, must be genius IC of course
  • Swap the uart pins if no data show up on the monitor
  • There are two leds on the board, one is power led (RED), another one is status LED(BLUE), when power up, pwr led keeps on and status led will blink once.
  • baud rate may work at 9600 (seems the latest correct one), 115200 or 57600

Module Pin Description

  • Normal mode: Normal boot from flash, normal working mode
  • Flash mode: Firmware flash mode
Pin Working Mode Flash Mode Description
VCC, GND* power supply, better use a standalone, and share ground with uart port
TXD, RXD** uart interface
RST Restart on low TTL
CH_PD High TTL High TTL Chip select, constant High TTL for both mode
GPIO0 High TTL(optionally) Low TTL Switch Wroking/Flash Mode
GPIO 15 Low TTL Low TTL Constant Low TTL for both mode , N/A for ESP-01
GPIO 2 High TTL High TTL Constant High TTL for both mode, maybe not necessary
Red LEDs constants on to show the power status
Blue LEDs blink when data come through

Setup Check list

  • Check wifi status: if your devices (e.g. your phone) can find a wifi spot named like "ESP_98529F" or similar, the later number part is the mac ID, if you can see this wifi spot, it means your module boot up successfully
  • check two LEDS status and wiring when boot up, red led should be keep bright on which means power is good, blue led will blink on boot up, and some data will be received on your USB-TTL tool, if no data received, double check your USB-TTL tool:
  1. try swap RX and TX lines
  2. use shared GND will standalone power supply
  • Check GPIO15, connect GPIO15 to GND if you are using the SMD model


  • Optional: Tick "new line" option on USB-TTL serial port monitor tool
  • Optional: Try baudrate 9600 or 115200 normally should be these two, old version is 115200

First time use guide

Steps and note

  • AT+RST restart the module, received some strange data, and "ready"
  • AT+CWMODE=3 change the working mode to 3, AP+STA, only use the most versatile mode 3 (AT+RST may be necessary when this is done.)

Join Router

  • AT+CWLAP search available wifi spot
  • AT+CWJAP=“you ssid”, “password” join my mercury router spot
  • AT+CWJAP=? check if connected successfully, or use AT+CWJAP?

TCP Client

  • AT+CIPMUX=1 turn on multiple connection
  • AT+CIPSTART=4,"TCP","192,168.1.104",9999 connect to remote TCP server 192.168.1.104 (the PC)
  • AT+CIPMODE=1 optionally enter into data transmission mode
  • AT+CIPSEND=4,5 send data via channel 4, 5 bytes length (see socket test result below, only "elect" received), link will be "unlink" when no data go through

TCP Server

  • AT+CIPSERVER=1,9999 setup TCP server, on port 9999, 1 means enable
  • AT+CIFSR check module IP address
  • PC as a TCP client connect to module using socket test, send data

ESP8266-test-1.pngESP8266-test-2.png

Socket test running result

  • In the sockettest, do not tick the "secure" in TCP client, it causes unstable

ESP8266-test-3.pngESP8266-test-4.png

Note

  • Use power source that can provide sufficient current, better not using power from USB-TTL module
  • Module will automatically disconnect "unlink" TCP/UDP when no data go through
  • Wifi password length must be more than 8 bytes

Documents