Connect the ESP8266 module (ESP7 ESP12 etc) as per the details in the Circuit Details Section.
Sourcing Flashing Software and AT Command Firmware
In order to flash the ESP8266 you require both the Espressif Flash Tool (to be installed on the PC) and the AT Command Processor firmware (to be flashed to the ESP8266 module).
Both of these items are available from the official Espressif site here (1). Download the Flash Tool from the Espressif site:
Simiarily, download the AT Command Process firmware from the Espressif site:
Un-zip the downloaded files into suitable locations on the hard drive and then run the "flash_download_tools_v3.6.5.exe" (or whatever is the latest version when you download from the Espressif site). In the resultant dialog window click the "ESP8266 Download Tool" button to start the ESP8266 flash tool which will display a user interface (following screen shot 3) requiring details about what and where to flash the desired data.
Four binary (.bin) files are necessary to be flashed to the ESP8266 in order to install the AT Command Processor firmware (which are located in the directory to which you unzipped the downloaded firmware zip archive from the Espressif site, as detailed above). In the ESP8266 Flash Tool, in the "Download Path Config" section at the top, click the (…) button, and in the resultant file selection dialog box, navigate to the location of the necessary file as shown in the following screen shot 3 and then click the OK button. Enter the corresponding ESP8266 flash memory address for each file as shown. Ensure that the "tick box" at the start of each entry box in the "Download Path Config" section is 'ticked'. The memory location box will turn green, indicating that the file is to be flashed.
Once the four binary file locations and associated flash memory locations have been entered, select the following parameters (which are typical for most ESP8266 modules, and I have found to work on the ESP7 and ESP12 modules):
- Crystal Frequency: 26M
- SPI Speed: 40MHz
- Flash Size: 8Mbit
- COM: Whatever is your connection (COM5 in my case)
- Baud 115200 (may need to experiment with this)
When all the parameters have been entered, check that the switch on the ESP8266 is selecting "programming", i.e., GPIO0 pin is connected to ground via pull down resistor, and then power-up the ESP8266. Push the reset button on the ESP8266 circuit (this will pulse the RST pin to ground) and the ESP8266 is now ready for flashing.
Click the "Start" button on the ESP8266 Flash Tool user interface and flashing of the firmware to the ESP8266 should begin. At the start of the flashing process, the DETECTED INFO text box will be populated with information about the connected ESP8266 module (flash vendor, size and crystal frequency etc) and the MAC address of the ESP8266 will also be displayed in the textbox in the "Download Panel".
When the flashing has been completed, the button in the "Download Panel" will change to "FINISH". If you get an error, check the physical connections of the ESP8266, the entries in the ESP8266 Flash Tool user interface, power down the ESP8266 module and then repeat the flashing process. The Construction Notes/Trouble Shooting Section gives some more tips in case of further trouble.
Checking Flashed ESP8266 Firmware
If not already, power-down the ESP8266 module, then check that the switch on the ESP8266 is selecting "normal boot", i.e., GPIO0 pin is connected to 3.3V via pull up resistor, and then power-up the ESP8266.
Using a suitable serial terminal programme (RealTerm, PuTTY, Terminal, Arduino IDE Serial Monitor, etc), connect via the correct COM port using a baud rate of 115200 (typically, may need to experiment with baud rate), 8 bits, no parity and 1 stop bit (see the following screen shot 4). Now AT commands can be sent to the ESP8266 from the serial terminal, and the ESP8266 will respond if the AT Command Process firmware was successfully flashed.
The Espressif AT instruction set is available as a pdf (2). A good initial command to test if the ESP8266 is connected and operating correctly is simply "AT" (the capital letters A followed by T). All AT commands need to sent with both a carriage return and line feed as terminal characters (see the red highlighted region in the following diagram). If the ESP8266 is connected and operating correctly, in response the string "OK" will be received.
Another useful AT command for initial testing is "AT+GMR" which will cause the ESP8266 to respond with firmware version.