Firmware 1m for esp 01. ESP8266 microcontroller: connection and configuration. Checking the current version

To work with RemoteXY, the ESP8266 module must have a firmware version that supports AT commands no lower than v0.40. To check the module version, as well as to change the firmware if necessary, connect the module to the computer via a serial port. The module can be connected via an Arduino board or via a USB-UART adapter.

Connection via Arduino board

When using Arduino, the main ATmega chip is put into reset mode, only the built-in USB-UART converter remains active. To do this, the RESET contact is connected to ground. The RX and TX pins are connected to the ESP8266 directly, rather than criss-crossed as they would be to work with a controller.

Connection via USB-UART adapter

The converter must have a 3.3V source output to power the ESP8266. Also, this source must provide the required current of at least 200mA.



The CPIO0 contact determines the operating mode of the module. When the contact is not connected, the module operates in normal mode and executes AT commands. When the contact is closed to ground, the module is switched to firmware update mode. Switching the module to firmware mode requires that the CPIO0 pin be connected to ground when power is supplied to the module. If you close the contact while the module is running, the module will not switch to firmware update mode.

Checking the current version

To send AT commands and view responses, you must use any serial port monitor program. The terminal program from the Arduino IDE works very well. The program must be set to send commands with a trailing line feed and carriage return character. The default module operating speed is 115200 bps. For the module to operate in normal mode, the CPIO0 contact must be disabled.

You can check the current firmware version by running the AT command: AT+GMR. Example module response:

AT version:0.40.0.0(Aug 8 2015 14:45:58)
SDK version:1.3.0

Build:1.3.0.2 Sep 11 2015 11:48:04
OK

It is also worth finding out the size of the flash memory of your module; the settings for data download addresses when updating the firmware depend on this. This manual describes the firmware of a module with a flash memory size of 8Mbit(512KB+512KB) or 16Mbit(1024KB+1024KB), as the most common. The size of the flash memory can be found by executing the AT command to reset the module: AT+RST.

Ets Jan 8 2013,rst cause:2, boot mode:(3,1)

Load 0x40100000, len 1396, room 16
tail 4
chksum 0x89
load 0x3ffe8000, len 776, room 4
tail 4
chksum 0xe8
load 0x3ffe8308, len 540, room 4
tail 8
chksum 0xc0
csum 0xc0

2nd boot version: 1.4(b1)
SPI Speed: 40MHz
SPI Mode: DIO
SPI Flash Size & Map: 8Mbit(512KB+512KB)
jump to run user1 @ 1000

#t#n"t use rtc mem data
slЏ‚rlМя
Ai-Thinker Technology Co.,Ltd.

Firmware program

To update the firmware, you need to download the firmware program and the firmware itself. The program for flashing the ESP8266 will use Flash Download Tools v2.4 from the official website of Espressif Systems. Link to download page on the official website: . You need to go to the "Tools" section.

Link to the program in our file storage: FLASH_DOWNLOAD_TOOLS_v2.4_150924.rar

Firmware

The firmware can also be downloaded from the official website. Link to download page on the official website: . You need to go to the “SDKs & Demos” section and download the ESP8266 NONOS SDK firmware version no less than v1.3.0. It is with this firmware version that support for AT commands v0.40 and later is implemented.

Link to the firmware in our file storage: esp8266_nonos_sdk_v1.4.0_15_09_18_0.rar

All downloaded files must be unpacked and placed in a directory where the full path to the files consists only of Latin characters, that is, without language localization characters.

Settings

Launch the firmware program Flash Download Tools v2.4 (the .exe file of the same name). In the window that opens, you must correctly specify the downloaded files and connection settings.


The downloaded files are located in the bin directory of the archive with the firmware. For each file you must specify the correct download address. Use the following table to select files and assign addresses:

Set the following settings:

  • SPIAutoSet - installed;
  • CrystalFreq - 26M;
  • FLASH SIZE – 8Mbit or 16Mbit depending on the size of the flash memory;
  • COM PORT – select the port to which the ESP is connected;
  • BAUDRATE – 115200

To start the firmware, you must press the "START" button.

Sequence of steps for flashing ESP8266 firmware

1. Connect the module to the computer according to the connection diagram in this article.

2. Start the serial port monitor. Issue the AT commands AT+RST and AT+GMR to determine the current firmware version and memory size of the module. This step also allows you to check that the module is connected correctly.

3. Run the Flash Download Tools firmware program, configure the downloaded files correctly, and set the settings.

4. Turn off the power to the ESP8266 module.

5. Connect the CPIO0 pin to ground.

6. Apply power to the ESP8266 module.

7. Press the START button in the firmware program

8. Wait until the module firmware is completed. When the firmware is completed, the message FINISH will appear in green.

9. Disconnect power from the ESP8266 module. Disconnect the ground from the CPIO0 pin.

10. Turn on the module, start the serial port monitor. Make sure that the module and the new firmware version are working by executing the AT command AT+GMR.

How to test ESP8266

To test the ESP8266 you just purchased, you will need.

Attention!The permissible supply voltage range for the ESP8266 module is from 3.0 to 3.6 volts. Supplying an increased supply voltage to the module is guaranteed to cause the ESP8266 to fail.

To test the ESP8266 ESP-01, just connect three pins: VCC and CH_PD (chip enable) to a 3.3 volt power supply, and GND to ground. If you do not have ESP-01, but another module and GPIO15 is output on it, then you will additionally need to connect GPIO15 to ground.

If the factory firmware is successfully started on the ESP8266 module, the red LED will light up (the power indicator, on some versions of the module, for example ESP-12, may be absent) and the blue LED will blink a couple of times (this is an indicator of data transfer from the module to the terminal via the TX-RX line, it may have a different color) and a new access point with the name “ESP_XXXX” should appear on your wireless network, which you can see from any WiFi device. The name of the access point depends on the firmware manufacturer and may be different, for example AI-THINKER_AXXXXC. If the access point appears, then you can continue the experiments further, if not, then check the power supply, CH_PD, GND again, and if everything is connected correctly, then most likely you have a faulty module, but there is hope that the firmware in the module has non-standard settings and , perhaps flashing it will help you.

How to quickly connect ESP8266

The minimum kit for connecting and flashing the ESP8266 module includes:

Red - 3.3V power supply

Black - GND

Yellow - on the ESP8266 side - RX, on the USB-TTL side - TX

Green - ESP8266 side - TX, USB-TTL side - RX

Orange - CH_PD (CHIP ENABLE) - must always be connected to power

Blue - GPIO0 - connected via a switch to ground to enable the module flashing mode. For a normal start of the module, GPIO0 can be left not connected anywhere.

Pink on the right diagram - unstabilized power supply 5-8 volts

4. To start the module, break the GPIO0 - GND circuit and you can apply power (and in exactly this order: first we make sure that GPIO0 is “hanging in the air”, then we supply power to VCC and CH_PD)

Attention! In the above, actually working, examples of connecting the ESP8266, they use connecting the ESP8266 pins “directly” to ground and power, or “hanging in the air”, as we do not have RESET connected anywhere, which is absolutely incorrect and is only suitable for the first couple of experiments, although works quite well on the vast majority of modules. Only the VCC pin is connected “directly” to the power supply; the remaining pins: CH_PD, RESET, GPIO0, GPIO2 must be pulled up (pullup) to the power supply (VCC) through a resistor from 4.7 to 50 kOhm. “Directly”, we connect only GND to the negative (common wire) of the power supply, and pull GPIO0 (pulldown) also through a resistor up to 10k to GND to put the module into firmware download mode. If you plan to continue experimenting with the ESP8266, then do it in the same way as for any other microcontrollers. A detailed description of pullup and pulldown is beyond the scope of this article, but you can easily Google a description of the correct connection of I/O ports. The “ ” connection will allow you to avoid many “miracles” and problems and will be inevitably necessary if you encounter difficulties starting or flashing the ESP8266 module.

How to properly connect ESP8266

If you plan to use the ESP8266 for more than one evening, you'll need a connection option that offers greater stability. Below are two connection diagrams: with support for autoloading firmware from, and without it.

Connection diagram for ESP8266 (without autoloading the firmware, we flash it by first installing the BURN jumper and rebooting the module)

Connection diagram with support for autoloading firmware from Arduino IDE, UDK, Sming. Flash Download Tool and XTCOM_UTIL may need to disable RTS/DTR. If it is inconvenient for you to disable RTS and DTR, then you can add jumpers to the circuit

These diagrams do not show the connection of ADC and free GPIOs - their connection will depend on what you want to implement, but if you want stability, then do not forget to pull all GPIOs to power (pullup), and ADC to ground (pulldown) through pull-up resistors .

Resistors at 10k can be replaced with others from 4.7k to 50k, with the exception of GPIO15 - its value must be up to 10k. The value of the capacitor, which smoothes out high-frequency pulsations, may be different.

You will need to connect RESET and GPIO16 via a 470 Ohm deep sleep resistor if you use deep sleep mode: to exit deep sleep mode, the module reboots itself by applying a low level to GPIO16. Without this connection, deep sleep will be eternal for your module.

At first glance, these diagrams seem to suggest that GPIO0, GPIO2, GPIO15, GPIO1 (TX), GPIO3 (RX) are busy and you cannot use them for your purposes, but this is not the case. A high level on GPIO0 and GPIO2, a low level on GPIO15 are required only to start the module, and subsequently you can use them at your discretion, just remember to ensure the required levels before rebooting the module.

You can use TX, RX as GPIO1 and GPIO3 respectively, not forgetting that when the module starts, any firmware will pull TX, sending debugging information to UART0 at a speed of 74480, but after successful loading you can use them not only as UART0 for exchange data with another device, but also like regular GPIOs.

For modules with a smaller number of wired pins, such as ESP-01, connecting undone pins is not required, i.e. on the ESP-01, only VCC, GND, GPIO0, GPIO2, CH_PD and RESET are wired - you just tighten them up. There is no need to solder directly to the ESP8266EX chip and attract unrouted pins, only if you need it.

These connection diagrams were born after many experiments conducted by our forum members and collected bit by bit from scattered and initially inaccessible documentation by our community, I just tried to combine this knowledge in one place. You will find many connection tips. There you can ask questions you are interested in or find. If you see an error, inaccuracy in this article, or have something to add, then .

Attention! Even these schemes cannot be called “ideal”. There is no limit to perfection: it is convenient to connect a second USB-TTL to UART1 (with ESP8266 you can only take GND and UTXD1, i.e. GPIO2) to connect a debugging terminal (you will need a second USB-TTL converter) - then you can flash the ESP8266 module via UART0 without disabling the debugging terminal on UART1. It would be a good idea to connect small resistors to the pins of both UARTs, put a diode in the RTS line, add a capacitor to the power line to dampen low-frequency pulses, etc. It is very convenient, for example, done in this debug board: LEDs are connected to all GPIOs, a photoresistor is connected to ADC, but it’s a pity that there is no RESET button and there is only one jumper on GPIO0.

It would be correct to tell you that there is no ideal and at the same time universal connection diagram for the ESP8266. The thing is that a lot depends on the firmware that you are going to upload there. The above diagrams are designed for beginners who are just starting to master the ESP8266 for experimentation. For real projects, you may have to change the diagram a little. For example, you need to connect RTS to GPIO15, and CTS to GPIO13. I also recommend paying special attention to nutrition in real projects.

Connecting ESP8266 via Arduino

If you don’t have a 3.3V USB-TTL converter at hand, but have an Arduino with a built-in USB-TTL converter, then you can use this connection diagram

What to pay attention to:

1. Arduino Reset is connected to GND (blue wire) so that the microcontroller on Arduino does not start, in this form we use Arduino as a transparent USB-TTL converter

2. RX and TX are not connected crosswise, but directly - RX - RX (green), TX - TX (yellow)

3. Everything else is connected in the same way as in previous examples

Attention! This circuit also requires matching the TTL levels of 5 volts on the Arduino and 3.3 volts on the ESP8266, but it works well this way.

Attention!The Arduino may have a power stabilizer installed that will not withstand the current required by the ESP8266, so before making the connection, check the datasheet for the stabilizer that you have installed. Do not connect other power-consuming components at the same time as the ESP8266 due to the risk of damaging the power regulator built into the Arduino.

Connecting to the serial port will require a little magic: due to the variety of firmware for the ESP8266, the connection can be made at different speeds. The required speed can be determined by simply searching through three options: 9600, 57600 and 115200. How to search? Connect to your virtual serial port in the terminal program by setting the following parameters: 9600 8N1, then reboot the module by disconnecting CH_PD (chip enable) from the power supply (USB-TTL remains connected to USB) and turning it on again (i.e. simply toggle CH_PD , why don’t we distort the power - read, you can also short-circuit RESET to ground to reboot the module) and observe the data in the terminal. First, the LEDs on the ESP8266 should light up as described at the beginning of the article in the section. Secondly, in the terminal you should see a “garbage” of different characters ending with the line “ready”. If we don’t see “ready”, then we reconnect with the terminal at a different speed and reboot the module again.

At one of the “ready” speed options, you will still see - congratulations, your module is ready for use. If not, then welcome - we will try to help, but read first.

A little more about “garbage”. The fact is that when the firmware starts, the UART of the ESP8266 module switches to a baud rate of 74,880 (those Chinese are so funny), outputs debugging information to the UART, then switches the port speed to 115200 (or 9600 or 57600, depending on the firmware version) , so this debugging information appears to us as garbage, because we connect to the module at a different speed. You can connect to the ESP8266 at a speed of 74,880 (supports this speed) and you will see this debugging information, it will be something like this:

wdt reset load 0x40100000, len 25052, room 16 tail 12 chksum 0x0b ho 0 tail 12 room 4 load 0x3ffe8000, len 3312, room 12 tail 4 chksum 0x53 load 0x3ffe8cf0, len 6576, room 4 tail 12 chksum 0x0d cs um 0x0d

wdt reset

load 0x40100000 , len 25052 , room 16

tail 12

chksum 0x0b

ho 0 tail 12 room 4

load 0x3ffe8000 , len 3312 , room 12

What to do next

If you have a new module, then most likely it is flashed with one of the old custom AT firmwares. Most likely this is some kind of AI-THINKER AT v0.16 SDK v0.9.2. You can check the firmware version using the “AT+GMR” command, i.e. directly in the terminal program, type AT+GMR without quotes and press Enter. The module should respond “OK” and display the firmware version (for example, “0016000092” - the version output format is different in different versions of AT firmware). Controlling the ESP8266 module with AT commands deserves a separate article, but you can easily figure it out yourself by using one of our reference books on AT commands:

At the time of writing this article, the current firmware version for the ESP8266 is:

ESP8266 Firmware Update

The ESP8266 module is remarkable in that it does not require a special programmer - the firmware is updated on the same hardware on which you connect the ESP8266 module to the computer, i.e. also via a USB-TTL converter (or Arduino or RPi). To update the firmware on the ESP8266 module, do the following:

1. Download the new firmware version from our website from the section (here is the link to at the time of writing this article)

2. Download one of the utilities for flashing ESP8266 depending on your operating system from the section on our website

Moule esp-01
Diagram of the correct connection of the esp-01 module for programming and firmware.

The module is flashed by switching to programming mode; to do this, hold down the FLASH button, then without releasing it, briefly press the RESET button and release FLASH.
The module is switched to programming mode.
In the terminal at this moment you can see

ets Jan 8 2013,rst cause:2, boot mode:(1.6)
boot mode:(1,6) - reboot via RESET into programming mode
boot mode:(1,7) - power reboot into programming mode - which is not entirely correct.

For the firmware I will use the program NODEMCU FIRMWARE PROGRAMMER
(An archive with the program will be attached to the topic)
Unpack the archive and run in my case the 32-bit version of the program\Win32\Release\ESP8266Flasher.exe
We configure it for the module, in my case it is 1 Megabyte of flash memory or 8 Megabits.




The first step is to erase the memory with an empty 1 MB file.
This is an optional item. You can skip erasing and go to the firmware.
Those who have more or less memory need an empty file of the appropriate size.
Next, we determine what firmware is needed!
You can use ready-made firmware on NODEMCU or assemble it from a designer with the modules you need.
For example, one of the old proven NODEMCU

Constructor wifi-iot.com/
Constructor nodemcu-build.com/
or download the latest

Problems with firmware
If The esp8266 module is not flashing, check the pull-ups and the correct connection to GND GPIO0. And also whether RX TX are mixed up.
In the terminal you can check that boot mode:(1,6) or boot mode:(1,7) is displayed.

If after unsuccessful firmware the module does not work, try erasing the memory with an empty blank file the size of your memory.

If The module does not work after successful firmware and sends endless garbage to the port (the data transmission LED may blink), this happens when flashing the latest Nodemcu builds, then you will additionally need to flash the file into the memory area, depending on the memory chip.
Information on memory was taken from the nodemcu website.
0x7c000 for 512 kB, modules such as ESP-01,03,07
0xfc000 for 1 MB, modules like ESP8285, PSF-A85 but also some varieties of esp-01,01s
0x1fc000 for 2 MB
0x3fc000 for 4 MB, module type ESP-12E, NodeMCU devkit 1.0, WeMos D1 mini etc.

If all else fails, write...

I will add the official group of the equipment manufacturer

Wi-Fi module ESP-01 is the most popular module of the ESP8266 series. Communication with a computer or microcontroller is carried out via UART using a set of AT commands. In addition, the module can be used as an independent device; to do this, you need to load your own firmware into it. You can program and download firmware through the Arduino IDE version above 1.6.5. To flash the module firmware you will need a UART-USB adapter. The ESP-01 module may be widely used in IoT (Internet of Things) devices.

Specificationsmodule

  • Wi-Fi 802.11 b/g/n
  • WiFi modes: client, access point
  • Output power - 19.5 dB
  • Supply voltage - 1.8 -3.6 V
  • Current consumption - 220 mA
  • GPIO ports: 4
  • Processor clock frequency - 80 MHz
  • Code memory capacity
  • RAM - 96 KB
  • Dimensions - 13×21 mm

Connection

Let's consider the AT command mode. To do this, connect the module to the computer via a USB-UART adapter. Purpose of module pins (see Figure 1):
  • VCC - +3.3 V
  • GND - ground
  • RX, TX - UART pins
  • Output CH_PD - Chip enable
  • GPIO0, GPIO2 - digital contacts
The module requires external 3.3 V power.

Figure 1. ESP-01 module pin assignments

Connection diagram for communicating with the module in AT command mode (Figure 2):

Figure 2. Diagram of connecting the ESP-01 module to a computer via a serial port

Figure 3. Assembly circuit

To send AT commands in Mac OS X, you can use the CoolTerm program, and in the Windows operating system, the Termite program. You can only find out the speed of the COM port for connecting to the module experimentally; it can be different for different firmware. For my module the speed turned out to be 9600 baud. In addition, it was possible to establish exchange only after disconnecting and reconnecting the CH_PD pin to the power supply. After connecting, type AT in the terminal and should receive an OK response from the module. The AT+GMR command gives the module firmware version number, the AT+RST command reboots the module (see Fig. 4). A list of basic AT commands can be found in this document (ESP8266ATCommandsSet.pdf).

Figure 4. Sending AT commands to the module from Termite

If the AT command mode is not convenient for you, the board can be configured using the AppStack ESP8266 Config program, which can be downloaded from the link http://esp8266.ru/download/esp8266-utils/ESP8266_Config.zip. The appearance of the program is shown in Figure 5. The module is configured using a graphical interface, and the execution of commands can be seen in the program monitor (see Figure 6). The monitor can also send AT commands from the command line.

Figure 5. AppStack ESP8266 Config program

Figure 6. Serial monitor of the AppStack ESP8266 Config program

There are two options for using this module:

  • in conjunction with a microcontroller (for example Arduino), which will control the module via UART;
  • writing your own firmware to use the ESP8266 as a standalone device.

Usage example

Let's look at an example of connecting a DHT11 humidity and temperature sensor to the ESP-01 module and sending data to the ThingSpeak cloud service (https://thingspeak.com/). We will need the following parts:
  • module ESP-01
  • bread board
  • humidity and temperature sensor DHT11
  • resistor 10 kOhm
  • connecting wires
  • power supply 3 - 3.6V
First, let's connect the DS18B20 sensor to the ESP-01 module. DS18B20 is a digital temperature sensor operating via a single-wire 1-Wire interface. The connection diagram of the DS18B20 sensor to the module is shown in Fig. 7.

Figure 7. Connection diagram of the DHT11 sensor to the ESP-01 module.

Then you need to create a profile in the ThingSpeak service. The service has instructions for sending data to the service and receiving data from the service.

Figure 8. Complete circuit.

We will write the program in the Arduino IDE for ESP8266. We will use the ESP8266WiFi.h (built-in) and OneWire.h libraries. Let's upload the sketch from Listing 1 to the Arduino board - receiving data from the temperature sensor and sending the data to the ThingSpeak service. You need to enter your data for the WiFi access point for the ESP-01 module:

  • const char *ssid;
  • const char *password;
as well as the privateKey parameter for your application in the ThingSpeak service. Listing 1 // website // Include the library to work with esp8266 #include // Include the DHT library to work with DHT11 #include // DATA pin connection pin #define DHTPIN 4 // DHT11 sensor #define DHTTYPE DHT11 // creating an instance of a DHT object DHT dht(DHTPIN, DHTTYPE); // ssid WiFi connection network const char ssid = "********"; // WiFi password for the connection network const char password = "******"; // ThingSpeak Server const char* host = "184.106.153.149"; // API KEY of your ThingSpeak application const char* privateKey = "****************"; // variables for storing temperature and humidity float temp; float humidity // variable for the measurement interval unsigned long millis_int1=0; void setup() ( // start the serial port Serial.begin(115200); delay(10); Serial.print("Connect to WiFi"); Serial.println(ssid); // Connect via WiFi WiFi.begin(ssid , password); while (WiFi.status() != WL_CONNECTED) ( delay(500); ) Serial.println("WiFi connected"); // start dht dht.begin(); ) void loop() ( // wait for an interval of 10 minutes if(milis()-millis_int1>=10*60000) ( Serial.print("connect to ThingSpeak"); Serial.println(host); // Use the WiFi client WiFiClient client; if (!client.connect (host, 80)) ( Serial.println("connection failed"); return; ) // get temperature data temp = get_data_temperature(); humidity = get_data_humidity(); // Create a URL with a request for the server String url = "/ update?key="; url += privateKey; url += "&temp="; url += temp; url += "&humidity="; url += humidity; // Send a request to the server client.print(String(" GET ") + url + " HTTP/1.1\r\n" + "Host: " + host + "\r\n" + "Connection: close\r\n\r\n"); delay(10); // ThingSpeak server response while(client.available())( String req = client.readStringUntil("\r"); Serial.print(req); ) ) ) Now in the ThingSpeak service we can view a graph of the readings of our DHT11 temperature sensor (Figure 9).

Figure 9. Graph of DS18B20 temperature sensor readings in the ThingSpeak service.

Frequently asked questions FAQ

1. The module does not respond toAT commands
  • Check that the module is connected correctly;
  • Check the correct connection of the Rx, Tx contacts to the UART-USB adapter;
  • Check the connection of the CH_PD pin to 3.3 V;
  • Experimentally select the communication speed on the serial port.
2. ESP-01 module does not receive temperature data from the sensorDHT11
  • Check that the DHT11 sensor is connected correctly to the module.
3. Data is not transferred to the ThingSpeak service
  • Check the module's connection to the WiFi access point;
  • Check the connection of the WiFi access point to the Internet;
  • Check that the request to the ThingSpeak service is correct.

Many users have already turned their attention to the ESP8266-12 chip, released by Espressif. Its cost is significantly cheaper compared to a standard Bluetooth adapter board, and despite its smaller dimensions, it has significantly greater capabilities. Now all home enthusiasts have the opportunity to work on a Wi-Fi network in two modes at once, that is, connect their computer to any access points or turn it on as such a point.

On the other hand, you need to correctly understand that such boards are not just shields intended only for Wi-Fi communication. The ESP8266 itself is a microcontroller that has its own UART, GPIO and SPI interfaces, that is, it can be used as completely autonomous equipment. After the release of this chip, many called it a real revolution, and over time, such devices will begin to be built into even the simplest types of equipment, but for now the device is relatively new and there is no stable firmware for it. Many specialists around the world are trying to invent their own firmware, because uploading them to the board is actually not difficult, but despite various difficulties, the device can already be called quite usable.

At the moment, only two options for using this module are being considered:

  • Using the board in combination with an additional microcontroller or a computer that will control the module via UART.
  • Independent writing of firmware for the chip, which allows you to later use it as a self-sufficient device.

It is quite natural that we will not consider independent firmware in this case.

Looking at ease of use and good performance, many people prefer the ESP8266 model among the many microcontrollers. Connecting and updating the firmware of this device is extremely simple and affordable, and is performed on the same hardware on which the equipment is connected to the computer. That is, also via a USB-TTL converter or, if someone prefers other connection options, it can be done via RPi and Arduino.

How to check?

In order to check the functionality of a newly purchased device, you will need to use a special stabilized voltage source rated at 3.3 volts. It’s worth noting right away that the actual supply voltage range of this module is from 3 to 3.6 volts, and supplying an increased voltage will immediately lead to the fact that you will simply damage your ESP8266. After such a situation, firmware and other software may begin to work incorrectly, and you will need to repair the device or somehow fix it.

To determine the functionality of this microcontroller model, you just need to connect three pins:

  • CH_PD and VCC are connected to the 3.3 volt supply.
  • GND connects to ground.

If you are not using ESP-01, but some other module, and it already initially has an output GPIO15, then in this case you will need to additionally connect it to ground.

If the factory firmware started up normally, then in this case you can see and then the blue light will blink a couple of times. However, it is worth noting that not all ESP8266 series devices have a red power indicator. The firmware on some devices does not provide for the red indicator to light up if the module does not have one (in particular, this applies to the ESP-12 model).

Once connected, a new access point will be activated on your wireless network, which will be called ESP_XXXX, and it will be discoverable from any device that has access to Wi-Fi. In this case, the name of the access point directly depends on the manufacturer of the firmware you are using, and therefore may be something different.

If the point does appear, you can continue experimenting, otherwise you will need to re-check the power supply, as well as the correctness of the GND and CH_PD connections, and if everything is connected correctly, then most likely you are still trying to use a broken module or on It simply has firmware installed with non-standard settings.

How to quickly connect it?

The standard kit required to connect this module includes the following:

  • the module itself;
  • solderless breadboard;
  • a full set of female-male wires intended for a breadboard, or a special DUPONT M-F cable;
  • USB-TTL converter based on PL2303, FTDI or some similar chip. The best option is if RTS and DTR are also output to the USB-TTL adapter, since due to this you can achieve fairly fast loading of the firmware from some UDK, Arduino IDE or Sming, without even having to manually switch GPIO0 to ground.

If you are using a 5-volt converter, then in this case you will need to purchase an additional power stabilizer based on the 1117 chip or some similar one, as well as a power source (for a standard 1117, even an ordinary 5-volt smartphone charger is quite suitable). It is recommended not to use the Arduino IDE or USB-TTL as a power source for the ESP8266, but to use a separate one, as this can ultimately get rid of a lot of problems.

An expanded set to ensure comfortable and constant operation of the module requires the use of additional resistors, LEDs and DIP switches. In addition, you can also use an inexpensive USB monitor, which will allow you to constantly monitor the amount of current consumed, and also provide a little protection for the USB bus from

What do we have to do?

First of all, it is worth noting the fact that in the ESP8266 the controls may be slightly different depending on which specific model you are using. There are quite a lot of such modules available today, and the first thing you will need is to identify the model you are using and decide on its pinout. In this instruction we will talk about working with the ESP8266 ESP-01 V090 module, and if you are using some other model with a GPIO15 pin (HSPICS, MTDO), you will need to pull it to the ground both for the standard start of the module and to use the firmware mode.

After this, double check that the supply voltage for the connected module is 3.3 volts. As mentioned above, the permissible range is from 3 to 3.6 volts, and if it increases, the device fails, but the supply voltage may even be significantly lower than the 3 volts stated in the documents.

If you are using a 3.3 volt USB-TTL converter, then connect the module exactly as on the left side of the picture below. If you use exclusively five-volt USB-TTL, then pay attention to the right side of the figure. It may seem to many that the right circuit is more efficient due to the fact that it uses a separate power source, but in fact, in the case of using a 5-volt USB-TTL converter, it is highly desirable to also make an additional resistor divider to ensure matching of three-volt and five-volt logic levels, or simply use the level conversion module.

Connection features

The right figure shows the connection of UTXD (TX), as well as URXD (RX) of this module to five-volt TTL logic, and such procedures are carried out only at your own peril and risk. For the ESP8266, the description says that the module only works effectively with 3.3-volt logic. In the vast majority of cases, even when working with five-volt logic, the equipment does not fail, but such situations occasionally occur, so such a connection is not recommended.

If you do not have the opportunity to use a specialized 3.3-volt USB-TTL converter, you can use a resistor divider. It is also worth noting that in the right picture, the 1117 power stabilizer is connected without additional wiring, and this is a really working technology, but it is still best to use the 1117 connection diagram with capacitor wiring - you need to check it with the ESP8266 datasheet for your stabilizer or use a completely ready one module based on the 1117 base.

To start the module, you need to open the GPIO0-TND circuit, after which you can apply power. It is worth noting that everything needs to be done in exactly this order, that is, first make sure that GPIO0 is “hanging in the air”, and only then apply power to CH_PD and VCC.

How to connect correctly?

If you can spare more than one evening to properly connect the ESP8266 module, you can use a more stable option. In the diagram above you see a connection option with automatic firmware download.

It is worth noting that the image above does not show the use of free GPIOs or ADCs, and their connection will directly depend on what exactly you want to implement, but if you want to ensure stability, remember to pull all GPIOs to power and ADCs to ground using pull-up resistors.

If necessary, 10k resistors can be replaced with any others in the range from 4.7k to 50k, excluding GPIO15, since its value should be no more than 10k. The value of the capacitor that smoothes out high-frequency pulsations may be slightly different.

Connecting RESET and GPIO16 through the use of a 470 Ohm deep sleep resistor may become necessary when using the appropriate mode, since in order to exit deep sleep mode, the module performs a full reboot by applying a low level to GPIO16. Without this connection, deep sleep mode for your module will last forever.

At first glance, it may seem that GPIO0, GPIO1 (TX), GPIO2, GPIO3 (RX) and GPIO15 are busy, so you won’t be able to use them for your purposes, but in fact this is far from the case. A sufficiently high level on GPIO0 and GPIO2, as well as a low level on GPIO15, may be required only for the initial startup of the module, and in the future you can use them at your discretion. The only thing worth noting is to remember to ensure the required levels before performing a full reset of your equipment.

You can also use TX, RX as an alternative to GPIO1 and GPIO3, but do not forget that after the module starts, each firmware begins to “pull” TX, while simultaneously sending debugging information to UART0 at a speed of 74480, but after the download will be successful, they can be used not only as UART0 in order to exchange data with another device, but also as standard GPIOs.

For modules that have a small number of wired pins (for example, ESP-01), there is no need to connect undone pins, that is, only GND, CH_PD, VCC, GPIO0, GPIO2 and RESET are wired on the ESP-01, and these are the ones you need will need to be tightened. There is no need to solder directly to the ESP8266EX chip and then pull the bare pins unless you really need it.

Such wiring diagrams were used after a large number of experiments carried out by qualified specialists and collected from a lot of different information. It is worth noting that even such schemes cannot be considered ideal, since a number of other, no less effective options can be used.

Connection via Arduino

If for some reason you do not have a 3.3 volt USB-TTL converter, then the ESP8266 WiFi module can be connected via Arduino with a built-in converter. Here you will need to first turn your attention to three main elements:

  • When used with the ESP8266, Arduino Reset is initially connected to GND to prevent the microcontroller from starting up, and in this form it was used as a transparent USB-TTL converter.
  • RX and TX were not connected “at the crossroads”, but directly - RX-RX (green), TX-TX (yellow).
  • Everything else is connected exactly as described above.

What to consider

This circuit also requires matching the TTL levels of 5 volts on the Arduino, as well as 3.3 volts on the ESP8266, but it can function quite well either way.

When connected to an ESP8266, the Arduino may be equipped with a power regulator that cannot handle the current required by the ESP8266, so you will need to check the datasheet for the one you are using before activating it. Do not try to connect any other power-consuming components with the ESP8266, as this may cause the power regulator built into the Arduino to simply fail.

There is also another ESP8266 and Arduino connection scheme that uses SoftSerial. Since for the SoftSerial library the port speed of 115200 is too high and cannot guarantee stable operation, this connection method is not recommended, although there are some cases in which everything works quite stably.

Connection via RaspberryPi

If you do not have any USB-TTL converters at all, then you can use RaspberryPi. In this case, for the ESP8266, programming and connection are carried out almost identically, but everything here is not so convenient, and in addition you will also need to use a 3.3-volt power stabilizer.

To begin with, we connect RX, TX and GND of our device to the ESP8266, and take GND and VCC from the one designed for 3.3 volts. Here, special attention should be paid to the fact that you need to connect all GND devices, that is, the RaspberryPi stabilizer and ESP8266. If the stabilizer built into your device model can withstand up to 300 milliamps of additional load, then in this case connecting the ESP8266 is quite normal, but this is all done only at your own peril and risk.

Setting up parameters

Once you have figured out how to connect the ESP8266, you need to make sure that the drivers for your devices are installed correctly, as a result of which a new virtual serial port has been added to the system. Here you will need to use a program - a serial port terminal. In principle, you can choose any utility to suit your taste, but you must correctly understand that any command that you send to the serial port must have the trailing characters CR+LF at the end.

The CoolTerm and ESPlorer utilities are quite widespread, and the latter allows you not to enter the ESP8266 yourself, and at the same time makes it easier to work with lua scripts under NodeMCU, so it can be used as a standard terminal.

To connect normally, you will have to do a lot of work, since the firmware for the ESP8266 is mostly varied and activation can be carried out at different speeds. To decide on the best option, you will need to go through three main options: 9600, 57600 and 115200.

How to sort?

To begin, connect to the virtual serial port in the terminal program, setting the parameters to 9600 8N1, then perform a complete reboot of the module, disconnecting CH_PD (chip enable) from the power supply, and then reactivate it again by jerking CH_PD. You can also perform a short RESET to ground to reset the module and observe the data in the terminal.

First of all, the device's LEDs should appear exactly as shown in the test procedure. You should also observe a set of different characters in the terminal, which will end with the line ready, and if it is not there, a reconnection to the terminal is carried out at a different speed, followed by a reboot of the module.

When you see this line in one of the speed options, you can consider the module ready for work.

How to update the firmware?

Once you install the ESP8266, it will only take a few seconds to connect the device, and then you can start updating the firmware. To install new software you need to do the following.

To get started, download the new firmware version from the official website, and also download a special utility for firmware. Here, special attention should be paid to what operating system is installed on the machine with which the ESP8266 works. It is best to connect the device to systems older than Windows 7.

For standard Windows operating systems, it would be optimal to use a program called XTCOM UTIL, which is especially convenient to use if the firmware consists of only one file. The best multi-platform option is the esptool utility, which, however, requires python, as well as the need to specify parameters via the command line. In addition, the ESP8266 allows you to conveniently connect the main functions with the Flash Download Tool, which has a fairly large number of settings, as well as a convenient technology for installing firmware from several files.

Next, disconnect your terminal program from the serial port, and also completely disconnect CH_PD from the power supply, connect GPIO0 of the module to GND, and after that CH_PD can be returned back. Ultimately, just run the modular firmware program and load it into the ESP8266 relay.

In the vast majority of cases, the firmware is loaded into the module at a speed of around 115200, but a special mode provides automatic speed distribution, as a result of which the firmware can be carried out at a speed of more than 9600, updating the available functions of the ESP8266. Arduino was used for connection or USB-TTL - it does not play a special role here, and here the maximum speed already depends on the length of the wires, the converter used and a number of other factors.

Publications on the topic