Monday, 20 April 2015

ESP8266 Setup


i'm using ESP-01 Version

Hardware pinout

Normal mode operation

Normal boot from flash, normal working mode
  • VCC- 3.3 ONLY! draws 20mA-250mA
  • GND-..
  • RX- connects to TX of arduino or similar controller
  • TX- connects to RX, ditto above
  • GPIO0/2- general purpose in out
  • RST- reset (LOW = reset active)
  • CH_PD- chip power down i.e. (LOW = power down active)
  • Red LED- power
  • Blue LED- status
Note it has been said that the last 4 pins must be attached to VCC, however Great Scott the youtuber has had success with only the CH_PD attached to VCC.


Needed a ttl to usb adaptor very cheap 1-2 pounds- i prefer the cable as its easier to work with. 

Following this tutorial (and for updating the firmware this great Video from Kevin Darrah- check his channel out!) i will update the firmware using a USB - TTL cable, i'm powering the ESP with the arduinos 3.3v and ground although the arduino wont give the max current the ESP will take it will be enough for updating the firmware (just a bit slower). the green TX of the TTL cable goes to the RX of the ESP and the white RX of the TTL to the TX of the ESP.

Flash mode pin config

The other side of the cable im holding is USB and goes to ...the computer.
Im only using the power form the arduino here.
Note the shared ground. 

  • VCC- 3.3 from arduino
  • GND- from arduino also shared with the TTL cable
  • RX- connects to TX of TTL (green)
  • TX- connects to RX of TTL (white)
  • GPIO 0- set LOW
  • GPIO 2- set HIGH
  • GPIO 15- set LOW OR HIGH?! (SDM model)
  • RST- reset HIGH 
  • CH_PD-  HIGH

  • When the ESP is connected up- with power then connect to the computer. Before flashing with the software on the tutorial, make sure that you have updated the driver for the usb cable, goto devices and printers and auto update the driver. Now you should be able to flash the device.

    Follow the video and blog!

    And Then?

    if you have followed the tutorial, and have flashed the chip with new firm ware, we can now test it. Open the arduino IDE and select the com port that your ttl cable is connected to, open the serial monitor and try some commands.

    Some chips are already set to work at 9600 baud rate mine was, if not you might have to try 
    115200 and possibly others. Set auto scroll and "Both NL & CR"

    • AT
      • a simple test it should return "OK"
    • AT+RST
      • resets the board returns "[System Ready,]" could fscanf or read for this line to ensure it has been restarted. (changed from firmware version to version)
    • AT+GMR
      • tells you the firmware its running
    • AT+CWMODE=?
      • tells you what modes it will accept: can be..
      • a device on the network
      • an access point- can log into it setup a password and ssid (completely stand alone device)
      • both
    • AT+CWMODE=1
      • changes mode 1-3
    • AT+CWMODE?
      • current mode
    • AT+CWLAP
      • displays wifi points
    • AT+CWJAP="SSID wifi name","password"  
      • connects to WIFI
    • AT+CWJAP?
      • check to see if connected to WIFI
    • AT+CIPMUX=1
      • setting it to accept multiple connections, required for the tcp connection to the internet.
      • Must always set the every time device is powered down!!!
    • AT+CIPMUX?
      • current mode
    • AT+CIPMODE=0
      • not data mode (= 1 is possible to set data streaming mode)

    And Then?

    So now we can connect to a wifi network and set the ESP to different modes.

    In my next post i'm going to have examples of getting data from the internet using the last two links under useful Reference Material. Here for a video

    Useful Reference Material


    Kevin Darrah- Just go there!
    Great Scott!- Lots of links in the info box (under the video)
    Julian Llett- Alot of interesting videos, lots of iot stuff
    AllAboutEE- Same as above

    Yahoo Query Language-
    Yahoo Query Language tutorial-

    No comments:

    Post a Comment