B4R Tutorial Programming an ESP8266 (ESP-12x) via a USB to Serial adaptor

Peter Simpson

Expert
Licensed User
Programming an ESP-12x module directly is not too difficult. If you purchase an ESP8266 with a built-in USB port like a WeMos D1 Mini or a NodeMCU etc, then you do not need to do this as the aforementioned boards already have USB to Serial port built into them. If like me you enjoy making projects as small as possible, then this solution is perfect for you as the ESP-12x boards DO NOT include an CH340G chip which supports serial interfacing communications via USB, but connecting to and programming an ESP-12x is simple to do via a USB to Serial module.

How to wire your ESP-12x and USB to serial adaptor.
Please remember the an ESP8266 is a 3.3V device, but it also works using 2 x AA batteries.

ESP-12x:
VCC > 3V to 3.3V
CH_PD > 3V to 3.3V
GND > Ground
GPIO0 > Ground
GPIO5> Ground
TX > RX on the USB to Serial adaptor
RX > TX on the USB to Serial adaptor

USB to Serial adaptor:
GND > Ground
TX > RX on the ESP-12x
RX > TX on the ESP-12x

In B4X I personally select the board NodeMCU 1.0, but I presume that Generic 8266 module should also work.

Below is a diagram showing how to wire your ESP-12x to allow for programming through B4R.
Program ESP-12_bb.png


Please note.
I did this post specifically for the B4R forum. I personally use a veroboard solution that I put together that means I do not need to keep wiring up a breadboard to program my ESP-12F boards, my solution is just plug and play, I'll post a photo of my plug and play solution when I use it next time.

What it looks like when fully connected.
IMG_20170504_181224.jpg


Enjoy...
 
Last edited:
Top