Tuesday 24 March 2015

ESP8266 - Hooking up via FTDI and flashing the firmware

Okay so you've sourced your ESP8266 Module, FTDI USB to TTL Adapter (also referred to as a UART Programmer) and associated parts as per the previous blog post. Now onto flashing the firmware.

Prior to flashing the firmware on your ESP8266 Module you will need to hook this up to your USB to TTL Adapter via Jumper Cables. In order to go about doing this the following pinouts will need to be observed and carefully followed (so as not to damage anything).

ESP8266 pinout:


ESP8266 ESP-01 (component side).


On the component side of the ESP8266 Module the pin layout is as follows (whilst hooking up to a USB to TTL Adapter and PSU rails please ensure the pin layout observed is from the component side and not the side with no components on):

Pin layout of an ESP8266 ESP-01 (component side).




FTDI USB to TTL pinout:


On the solder side of the FTDI USB to TTL Adapter that I've sourced the manufacturer's have conveniently labelled the pinout of each of the pins. The pin layout seems to vary from manufacturer to manufacturer though therefore please make sure to check what the exact pin layout is for the USB to TTL Adapter you've bought.

Note: Take great care not to hook up your ESP8266 to the +5v rail:

A FTDI USB to TTL Adapter.

The wiring that needs to be followed in order to hook-up both an ESP8266 and a USB to TTL Adapter is as follows (a 3.3v PSU is recommended; Please refer to Note 2 as below):

ESP8266 > USB to TTL Adapter

RX > TX
TX > RX
CH_PD > +3.3V
GPIO 0 > GND
+3.3V > +3.3V
GND > GND

Note 1:

GPIO 0 is only connected to GND for flash programming the ESP8266. Once the firmware on your ESP8266 has been flashed this GPIO pin can be left unconnected unless of course you are using both of the GPIO pins.

Note 2:

Despite wiring up the ESP8266 and USB to TTL Adapter that I'd bought as above it was observed that there were difficulties in getting the flash programming software to work the USB to TTL Adapter's virtual COM Port would more often than not disconnect immediately after flash programming. To get around this problem a MB-102 3.3v / 5v Breadboard Power Supply (PSU) Module with external 800mA AC/DC Adapter was added and the problems immediately disappeared. Flash programming worked flawlessly and the USB to TTL Adapter's virtual COM Port no longer disconnected.


The wiring was basically the same as above but instead of the +3.3V pin on the ESP8266 being connected to the +3.3V pin on the USB to TTL Adapter it was connected to the +3.3V power-rail (the +3.3V pin on the USB to TTL Adapter was disconnected from the +3.3V pin on the USB to TTL Adapter). At a guess the +3.3V pin on the USB to TTL Adapter was supplying an inadequate amount of current for the ESP8266 to work reliably.

MB-102 3.3v / 5v Breadboard Power Supply (PSU) Module


From what has been understood the ESP8266 Module needs a reasonable amount of current depending on what operating mode it is in to function correctly. Because of this I'd strongly recommend using a minimum of a 300mA - 500mA AC/DC Adapter to provide power.

Note 3:

You will more than likely conclude that an ESP8266 ESP-01 is not Breadboard friendly off the shelf so to speak. A contributor on the ESP8266 forum has designed their own ESP8266 Breadboard Adapter and many hobbyists have made their own using a small piece of veroboard. There is an excellent tutorial submitted by 'technochatter' on instructibles.com that can be found here. Instead of using an ESP8266 Breadboard Adapter you could just use Male to Female jumper wires which is the method I'd opted for. These are cheaper than buying and making your own adapter.


ESP8266 with Male to Female Jumper Wires attached.

Connecting the parts together step by step:

1). Assuming you are using a MB-102 3.3v / 5v Breadboard Power Supply (PSU) Module connect the +3.3v power rail (denoted with a red line on an MB-102) to VCC and CH_PD pins on your ESP8266 with Male to Female jumper wires.

ESP8266 VCC and CH_PD hooked-up to +3.3v power rail.

2). Connect the 0v power rail (denoted with a blue line on an MB-102) to GND and GPIO 0 pins on your ESP8266 with Male to Female jumper wires.

ESP8266 GND and GPIO 0 hooked-up to 0v power rail.

3). Connect the TX pin on the USB to TTL Adapter to the RX pin on the ESP8266 using a Male to Male jumper wire.

4). Connect the RX pin on the USB to TTL Adapter to the TX pin on the ESP8266 using a Male to Male jumper wire.

5). Connect the 0v power rail (denoted with a blue line on an MB-102) to GND on the USB to TTL Adapter using a Male to Male jumper wire.

Installing NodeMCU Firmware:


You are now ready to flash upgrade your ESP8266. The custom ROM firmware installed in this tutorial is NodeMCU. There is other firmware that is installable on an ESP8266 but I've no knowledge on the latter as this is still new to me to be completely honest.

1). Download Node-MCUFlasher from Github.com by clicking on the download zip link on the right of the page or by clicking here.

2). Unzip the downloaded .zip file taking a note of where it has unzipped to.

3). Select the 32-bit or 64-bit version depending on what version of operating system you are using. You can determine this by navigating to 'Control Panel\All Control Panel Items\System' in Explorer.

4). Assuming the required FTDI drivers have downloaded and installed successfully make a note of what virtual COM Port has been assigned to your USB to TTL Adapter.

5). Double-click on the MCUFlasher .exe file.

NodeMCU Firmware Programmer.
6). On the proviso the Com Port shown that corresponds to your USB to TTL Adapter (in this example it is Com Port 5) click on 'Flash(F)' and a progress indication should be shown. Once the flash programming has completed there should be a green tick in the checkbox on the bottom left of the window.

7). Now that your ESP8266 has NodeMCU firmware running on it I'd strongly recommend you disconnect GPIO 0 from GND (this will allow for the ESP8266 to boot normally as opposed to booting into flash mode). GPIO 0 only needs to be connected to GND in order for firmware to be flash programmed onto the device.

Your ESP8266 is now ready to play with :).


No comments:

Post a Comment

Thank you for your comment - All comments are moderated however are posted as soon as possible.