Software Serial Esp8266 Programming

Software Serial Esp8266 Programming Average ratng: 3,5/5 1571 reviews

In this tutorial we will show how to update ESP8266 with new firmware.

Flash Program ESP-01 using USB Serial Adapters like ESP8266 Serial Module Board, USB to TTL CH340G, FT232RL FTDI USB and Arduino UNO. Software Serial Esp 8266 Programming. Posted by admin. Serial-to-WiFi Tutorial using ESP 8266 The ESP 8266 is a low cost Serial-to-WiFi module that interfaces nicely to any microcontroller.

We use ESP8266 together with Arduino and ESP8266EasyIoT library. The problem is if we do not need correct ESP8266 firmware, because responses to AT commands are different in different firmware versions.

To upload ESP8266 firmware you need FT232RL FTDI USB to TTL Serial+Adapter. Se buying guide for details. Don't forget to set FTDI programmer to 3.3V.

Connection is following:

  • Vcc = 3.3V (needs around 300-400mA peak)
  • Gnd = ground
  • CH_PD = Chip enable so always +Vcc
  • RST = Leave floating or ground to reset
  • GPIO0 = Normally floating but this needs to be grounded when you start the update.
  • UTXD = Tx data connect to Txd on FTDI/Serial interface
  • URXD = Rx data connect to Rx of FTDI/Serial interface

In my case serial USB converter did not provide enough current and updating was impossible. I've connected ESP8266 VCC to additional 3.3V power supply (do not connect FTDI serial USB VCC to VCC power supply if you are using additional power supply).

Then we need program to flash ESP8266. I'm using Windows XTCOM_UTIL, but you can find more flashing utilities on internet.

Esp8266

Program can be downloaded here XTCOM_UTIL. Run program and go to Tools->Config device. Select Com port (only Com ports COM1-COM6 are supported - change port in Windows control panel if necessary). Then open port and Connect.

Next go to API TEST->Flash Image Download. Select firmware image and press button Download.

Current EasyIoT8266 Arduino library works with ESP8266 V0.9.5.2 firmware. If you are usning SW serial, set baudrate to 9600 (default is 115200) with AT+CIOBAUD=9600.

See more tutorials at ​http://iot-playground.com/build​

To support this site and EasyIoT framework development please buy in our store.

FT232RL FTDI USB to TTL Serial Adapter 5V, 3.3V

FT232RL FTDI USB for Arduino or ESP8266 programming. Support 5V and 3.3V

ESP8266 ESP-01 Serial WIFI Wireless Transceiver Module

ESP8266 Serial WIFI Wireless Transceiver Module

ESP8266 ESP-03 Serial WIFI Wireless Transceiver Module

ESP8266 serial WIFI model ESP-03

ESP8266 ESP-12 Serial WIFI Wireless Transceiver Module

ESP8266 serial Port WIFI wireless module ESP-12

ESP8266 ESP-05 Serial WIFI Wireless Transceiver Module

ESP8266 ESP-05 Serial WIFI Wireless Transceiver Module

ESP8266: Wire & Configure

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.

Schematic of ESP8266 module in ESP-07 package connected to an FTDI programmer.

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.

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.

Software Serial Esp8266

Check the current baud rate.

Check possible valid baud rate range.

Set the baud rate.

Esp8266 12e Projects

Reset the module to make sure the changes take effect.

Software Serial Esp8266 Programming Software

AutomationESP8266FTDIIoTNetworkWireless

Related Posts