Establish AT communication with the ESP8266-01

I am trying establish a connection from my laptop through a USB cable to a USB to TTL converter that uses the CH340 chip, to an ESP8266-01, to communicate with it using AT commands. So far I have been unsuccessful. In the Arduino IDE, I have selected the Tools\Board: "Generic ESP8266 Module". I am connected to Port: "Comm 5". In the Arduino Serial Monitor, I have selected 9600 Baud, Both NL & CR. I have a Bare Minimum sketch, as if a New selection is made in the Arduino IDE. I have tried 115200 baud and many others. Currently I have the Arduino IDE set to 9600. I'm not getting anything back. This USB to Serial converter doesn't have a DTR Pin as one of the pins connected to the output pins available. I tested this HiLetgo USB to Serial converter with the Atmega328P-PU chip and I was able to upload a sketch although I did have to press and hold the reset button during the initial start of the upload, but it was successful. I'm kind of stuck. Does anyone have an idea of what I might try to solve this? Steve

sdingman: I am trying establish a connection from my laptop through a USB cable to a USB to TTL converter that uses the CH340 chip, to an ESP8266-01,

We need to know exactly which pins of the USB to TTL serial converter are connected to which pins on the ESP-01.

sdingman: I have selected the Tools\Board: "Generic ESP8266 Module"

I have a Bare Minimum sketch, as if a New selection is made in the Arduino IDE. [/quote] Did you successfully upload a sketch to the ESP-01? If so, you erased the AT firmware the ESP-01 comes with.

If you only want to send AT commands from your computer to an ESP-01 module running the AT firmware then it doesn't matter what you have selected from the Arduino IDE's Tools > Board menu or what sketch you have open because you're only using the Arduino IDE for its Serial Manager, which doesn't do anything with those settings. The only Arduino IDE menu that matters for Serial Monitor is the Tools > Port menu.

sdingman: I have tried 115200 baud and many others. Currently I have the Arduino IDE set to 9600.

The default baud rate of the ESP8266 AT firmware is 115200. Unless you have set a different baud rate using an AT command, it will be at 115200 and you should make sure the baud rate menu at the bottom right corner of Serial Monitor is set to 115200.

sdingman: This USB to Serial converter doesn't have a DTR Pin as one of the pins connected to the output pins available.

That's unfortunate, but it doesn't matter for what you're trying to do with it now. The DTR pin is only useful when you're using the converter to upload to an Arduino board.

Thank you Pert for your quick response. -First which USB to serial I have. I bought these:

https://www.amazon.com/gp/product/B00LZV1G6K/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1

It's accessible pins are: 5V, Vcc, 3V3, TxD, RxD, and Gnd. The 5V and the Vcc pins both put out 5 volts, the 3V3 pin puts out 3.3 volts. I am not using the 5V pin or the Vcc pin or the 3V3 pin because if this 3V3 pin is anything like the UNO 3.3 volt pin, it won't deliver the current that the ESP8266-01 may demand. Instead I using buck converter: QLOUNI LM2596 DC to DC Buck Converter 3.0-40V to 1.5-35V Power Supply Step Down Regulator Module, that I found at:

https://www.amazon.com/gp/product/B0788HNX1P/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&psc=1

I have one of these adjusted to 3.4 volts. The ESP82 66-01 ground is tied to the USB to Serial Gnd. -Second: The TxD of the USB to Serial is sent to a voltage divider made up of 1st a 1k Ohm to a 2k ohm, which goes to ground. At the junction of the 1k ohm and the 2k ohm is a connection to the RxD of the ESP8266-01. A 5 volt signal from the USB to Serial Tx pin, is converted to a 3.3 v signal, and sent to the Rx pin of the ESP. The TxD pin of the ESP8266-01 is sent directly to the RxD pin of the USB to Serial converter. -Third: No I did not upload any sketches to the ESP8266-01. I did think that using the Arduino IDE wasn't even necessary. So I tried just using the Cool Term program, which I have used to capture and save data to a file before, in another project. I like it a lot, but couldn't seem to get the input window to open for me, so I went back to the Arduino IDE. -Next the Baud rate setting to 115200 is what I thought the default was, but since I was having problems, I went back to reading some more and found that some people were saying that newer ESP-8266-01's were coming out with the default at 9600 Baud. One other detail, that I just noticed is that on the USB to Serial, there is a red Power LED, and I assume another LED for the Tx, and another for the Rx. I'm seeing the Power LED on, that I had seen before, but I'm also seeing another LED on constantly, but I don't know if its the Tx or the Rx LED. I would have thought that both the Tx and the Rx would both be off, until I sent something.

The last thing you said was interesting, that the DTR pin is only useful when you're uploading to an Arduino board. Thank you for that. So what ever the Terminal program I use, the problem must be in the settings of it, I would think. Steve

sdingman: or the 3V3 pin because if this 3V3 pin is anything like the UNO 3.3 volt pin, it won't deliver the current that the ESP8266-01 may demand. Instead I using buck converter: QLOUNI LM2596 DC to DC Buck Converter 3.0-40V to 1.5-35V Power Supply Step Down Regulator Module, that I found at:

https://www.amazon.com/gp/product/B0788HNX1P/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&psc=1

I have one of these adjusted to 3.4 volts.

Good move. That is a common mistake people make with the ESP8266. I believe the 3.3 V pin of the CH340 module (which comes straight from the CH340 is actually worse than the 3.3V pin of the Uno (which, at least on the official Uno, is powered by a dedicated voltage regulator). AT...OK and basic stuff like that will work from an inadequate power supply like the CH340 but then when they start using the WiFi radio they find it won't work reliably and don't understand it's because the radio draws much more current than the power supply can provide.

sdingman: I have one of these adjusted to 3.4 volts. The ESP82 66-01 ground is tied to the USB to Serial Gnd.

Do you have the circuit also connected to the ground of the step down module?

sdingman: I did think that using the Arduino IDE wasn't even necessary. So I tried just using the Cool Term program

That's correct. There's no magic to the Serial Monitor. It's just like any other terminal program, except without all the extra features the other terminal programs have that might confuse beginners.

sdingman: I went back to reading some more and found that some people were saying that newer ESP-8266-01's were coming out with the default at 9600 Baud.

Interesting. I haven't heard that before. It makes sense because it's very common for people to use the SoftwareSerial library to create an extra serial port to communicate with the ESP-01 on boards like the Uno that only have one hardware serial port. SoftwareSerial doesn't work reliably at 115200 baud so they have to go through this extra step of changing the baud rate to 9600 before they can even use it.

sdingman: So what ever the Terminal program I use, the problem must be in the settings of it, I would think.

I don't think your problem with Cool Term is in any way related to the DTR pin.

I went back to Cool Term and found what was eluding me. In the Options of Cool Term, there is the settings for Serial, Terminal, Receive, Transmit and Miscellaneous:

Serial Port - That selects the port, baud rate, data, parity, stop bits, Flow Control: CTS, DTR, and XON, Initial line States. My settings are: Port 5, Baud:115200, Data Bits: 8, Parity: none, Stop Bit: none, None of the Flow Controls are selected. I left the Initial Line States to there defaults of: DTR on, and RTS on.

Terminal - Settings for the Terminal Mode: Raw mode or Line Mode. I needed it to be Line Mode in order to be able to get the line to enter the AT Commands. This is what eluded me from using Cool Term before.

Terminal settings also include a selection of what the Enter Key does: CR+LF, CR, LF, or Custom. A selection to choose Local Echo and several other selections for Special Character Handling.

Receive, has several Receive options to set, none of which needed to be changed. This is where file save operations can be set, add Time Stamps, store location

Transmit Options: add delays, Send String Options.

Miscellaneous: Open when program starts, reduce refresh rate.

I have eliminated the other light from coming on, on the USB to Serial.

Now at least, when I send AT, I see the Tx light in the Cool Term program light up, but I don't see a Tx LED come on, on the USB to Serial, nor do I see an Rx LED come on, on the ESP8266-01.

Any ideas for what I can check? Steve

Any ideas for what I can check? Steve

What is the CH_PD pin of the ESP8266-01 connected to? It should be pulled to 3.3v directly or via resistor.

Thank you cattledog. The CH_PD is connected to Vcc=3.3 Volts via, a 10 k Ohm resistor. I also have the Reset pin connected to Vcc through a 10 k Ohm resistor. I have seen others who have left this Reset pin unconnected, I'll give that a try.

ok! I GOT SOMETHING! Here's what I did. In my last comment I mentioned that:

I have seen others who have left this Reset pin unconnected, I'll give that a try. I did, and I still got nothing, but it got me to thinking about what cattledog asked me about the CH_PD pin. He said: It should be pulled to 3.3v directly or via resistor.

I had CH_PD connected to Vcc via a 10 k Ohm resistor. So I though, I haven't tried connecting the CH_PD directly to Vcc. I did that and immediately upon connection data started pouring out of the ESP8266-01, with no input from me. AND IT GOES ON, and on, and on. It's all gibberish, I can't read a lick of it. So I thought, the Baud rate must be set incorrectly. So I changed it, returned power, then nothing. I still had a momentary contact switch to bring Reset to ground, so I pressed it and then the outpouring of data began again, still gibberish.

I disconnected, then reconnected, and without touching reset, the data began pouring out again. Now what?

Serial Port - That selects the port, baud rate, data, parity, stop bits, Flow Control: CTS, DTR, and XON, Initial line States. My settings are: Port 5, Baud:115200, Data Bits: 8, Parity: none, Stop Bit: none, None of the Flow Controls are selected. I left the Initial Line States to there defaults of: DTR on, and RTS on.

The Stop Bit should be 1. 8N1 is standard. Actually, my Cool Term serial port options menu does not have a setting for none.

CATTLEDOG, I was mistaken in my earlier post about the Stop Bits being None. You are correct None isn’t a selection and it’s default is 1. So the Stop Bits = 1. I HAVE GONE BACK INTO MY CIRCUIT AND reconnected the 10 k Ohm resistors and that does seem to affect what is coming out. With the resistors, the output is less than with no resistors. But no change results in getting anything back in response to any input I give it.

I’m starting to think that this unit has been corrupted somehow. I still have two more ESP8266-01, that have not been touched. How should I test another, without messing it up?

How should I test another, without messing it up?

Your really asking the wrong person. I'm a big fan of the Wemos and the Node MCU boards. Life is too short to be messing around with the bare modules :)

There are many tutorials on the web, and you appear to know well enough to sort the wheat from the chaff.

It’s a while since I played with these. I’ve not had any problems - suggest you look at the basic examples with the library and run those. The reset and GP100 (?)need to be connected correctly. Voltages need to be right - try loop back with your TTL/RS232 lead on its own. Finally the 8266 has a program to respond to AT commands - I found ( - I think!) , after uploading a program, the AT commands stop working .

Thank you hammy. I haven’t tried to upload any program to the ESP8266-01, only basic connection to send AT commands. Both Reset and GPIO-0 tied to Vcc=3.3 Volts through 10 k Ohm resisters. Ground of ESP8266-01 tied to the Ground of the USB to Serial Converter. The Tx of the USB to Serial Converter is ran through a 1 k + 2k Ohm voltage divider to Ground, converting the 5 volt Tx to 3.3 volt, that is sent to the Rx on the ESP8266-01. Steve

I originally bought 4 of the ESP8266-01 in 2017. I've not been successful with any of them. I am unhappy with these things requiring me to do double back flips through rings of fire, and still not getting them to work. I found one instructional that said essentially to hook up Vcc=3.3 volts and ground, then bring it near a computer that could pick up it's signal. If the signal couldn't be picked up, you might as well stop right there, cause it isn't working. I am about at the point of giving up on these things. Life is too short for this headache. I don't know what else I could have tried, as elaborated above, that I could have or should have done. My hair is singed from the rings of fire. Steve