3

enter image description here

Hello. I have begun working with an ESP8266 and an Arduino Uno. The connection I used is shown below, except I am using an Arduino Uno. The rest of the connection is the same.

The code I'm using is:

#include <SoftwareSerial.h>
SoftwareSerial ESPserial(2, 3); // RX | TX

void setup() {
  Serial.begin(9600);
  ESPserial.begin(9600);
  Serial.println("");
  Serial.println("Remember to to set Both NL & CR in the serial monitor.");
  Serial.println("Ready");
  Serial.println("");
}

void loop() {
  if (ESPserial.available()) {
    Serial.write( ESPserial.read() );
  }
  if (Serial.available()) {
    ESPserial.write(Serial.read());
  }
}

But the serial monitor is only printing:

Remember to to set Both NL & CR in the serial monitor.

Ready

What to do?

6
  • assume same connection as in diagram. Still not working. Commented May 20, 2017 at 18:17
  • thanks dear..i have edited the ques. Can u tell me i have to connect RST to GND. right? Commented May 20, 2017 at 18:24
  • thanks. Can u give me your email id. I have to complete a project. I need help. Commented May 20, 2017 at 18:26
  • still not working. i have connected the RST and CH_PD pin to 3.3V via 10K resistor. Commented May 20, 2017 at 18:33
  • I don't know then, sorry. Are you sure 9600 is the default baud rate for the ESP? Does resetting the ESP (quickly connect RST to GND) make anything appear, even junk?
    – Mark Smith
    Commented May 20, 2017 at 18:40

3 Answers 3

2

ESP8266 WiFi modules typically have a baud-rate of 115200. This not only won't work with a 9600 baud host but SoftwareSerial can't go that fast. Or, more precisely, it can generally push out characters at that speed but it can't keep up with incoming ones. See this answer for how to change the speed of your module to 9600 baud.

Short answer: You have to reconfigure your ESP module to 9600 baud to use it with SoftwareSerial. You can do it blind (transmit a baud-change command to it at 115200 baud, even though you won't be able to read the reply). Once done, it will remain at 9600 baud and successfully communicate in both directions.

1

ESP01 has two variants (blue PCB and black PCB), the old is configured to use 9600 baud (blue PCB) and the newer one uses 115200 baud (black PCB) as default.

There is also a difference in memory, 512kByte (4Mbit) or 1MB (8Mb) between the old and new version.

So try to change

ESPserial.begin(9600);

to

ESPserial.begin(115200);

And preferably both 9600 to 115200.

0

You need to pull RST high - that is, connect a 10k between +3.3v and the ESP8266-01's RST pin.

2
  • still not working. i have connected the RST and CH_PD pin to 3.3V via 10K resistor Commented May 20, 2017 at 18:40
  • gpio0 and gpio2 should also be high (gpio0 low for flash mode though) ... however, all my dev boards (for 07, 12E and 12F modules) have the pullups on 0 and 2 and a pulldown on 15. The base modules also seem to have a pullup on CH_PD and RST as well, so you can literally connect gnd/vcc/rx/tx and away you go - Commented Feb 21, 2018 at 21:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.