SoftwareSerial with ESP8266

I am communicating with ESP8266 using Software Serial of Arduino UNO. I can successfully send AT commands and get response when communicating through the terminal. But if i programmatically send particular AT commands there is no response. For eg. I type AT in serial monitor I get OK But if i send the following through Software Serial pins
example:
mySerial.println("AT");

please help me solve this issue

I can successfully send AT commands and get response when communicating through the terminal.

do you do that with a simple echo program?

But if i send the following through Software Serial pins
example:

mySerial.println("AT");

post your code...

If you have been trying the ESP8266 just using the serial monitor you may have put it into a mode such that it doesn't respond to AT.
Try modifying the code below and see if that works for you.

SoftwareSerial esp(6,7); //Rx, Tx
Serial.begin(115200);// or you required baud rate
esp.println("AT+RST");
if (esp.find("OK")) Serial.println("Module Reset");

There may be a problem with your code, so post it after you have read the forum instructions.

(deleted)

spycatcher2k:

esp.print("AT+RST\r\n");

well println() prints data to the serial port as human-readable ASCII text followed by a carriage return character ('\r') and a newline character ('\n').

so it's the same as what you propose..

To the OP - be careful if you do a RST to not have GPIO grounded or it will go to flash mode. Of course Rx to Tx and Tx to Rx is a must...

I am trying the same approach with a gsm module. If I hook a serial connection from the GSM module to a PC and use a terminal program The GSM module responds to the AT commands. I have tried several combinations of serial commands with no luck (including those described above). I am using an Arduino Mega2560.

I have tried simply using the on board serial port:

/void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
Serial1.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println(“Goodnight moon!”);
while (!Serial1) {
; // wait for serial port to connect. Needed for native USB port only
}
}
void loop() {
Serial1.write(“ATD3177910350;\n\r”);
Serial.println(“Dialing”);
if (Serial1.available()) {
Serial.write(Serial1.read());
}
delay (15000);
Serial1.write(“ATH\n\r”);
if (Serial1.available()) {
Serial.write(Serial1.read());
}
delay (20000);
}
/

I have also tried using other pins as described in the previous provided example;

#include <SoftwareSerial.h>

SoftwareSerial mySerial(50, 51); // RX, TX

void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println(“Goodnight moon!”);

// set the data rate for the SoftwareSerial port
mySerial.begin(115200);
}

void loop() {
mySerial.write(“ATD3172016971;\n\r”);
Serial.println(“Dialing”);
if (mySerial.available()) {
Serial.write(mySerial.read());
}
delay (15000);
mySerial.write(“ATH\n\r”);
if (mySerial.available()) {
Serial.write(mySerial.read());
}
delay (20000);
}

I have tried; print, println and write to the serial port. It just seems like the commands are not being sent to the GSM module.

Any help would be greatly appreciated.

I found my problem...... I was going from Rx on the Arduino to Rx on the GSM, When I reversed them and went from TX on the Adrino to the RX on the GSM. It started working... So Cool..

if I send AT command from Serial monitor then it give "OK" response .
After searching on web I found other way . I install ESP8266 board in my arduino IDE and esptool.py .it work successfully.
But I want to take data from Arduino and send to wifi module.so wifi module data to web.

Is this possible?